|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
org.exist.storage.ElementIndex
org.exist.storage.NativeElementIndex
public class NativeElementIndex
The indexing occurs in this class. That is, during the loading of a document
into the database, the process of associating a long gid with each element,
and the subsequent storing of the NodeProxy
on disk.
Constructor Summary | |
---|---|
NativeElementIndex(DBBroker broker,
BFile dbNodes)
|
Method Summary | |
---|---|
void |
addNode(QName qname,
NodeProxy proxy)
Store the given node in the node index. |
boolean |
close()
|
void |
consistencyCheck(DocumentImpl document)
|
void |
dropIndex(Collection collection)
Drop all index entries for the given collection. |
void |
dropIndex(DocumentImpl document)
Drop all index entries for the given document. |
void |
endElement(int xpathType,
ElementImpl node,
java.lang.String content)
store and index given element (called storeElement before) |
NodeSet |
findDescendantsByTagName(byte type,
QName qname,
int axis,
DocumentSet docs,
ExtArrayNodeSet contextSet,
int contextId)
Optimized lookup method which directly implements the ancestor-descendant join. |
NodeSet |
findElementsByTagName(byte type,
DocumentSet docs,
QName qname,
NodeSelector selector)
Lookup elements or attributes in the index matching a given QName and
NodeSelector . |
void |
flush()
writes the pending items, for the current document's collection |
void |
printStatistics()
|
void |
reindex(DocumentImpl document,
StoredNode node)
Reindexes all pending items for the specified document. |
void |
remove()
remove all pending modifications, for the current document. |
void |
removeElement(ElementImpl node,
NodePath currentPath,
java.lang.String content)
Mark given Element for removal; added entries are written to the list of pending entries. |
Occurrences[] |
scanIndexedElements(Collection collection,
boolean inclusive)
|
void |
startElement(ElementImpl impl,
NodePath currentPath,
boolean index)
corresponds to SAX function of the same name |
void |
storeAttribute(AttrImpl node,
NodePath currentPath,
boolean fullTextIndexSwitch)
store and index given attribute |
void |
storeText(TextImpl node,
NodePath currentPath,
boolean fullTextIndexSwitch)
store and index given text node |
void |
sync()
triggers a cache sync, i.e. |
java.lang.String |
toString()
|
Methods inherited from class org.exist.storage.ElementIndex |
---|
setDocument, setInUpdateMode |
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.exist.storage.ContentLoadingObserver |
---|
setDocument |
Constructor Detail |
---|
public NativeElementIndex(DBBroker broker, BFile dbNodes)
Method Detail |
---|
public void addNode(QName qname, NodeProxy proxy)
qname
- The node's identityproxy
- The node's proxypublic void storeAttribute(AttrImpl node, NodePath currentPath, boolean fullTextIndexSwitch)
ContentLoadingObserver
storeAttribute
in interface ContentLoadingObserver
public void storeText(TextImpl node, NodePath currentPath, boolean fullTextIndexSwitch)
ContentLoadingObserver
storeText
in interface ContentLoadingObserver
public void startElement(ElementImpl impl, NodePath currentPath, boolean index)
ContentLoadingObserver
startElement
in interface ContentLoadingObserver
public void endElement(int xpathType, ElementImpl node, java.lang.String content)
ContentLoadingObserver
endElement
in interface ContentLoadingObserver
public void removeElement(ElementImpl node, NodePath currentPath, java.lang.String content)
ContentLoadingObserver
ContentLoadingObserver.flush()
is called later to flush all pending entries.
removeElement
in interface ContentLoadingObserver
public void sync()
ContentLoadingObserver
sync
in interface ContentLoadingObserver
public void flush()
ContentLoadingObserver
flush
in interface ContentLoadingObserver
public void remove()
ContentLoadingObserver
remove
in interface ContentLoadingObserver
public void dropIndex(Collection collection)
ContentLoadingObserver
dropIndex
in interface ContentLoadingObserver
public void dropIndex(DocumentImpl document) throws ReadOnlyException
ContentLoadingObserver
dropIndex
in interface ContentLoadingObserver
ReadOnlyException
public void reindex(DocumentImpl document, StoredNode node)
ContentLoadingObserver
#addNode(QName, NodeProxy)
, #storeElement(int, ElementImpl, String),
and {@link #storeAttribute(RangeIndexSpec, AttrImpl)}. Method reindex then scans this
list and updates the items in the index to reflect the reindexed document.
reindex
in interface ContentLoadingObserver
document
- the document to be reindexed.node
- if != null, only nodes being descendants of the specified node will be
reindexed. Other nodes are not touched. This is used for a partial reindex.public NodeSet findElementsByTagName(byte type, DocumentSet docs, QName qname, NodeSelector selector)
QName
and
NodeSelector
. The NodeSelector argument is optional. If selector is
null, all elements or attributes matching qname will be returned.
findElementsByTagName
in class ElementIndex
type
- either ElementValue.ATTRIBUTE
, ElementValue.ELEMENT
or ElementValue.ATTRIBUTE_ID
docs
- the set of documents to look up in the indexqname
- the QName of the attribute or elementselector
- an (optional) NodeSelector
public NodeSet findDescendantsByTagName(byte type, QName qname, int axis, DocumentSet docs, ExtArrayNodeSet contextSet, int contextId)
findElementsByTagName(byte, DocumentSet, QName, NodeSelector)
.
findDescendantsByTagName
in class ElementIndex
type
- either ElementValue.ATTRIBUTE
, ElementValue.ELEMENT
or ElementValue.ATTRIBUTE_ID
docs
- the set of documents to look up in the indexcontextSet
- the set of ancestor nodes for which the method will try to find descendantscontextId
- id of the current context expression as passed by the query engineqname
- the QName to search forpublic Occurrences[] scanIndexedElements(Collection collection, boolean inclusive) throws PermissionDeniedException
scanIndexedElements
in class ElementIndex
PermissionDeniedException
public void consistencyCheck(DocumentImpl document) throws EXistException
EXistException
public boolean close() throws DBException
DBException
public void printStatistics()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |