|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.pipeline.AbstractPipelineImpl
public abstract class AbstractPipelineImpl
An abstract implementation of pipeline.
Field Summary | |
---|---|
protected java.lang.String |
currKey
The current key that we're working on. |
protected java.text.SimpleDateFormat |
d64
A date format for dates including milliseconds. |
protected long |
docSize
The size of the current document, in characters. |
protected Dumper |
dumper
A place where we can dump our data. |
protected SearchEngine |
engine
The engine that is using this pipeline. |
protected Stage |
head
The stage at the head of the pipeline. |
protected static java.lang.String |
logTag
Our log tag. |
protected java.util.List<Stage> |
pipeline
The list of stages making up the pipeline. |
protected char[] |
text
Character data taken from a field. |
Constructor Summary | |
---|---|
AbstractPipelineImpl(PipelineFactory factory,
SearchEngine engine,
java.util.List<Stage> pipeline,
Dumper dumper)
Creates a AbstractPipelineImpl |
Method Summary | |
---|---|
FieldInfo |
addImpliedField(java.lang.String name)
|
void |
endDocument()
Ends the current document. |
SearchEngine |
getEngine()
|
Stage |
getHead()
Gets the head of the pipeline. |
Stage |
getIndexer()
Gets the indexer stage for this pipline. |
protected void |
handleField(FieldInfo fi,
java.lang.Object val)
Handles a single field value, which may have several instances. |
protected long |
handleField(FieldInfo fi,
java.lang.Object val,
IndexableString.Type type)
Handle the characters for one instance of a given field. |
protected void |
indexDoc(java.lang.String key,
java.util.Map m)
Does the actual work of indexing a document. |
boolean |
isIndexed(java.lang.String key)
Indicates whether a document has been indexed or not. |
protected void |
realDump()
Does actual dumping of the indexed data and resetting of the indexing stage so that dumps may proceed asynchronously, if required. |
protected void |
realPurge()
Purges the current in-memory data, not dumping it out to disk. |
void |
setIndexer(Stage s)
Sets the indexing stage for this pipeline. |
void |
startDocument(java.lang.String key)
Starts the indexing of a document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.labs.minion.Pipeline |
---|
dump, flush, index, purge, shutdown |
Field Detail |
---|
protected java.util.List<Stage> pipeline
protected Stage head
protected Dumper dumper
protected java.text.SimpleDateFormat d64
protected SearchEngine engine
protected static java.lang.String logTag
protected char[] text
protected java.lang.String currKey
protected long docSize
Constructor Detail |
---|
public AbstractPipelineImpl(PipelineFactory factory, SearchEngine engine, java.util.List<Stage> pipeline, Dumper dumper)
Method Detail |
---|
public SearchEngine getEngine()
public Stage getHead()
Pipeline
getHead
in interface Pipeline
public Stage getIndexer()
public void setIndexer(Stage s)
protected void handleField(FieldInfo fi, java.lang.Object val) throws java.io.IOException
java.io.IOException
protected long handleField(FieldInfo fi, java.lang.Object val, IndexableString.Type type)
fi
- The field information for the field we're adding to.val
- The data as a string.type
- The type of markup in the value. This is take from the
IndexableString.Type
enum.
IndexableString
,
IndexableFile
protected void indexDoc(java.lang.String key, java.util.Map m) throws SearchEngineException
SearchEngineException
public FieldInfo addImpliedField(java.lang.String name)
public boolean isIndexed(java.lang.String key)
key
- the document key for the document that we wish to check.
true
if the document is in the index,
false
otherwise. A document has been indexed if its
document key is in the index and the document has not been deleted.public void endDocument()
SearchEngineException
- if there is any error ending the document.public void startDocument(java.lang.String key)
key
- the document key for the document. If this is a
duplicate, then any old data associated with the document will be
removed.
java.lang.NullPointerException
- if the document key is nullprotected void realDump()
protected void realPurge()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |