public class SeqFileWriter extends PipelineableWriter implements ChukwaWriter
Modifier and Type | Class and Description |
---|---|
class |
SeqFileWriter.StatReportingTask |
ChukwaWriter.COMMIT_PENDING, ChukwaWriter.CommitStatus
Modifier and Type | Field and Description |
---|---|
protected long |
bytesThisRotate |
protected org.apache.hadoop.conf.Configuration |
conf |
protected String |
currentFileName |
protected org.apache.hadoop.fs.FSDataOutputStream |
currentOutputStr |
protected org.apache.hadoop.fs.Path |
currentPath |
protected long |
dataSize |
static String |
FIXED_INTERVAL_OFFSET_OPT |
protected org.apache.hadoop.fs.FileSystem |
fs |
static String |
IF_FIXED_INTERVAL_OPT |
protected boolean |
isRunning |
String |
localHostAddr |
protected Semaphore |
lock |
protected long |
nextTimePeriodComputation |
static String |
OUTPUT_DIR_OPT |
protected String |
outputDir |
static String |
ROTATE_INTERVAL_OPT |
protected Timer |
rotateTimer |
protected org.apache.hadoop.io.SequenceFile.Writer |
seqFileWriter |
protected int |
STAT_INTERVAL_SECONDS |
static String |
STAT_PERIOD_OPT |
protected Timer |
statTimer |
protected long |
timePeriod |
next
COMMIT_FAIL, COMMIT_OK
Constructor and Description |
---|
SeqFileWriter() |
Modifier and Type | Method and Description |
---|---|
ChukwaWriter.CommitStatus |
add(List<Chunk> chunks)
Called repeatedly with data that should be serialized.
|
void |
close()
Called once, indicating that the writer should close files and prepare
to exit.
|
protected void |
computeTimePeriod() |
long |
getBytesWritten() |
void |
init(org.apache.hadoop.conf.Configuration conf)
Called once to initialize this writer.
|
static void |
setEnableRotationOnClose(boolean b) |
setNextStage
protected int STAT_INTERVAL_SECONDS
public static final String STAT_PERIOD_OPT
public static final String ROTATE_INTERVAL_OPT
public static final String IF_FIXED_INTERVAL_OPT
public static final String FIXED_INTERVAL_OFFSET_OPT
public static final String OUTPUT_DIR_OPT
public String localHostAddr
protected final Semaphore lock
protected org.apache.hadoop.fs.FileSystem fs
protected org.apache.hadoop.conf.Configuration conf
protected String outputDir
protected org.apache.hadoop.fs.Path currentPath
protected String currentFileName
protected org.apache.hadoop.fs.FSDataOutputStream currentOutputStr
protected org.apache.hadoop.io.SequenceFile.Writer seqFileWriter
protected long timePeriod
protected long nextTimePeriodComputation
protected Timer rotateTimer
protected Timer statTimer
protected volatile long dataSize
protected volatile long bytesThisRotate
protected volatile boolean isRunning
public long getBytesWritten()
public void init(org.apache.hadoop.conf.Configuration conf) throws WriterException
ChukwaWriter
init
in interface ChukwaWriter
WriterException
protected void computeTimePeriod()
public ChukwaWriter.CommitStatus add(List<Chunk> chunks) throws WriterException
ChukwaWriter
add
in interface ChukwaWriter
add
in class PipelineableWriter
WriterException
public void close()
ChukwaWriter
close
in interface ChukwaWriter
public static void setEnableRotationOnClose(boolean b)
Copyright © 2015 Apache Software Foundation. All Rights Reserved.