|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
public interface IndexWorker
Provide concurrent access to the index structure. Implements the core operations on the index.
The methods in this class are used in a multi-threaded environment. Every thread accessing the
database will have exactly one IndexWorker for every index. Index.getWorker()
should thus return a new IndexWorker whenever it is called. Implementations of IndexWorker have
to take care of synchronizing access to shared resources.
| Method Summary | |
|---|---|
Object |
configure(IndexController controller,
NodeList configNodes,
Map namespaces)
Read an index configuration from an collection.xconf configuration document. |
void |
flush()
Flush the index. |
String |
getIndexId()
Returns an ID which uniquely identifies this index. |
String |
getIndexName()
Returns an name which uniquely identifies this index. |
StreamListener |
getListener(int mode,
DocumentImpl document)
Return a stream listener to index the specified document in the specified mode. |
MatchListener |
getMatchListener(NodeProxy proxy)
Returns a MatchListener, which can be used to filter
(and manipulate) the XML output generated by the serializer when serializing
query results. |
StoredNode |
getReindexRoot(StoredNode node,
NodePath path,
boolean includeSelf)
When adding or removing nodes to or from the document tree, it might become necessary to reindex some parts of the tree, in particular if indexes are defined on mixed content nodes. |
void |
removeCollection(Collection collection)
Remove all indexes for the given collection, its subcollections and all resources.. |
Occurrences[] |
scanIndex(DocumentSet docs)
|
void |
setDocument(DocumentImpl doc,
int mode)
Notify this worker to operate on the specified document, using the mode given. |
| Method Detail |
|---|
String getIndexId()
String getIndexName()
Object configure(IndexController controller,
NodeList configNodes,
Map namespaces)
throws DatabaseConfigurationException
CollectionConfiguration while
reading the collection.xconf configuration file for a given collection. The configNodes
parameter lists all top-level child nodes below the <index> element in the
collection.xconf. The IndexWorker should scan this list and handle those elements
it understands.
The returned Object will be stored in the collection configuration structure associated
with each collection. It can later be retrieved from the collection configuration, e.g. to
check if a given node should be indexed or not.
configNodes - lists the top-level child nodes below the <index> element in collection.xconfnamespaces - the active prefix/namespace map
DatabaseConfigurationException - if a configuration error occursvoid flush()
void setDocument(DocumentImpl doc,
int mode)
StreamListener.STORE, StreamListener.REMOVE_NODES or
StreamListener.REMOVE_ALL_NODES.
doc - the document which is processedmode - the current operation mode
StreamListener getListener(int mode,
DocumentImpl document)
mode - one of StreamListener.STORE, StreamListener.REMOVE_NODES or
StreamListener.REMOVE_ALL_NODES.document - the document to be indexed.
MatchListener getMatchListener(NodeProxy proxy)
MatchListener, which can be used to filter
(and manipulate) the XML output generated by the serializer when serializing
query results. The method should return null if the implementation is not interested
in receiving serialization events.
proxy - the NodeProxy which is being serialized
void removeCollection(Collection collection)
collection - Occurrences[] scanIndex(DocumentSet docs)
StoredNode getReindexRoot(StoredNode node,
NodePath path,
boolean includeSelf)
getReindexRoot(org.exist.dom.StoredNode, org.exist.storage.NodePath, boolean)
on each configured index. It will then return the top-most root.
node - the node to be modified.path - path the NodePath of the nodeincludeSelf - if set to true, the current node itself will be included in the check
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||