|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.chukwa.datacollection.writer.localfs.LocalWriter
public class LocalWriter
This class is thread-safe -- rotate() and save() both synchronize on lock object.
Write data to a local fileSystem then move it to the remote HDFS
Warning:
There's no lock/waiting time for the remote client.
The connection is released as soon as the last append is done,
so therefore there is no guarantee that this class will not loose
any data.
This class has been designed this way for performance reason.
In order to use this class, you need to define some parameters, in chukwa-collector-conf.xml
<property>
<name>chukwaCollector.localOutputDir</name>
<value>/grid/0/gs/chukwa/chukwa-0.1.2/dataSink/</value>
<description>Chukwa data sink directory</description>
</property>
<property>
<name>chukwaCollector.writerClass</name>
<value>org.apache.hadoop.chukwa.datacollection.writer.localfs.LocalWriter</value>
<description>Local chukwa writer</description>
</property>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.hadoop.chukwa.datacollection.writer.ChukwaWriter |
---|
ChukwaWriter.COMMIT_PENDING, ChukwaWriter.CommitStatus |
Field Summary |
---|
Fields inherited from interface org.apache.hadoop.chukwa.datacollection.writer.ChukwaWriter |
---|
COMMIT_FAIL, COMMIT_OK |
Constructor Summary | |
---|---|
LocalWriter()
|
Method Summary | |
---|---|
ChukwaWriter.CommitStatus |
add(List<Chunk> chunks)
Best effort, there's no guarantee that chunks have really been written to disk |
void |
close()
Called once, indicating that the writer should close files and prepare to exit. |
protected void |
computeTimePeriod()
|
void |
init(org.apache.hadoop.conf.Configuration conf)
Called once to initialize this writer. |
protected void |
rotate()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalWriter()
Method Detail |
---|
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
add
in interface ChukwaWriter
WriterException
protected void rotate()
public void close()
ChukwaWriter
close
in interface ChukwaWriter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |