|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.indexer.partition.AsyncDumper
public class AsyncDumper
A class that will be used to dump partitions in an orderly fashion. This class dumps partitions asynchronously from the threads that did the indexing, so a thread that dumps a partition may continue indexing new data before the old data has been dumped to disk.
We use a bounded queue for dump requests in order to throttle the indexers when they attempt to dump if the dumper cannot keep up. Note that the longer the queue the more memory will be required to store the indexed but undumped data.
Field Summary | |
---|---|
protected boolean |
done
Whether we are done. |
protected static java.lang.String |
logTag
|
protected java.lang.String |
name
Our configuration name. |
protected int |
pollInterval
The interval for polling the partition queue. |
static java.lang.String |
PROP_DO_GC
|
static java.lang.String |
PROP_POLL_INTERVAL
The poll interval for the queue, in seconds. |
static java.lang.String |
PROP_QUEUE_LENGTH
The queue length property for configuration. |
protected java.lang.Thread |
t
The thread that is running our dumping. |
protected java.util.concurrent.BlockingQueue<com.sun.labs.minion.indexer.partition.AsyncDumper.StageHolder> |
toDump
A queue onto which partitions will be placed for dumping. |
Constructor Summary | |
---|---|
AsyncDumper()
Default constructor used for configuration. |
Method Summary | |
---|---|
void |
dump(Stage s)
Dumps the pipeline stage, which is assumed to be something that contains indexed data. |
void |
finish()
Tells the thread we're finished dumping and then waits for it to catch up. |
java.lang.String |
getName()
|
int |
getQueueLength()
Gets the length of the queue that this dumper is using to store partitions before dumping them. |
void |
newProperties(com.sun.labs.util.props.PropertySheet ps)
|
void |
run()
|
void |
setSearchEngine(SearchEngine e)
Sets the search engine that this dumper will be dumping partitions for. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.util.concurrent.BlockingQueue<com.sun.labs.minion.indexer.partition.AsyncDumper.StageHolder> toDump
protected int pollInterval
protected boolean done
protected java.lang.Thread t
@ConfigInteger(defaultValue=1) public static java.lang.String PROP_QUEUE_LENGTH
@ConfigInteger(defaultValue=3) public static java.lang.String PROP_POLL_INTERVAL
@ConfigBoolean(defaultValue=true) public static final java.lang.String PROP_DO_GC
protected static java.lang.String logTag
Constructor Detail |
---|
public AsyncDumper()
Method Detail |
---|
public void setSearchEngine(SearchEngine e)
Dumper
setSearchEngine
in interface Dumper
e
- the engine that this dumper will be used bypublic int getQueueLength()
Dumper
getQueueLength
in interface Dumper
public void dump(Stage s)
Dumper
dump
in interface Dumper
s
- a pipeline stage containing data to be dumped.public void run()
run
in interface java.lang.Runnable
public void finish()
finish
in interface Dumper
public void newProperties(com.sun.labs.util.props.PropertySheet ps) throws com.sun.labs.util.props.PropertyException
newProperties
in interface com.sun.labs.util.props.Configurable
com.sun.labs.util.props.PropertyException
public java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |