org.apache.hadoop.chukwa.datacollection.writer
Class SeqFileWriter
java.lang.Object
org.apache.hadoop.chukwa.datacollection.writer.PipelineableWriter
org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter
- All Implemented Interfaces:
- ChukwaWriter
- Direct Known Subclasses:
- FilePerPostWriter
public class SeqFileWriter
- extends PipelineableWriter
- implements ChukwaWriter
This class is thread-safe -- rotate() and save() both synchronize on
this object.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ENABLE_ROTATION_ON_CLOSE
public static boolean ENABLE_ROTATION_ON_CLOSE
STAT_INTERVAL_SECONDS
protected int STAT_INTERVAL_SECONDS
STAT_PERIOD_OPT
public static final String STAT_PERIOD_OPT
- See Also:
- Constant Field Values
ROTATE_INTERVAL_OPT
public static final String ROTATE_INTERVAL_OPT
- See Also:
- Constant Field Values
OUTPUT_DIR_OPT
public static final String OUTPUT_DIR_OPT
- See Also:
- Constant Field Values
localHostAddr
protected static String localHostAddr
lock
protected final Semaphore lock
fs
protected org.apache.hadoop.fs.FileSystem fs
conf
protected org.apache.hadoop.conf.Configuration conf
outputDir
protected String outputDir
currentPath
protected org.apache.hadoop.fs.Path currentPath
currentFileName
protected String currentFileName
currentOutputStr
protected org.apache.hadoop.fs.FSDataOutputStream currentOutputStr
seqFileWriter
protected org.apache.hadoop.io.SequenceFile.Writer seqFileWriter
timePeriod
protected long timePeriod
nextTimePeriodComputation
protected long nextTimePeriodComputation
rotateTimer
protected Timer rotateTimer
statTimer
protected Timer statTimer
dataSize
protected volatile long dataSize
bytesThisRotate
protected volatile long bytesThisRotate
isRunning
protected volatile boolean isRunning
SeqFileWriter
public SeqFileWriter()
getBytesWritten
public long getBytesWritten()
init
public void init(org.apache.hadoop.conf.Configuration conf)
throws WriterException
- Description copied from interface:
ChukwaWriter
- Called once to initialize this writer.
- Specified by:
init
in interface ChukwaWriter
- Throws:
WriterException
computeTimePeriod
protected void computeTimePeriod()
add
public ChukwaWriter.CommitStatus add(List<Chunk> chunks)
throws WriterException
- Description copied from interface:
ChukwaWriter
- Called repeatedly with data that should be serialized.
Subclasses may assume that init() will be called before any calls to
add(), and that add() won't be called after close().
- Specified by:
add
in interface ChukwaWriter
- Overrides:
add
in class PipelineableWriter
- Returns:
-
- Throws:
WriterException
close
public void close()
- Description copied from interface:
ChukwaWriter
- Called once, indicating that the writer should close files and prepare
to exit.
- Specified by:
close
in interface ChukwaWriter
Copyright © ${year} The Apache Software Foundation