org.apache.hadoop.chukwa.datacollection.writer
Class InMemoryWriter
java.lang.Object
org.apache.hadoop.chukwa.datacollection.writer.InMemoryWriter
- All Implemented Interfaces:
- ChukwaWriter
public class InMemoryWriter
- extends Object
- implements ChukwaWriter
Method Summary |
void |
add(Chunk data)
|
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. |
void |
init(org.apache.hadoop.conf.Configuration conf)
Called once to initialize this writer. |
Chunk |
readOutChunk(int bytes,
int ms)
Try to read bytes, waiting up to ms |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InMemoryWriter
public InMemoryWriter()
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
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
add
public void add(Chunk data)
throws WriterException
- Throws:
WriterException
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
readOutChunk
public Chunk readOutChunk(int bytes,
int ms)
throws IOException
- Try to read bytes, waiting up to ms
- Parameters:
bytes
- amount to try to readms
- time to wait
- Returns:
- a newly read-in chunk
- Throws:
IOException
Copyright © ${year} The Apache Software Foundation