@NotThreadSafe public class TimePartitionedStreamFileWriter extends PartitionedFileWriter<co.cask.cdap.api.flow.flowlet.StreamEvent,TimePartitionedStreamFileWriter.TimePartition>
[streamName]/[partitionName]/[bucketName].[dat|idx]
Where .dat is the event data file, .idx is the accompany index file.
partitionName is formatted as
[partitionStartTime].[duration]with both
partitionStartTime and duration in seconds.
bucketName is formatted as
"bucket".[bucketId].[seqNo]where the
bucketId is an integer. The seqNo is a strictly increasing integer for the same
bucketId.| Modifier and Type | Class and Description |
|---|---|
static class |
TimePartitionedStreamFileWriter.TimePartition
Uses timestamp to represent partition information.
|
PartitionedFileWriter.PartitionedFileWriterFactory<T,P>| Constructor and Description |
|---|
TimePartitionedStreamFileWriter(Location streamLocation,
long partitionDuration,
String fileNamePrefix,
long indexInterval) |
| Modifier and Type | Method and Description |
|---|---|
protected TimePartitionedStreamFileWriter.TimePartition |
getPartition(co.cask.cdap.api.flow.flowlet.StreamEvent event)
Returns the partition ID for the given event.
|
protected void |
partitionChanged(TimePartitionedStreamFileWriter.TimePartition oldPartition,
TimePartitionedStreamFileWriter.TimePartition newPartition)
Invoked when partition changed (different from the last event get appended).
|
append, appendAll, close, closePartitionWriter, flushprotected TimePartitionedStreamFileWriter.TimePartition getPartition(co.cask.cdap.api.flow.flowlet.StreamEvent event)
PartitionedFileWritergetPartition in class PartitionedFileWriter<co.cask.cdap.api.flow.flowlet.StreamEvent,TimePartitionedStreamFileWriter.TimePartition>event - The event for computing a partition ID.protected void partitionChanged(TimePartitionedStreamFileWriter.TimePartition oldPartition, TimePartitionedStreamFileWriter.TimePartition newPartition) throws IOException
PartitionedFileWriterpartitionChanged in class PartitionedFileWriter<co.cask.cdap.api.flow.flowlet.StreamEvent,TimePartitionedStreamFileWriter.TimePartition>IOExceptionCopyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.