org.apache.hadoop.chukwa.datacollection.writer
Class SeqFileWriter
java.lang.Object
org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter
- All Implemented Interfaces:
- ChukwaWriter
public class SeqFileWriter
- extends Object
- 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_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
currentOutputStr
protected org.apache.hadoop.fs.FSDataOutputStream currentOutputStr
rotateTimer
protected Timer rotateTimer
statTimer
protected Timer statTimer
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
- 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