public class StreamSegment extends Object
| Constructor and Description |
|---|
StreamSegment() |
| Modifier and Type | Method and Description |
|---|---|
static StreamFileIndex |
appendBatchData(org.apache.carbondata.common.CarbonIterator<Object[]> inputIterators,
org.apache.hadoop.mapreduce.TaskAttemptContext job,
org.apache.carbondata.processing.loading.model.CarbonLoadModel carbonLoadModel)
invoke CarbonStreamOutputFormat to append batch data to existing carbondata file
|
static String |
close(org.apache.carbondata.core.metadata.schema.table.CarbonTable table,
String segmentId)
marker old stream segment to finished status and create new stream segment
|
static org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex |
collectMinMaxIndex(org.apache.carbondata.core.datastore.page.statistics.SimpleStatsResult[] dimStats,
org.apache.carbondata.core.datastore.page.statistics.SimpleStatsResult[] mrsStats) |
static void |
finishStreaming(org.apache.carbondata.core.metadata.schema.table.CarbonTable carbonTable)
change the status of the segment from "streaming" to "streaming finish"
|
static org.apache.carbondata.core.datastore.filesystem.CarbonFile[] |
listDataFiles(String segmentDir,
org.apache.carbondata.core.datastore.impl.FileFactory.FileType fileType)
list all carbondata files of a segment
|
static org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex |
mergeBlockletMinMax(org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex to,
org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex from,
org.apache.carbondata.core.metadata.datatype.DataType[] msrDataTypes)
merge blocklet min/max to generate batch min/max
|
static String |
open(org.apache.carbondata.core.metadata.schema.table.CarbonTable table)
get stream segment or create new stream segment if not exists
|
static List<org.apache.carbondata.format.BlockIndex> |
readIndexFile(String indexPath,
org.apache.carbondata.core.datastore.impl.FileFactory.FileType fileType)
read index file to list BlockIndex
|
static void |
recoverFileIfRequired(String segmentDir,
String fileName,
String indexName)
check the health of stream data file and try to recover data file from task fault
this method will be invoked in following scenarios.
|
static void |
recoverSegmentIfRequired(String segmentDir)
check the health of stream segment and try to recover segment from job fault
this method will be invoked in following scenarios.
|
static long |
size(String segmentDir)
calculate the size of the segment by the accumulation of data sizes in index file
|
static void |
updateIndexFile(String segmentDir,
StreamFileIndex[] blockIndexes,
org.apache.carbondata.core.metadata.datatype.DataType[] msrDataTypes)
update carbon index file after a stream batch.
|
public static String open(org.apache.carbondata.core.metadata.schema.table.CarbonTable table) throws IOException
IOExceptionpublic static String close(org.apache.carbondata.core.metadata.schema.table.CarbonTable table, String segmentId) throws IOException
IOExceptionpublic static void finishStreaming(org.apache.carbondata.core.metadata.schema.table.CarbonTable carbonTable)
throws IOException
IOExceptionpublic static org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex collectMinMaxIndex(org.apache.carbondata.core.datastore.page.statistics.SimpleStatsResult[] dimStats,
org.apache.carbondata.core.datastore.page.statistics.SimpleStatsResult[] mrsStats)
public static StreamFileIndex appendBatchData(org.apache.carbondata.common.CarbonIterator<Object[]> inputIterators, org.apache.hadoop.mapreduce.TaskAttemptContext job, org.apache.carbondata.processing.loading.model.CarbonLoadModel carbonLoadModel) throws Exception
Exceptionpublic static void recoverSegmentIfRequired(String segmentDir) throws IOException
IOExceptionpublic static void recoverFileIfRequired(String segmentDir, String fileName, String indexName) throws IOException
IOExceptionpublic static org.apache.carbondata.core.datastore.filesystem.CarbonFile[] listDataFiles(String segmentDir, org.apache.carbondata.core.datastore.impl.FileFactory.FileType fileType)
public static List<org.apache.carbondata.format.BlockIndex> readIndexFile(String indexPath, org.apache.carbondata.core.datastore.impl.FileFactory.FileType fileType) throws IOException
indexPath - path of the index filefileType - file type of the index fileIOExceptionpublic static org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex mergeBlockletMinMax(org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex to,
org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex from,
org.apache.carbondata.core.metadata.datatype.DataType[] msrDataTypes)
public static void updateIndexFile(String segmentDir, StreamFileIndex[] blockIndexes, org.apache.carbondata.core.metadata.datatype.DataType[] msrDataTypes) throws IOException
IOExceptionpublic static long size(String segmentDir) throws IOException
IOExceptionCopyright © 2016–2018 The Apache Software Foundation. All rights reserved.