com.sun.labs.minion.pipeline
Class Dropper

java.lang.Object
  extended by com.sun.labs.minion.pipeline.StageAdapter
      extended by com.sun.labs.minion.pipeline.Dropper
All Implemented Interfaces:
Stage, PipelineStage, com.sun.labs.util.props.Component, com.sun.labs.util.props.Configurable

public class Dropper
extends StageAdapter

A class that just drops things, but keeps track of the amount of data processed.


Field Summary
protected  float bytesProcessed
          The number of bytes that have been indexed.
protected  int docsProcessed
          The number of documents that we've processed.
protected  java.text.DecimalFormat form
          A format object for formatting the output.
protected static java.lang.Object lock
           
protected static java.lang.String logTag
          The log tag.
protected static int PROGRESS_INTERVAL
          The number of files to index between progress reports.
protected  long startTime
          The time that we started indexing.
 
Fields inherited from class com.sun.labs.minion.pipeline.StageAdapter
downstream, name
 
Constructor Summary
Dropper()
           
 
Method Summary
 void endDocument(long size)
          Processes the event that comes at the end of a document.
 void reportProgress()
          Reports on our progress.
 void token(Token t)
          Processes a token from further up the pipeline.
protected  java.lang.String toMB(long x)
           
 
Methods inherited from class com.sun.labs.minion.pipeline.StageAdapter
defineField, dump, endField, getDownstream, getName, newProperties, punctuation, savedData, setDownstream, setName, shutdown, startDocument, startField, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lock

protected static java.lang.Object lock

startTime

protected long startTime
The time that we started indexing.


docsProcessed

protected int docsProcessed
The number of documents that we've processed.


bytesProcessed

protected float bytesProcessed
The number of bytes that have been indexed.


form

protected java.text.DecimalFormat form
A format object for formatting the output.


PROGRESS_INTERVAL

protected static int PROGRESS_INTERVAL
The number of files to index between progress reports.


logTag

protected static java.lang.String logTag
The log tag.

Constructor Detail

Dropper

public Dropper()
Method Detail

token

public void token(Token t)
Processes a token from further up the pipeline.

Specified by:
token in interface Stage
Overrides:
token in class StageAdapter
Parameters:
t - The token to process.

endDocument

public void endDocument(long size)
Processes the event that comes at the end of a document.

Specified by:
endDocument in interface Stage
Overrides:
endDocument in class StageAdapter
Parameters:
size - The size of the data that was processed for this file.

toMB

protected java.lang.String toMB(long x)

reportProgress

public void reportProgress()
Reports on our progress.