org.apache.hadoop.chukwa.datacollection.test
Class FilePerPostWriter

java.lang.Object
  extended by org.apache.hadoop.chukwa.datacollection.writer.PipelineableWriter
      extended by org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter
          extended by org.apache.hadoop.chukwa.datacollection.test.FilePerPostWriter
All Implemented Interfaces:
ChukwaWriter

public class FilePerPostWriter
extends SeqFileWriter

A writer that writes a file for each post. Intended ONLY for architectural performance comparisons. Do not use this in production.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter
SeqFileWriter.StatReportingTask
 
Nested classes/interfaces inherited from interface org.apache.hadoop.chukwa.datacollection.writer.ChukwaWriter
ChukwaWriter.COMMIT_PENDING, ChukwaWriter.CommitStatus
 
Field Summary
protected  org.apache.hadoop.conf.Configuration conf
           
protected  String currentFileName
           
protected  org.apache.hadoop.fs.Path currentPath
           
protected  org.apache.hadoop.fs.FileSystem fs
           
protected  String outputDir
           
 
Fields inherited from class org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter
bytesThisRotate, currentOutputStr, dataSize, ENABLE_ROTATION_ON_CLOSE, isRunning, localHostAddr, lock, nextTimePeriodComputation, OUTPUT_DIR_OPT, ROTATE_INTERVAL_OPT, rotateTimer, seqFileWriter, STAT_INTERVAL_SECONDS, STAT_PERIOD_OPT, statTimer, timePeriod
 
Fields inherited from interface org.apache.hadoop.chukwa.datacollection.writer.ChukwaWriter
COMMIT_FAIL, COMMIT_OK
 
Constructor Summary
FilePerPostWriter()
           
 
Method Summary
 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.
 
Methods inherited from class org.apache.hadoop.chukwa.datacollection.writer.SeqFileWriter
computeTimePeriod, getBytesWritten
 
Methods inherited from class org.apache.hadoop.chukwa.datacollection.writer.PipelineableWriter
setNextStage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

FilePerPostWriter

public FilePerPostWriter()
Method Detail

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 SeqFileWriter
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
Overrides:
close in class SeqFileWriter

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
Overrides:
init in class SeqFileWriter
Throws:
WriterException


Copyright © ${year} The Apache Software Foundation