public class StreamSegment extends Object
| Constructor and Description |
|---|
StreamSegment() |
| Modifier and Type | Method and Description |
|---|---|
static void |
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 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 String |
open(org.apache.carbondata.core.metadata.schema.table.CarbonTable table)
get stream segment or create new stream segment if not exists
|
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)
update carbonindex 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 void 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 void updateIndexFile(String segmentDir) throws IOException
IOExceptionpublic static long size(String segmentDir) throws IOException
IOExceptionCopyright © 2016–2018 The Apache Software Foundation. All rights reserved.