|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.storage.NativeValueIndex
public class NativeValueIndex
Maintains an index on typed node values. TODO: Check correct types during validation. In the BTree single BFile, the keys are : (collectionId, indexType, indexData) and the values are : gid1, gid2-gid1, ...
Algorithm:
When a node is stored, an entry is added or updated in thepending map,
with given String content and basic type as key.
This way, the index entries are easily put in the persistent BFile storage by
flush() .
| Field Summary | |
|---|---|
static double |
DEFAULT_VALUE_CACHE_GROWTH
|
static double |
DEFAULT_VALUE_KEY_THRESHOLD
|
static double |
DEFAULT_VALUE_VALUE_THRESHOLD
|
static String |
FILE_KEY_IN_CONFIG
|
static String |
FILE_NAME
|
static byte |
IDX_GENERIC
|
static byte |
IDX_QNAME
|
static int |
LENGTH_NODE_IDS
|
static int |
LENGTH_VALUE_TYPE
|
static int |
OFFSET_COLLECTION_ID
|
static int |
OFFSET_DATA
|
static int |
OFFSET_VALUE_TYPE
|
static String |
PROPERTY_INDEX_CASE_SENSITIVE
|
static int |
WITH_PATH
|
static int |
WITHOUT_PATH
|
| Constructor Summary | |
|---|---|
NativeValueIndex(DBBroker broker,
byte id,
String dataDir,
Configuration config)
|
|
| Method Summary | |
|---|---|
boolean |
close()
|
void |
closeAndRemove()
|
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,
String content)
store and index given element (called storeElement before) |
NodeSet |
find(int relation,
DocumentSet docs,
NodeSet contextSet,
int axis,
QName qname,
Indexable value)
find |
void |
flush()
|
String |
getConfigKeyForFile()
|
String |
getFileName()
|
NativeValueIndex |
getInstance()
|
NodeSet |
match(DocumentSet docs,
NodeSet contextSet,
int axis,
String expr,
QName qname,
int type)
|
NodeSet |
match(DocumentSet docs,
NodeSet contextSet,
int axis,
String expr,
QName qname,
int type,
int flags,
boolean caseSensitiveQuery)
Regular expression search |
void |
printStatistics()
|
void |
remove()
remove all pending modifications, for the current document. |
void |
removeElement(ElementImpl node,
NodePath currentPath,
String content)
Mark given Element for removal; added entries are written to the list of pending entries. |
ValueOccurrences[] |
scanIndexKeys(DocumentSet docs,
NodeSet contextSet,
Indexable start)
|
void |
setDocument(DocumentImpl document)
set the current document; generally called before calling an operation |
void |
startElement(ElementImpl node,
NodePath currentPath,
boolean index)
corresponds to SAX function of the same name |
void |
storeAttribute(AttrImpl node,
NodePath currentPath,
int indexingHint,
RangeIndexSpec spec,
boolean remove)
Store the given attribute's value in the value index. |
void |
storeElement(ElementImpl node,
String content,
int xpathType,
byte indexType,
boolean remove)
Store the given element's value in the value index. |
void |
storeText(TextImpl node,
NodePath currentPath,
int indexingHint)
store and index given text node |
void |
sync()
triggers a cache sync, i.e. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String FILE_NAME
public static final String FILE_KEY_IN_CONFIG
public static final int WITH_PATH
public static final int WITHOUT_PATH
public static final double DEFAULT_VALUE_CACHE_GROWTH
public static final double DEFAULT_VALUE_KEY_THRESHOLD
public static final double DEFAULT_VALUE_VALUE_THRESHOLD
public static final int LENGTH_VALUE_TYPE
public static final int LENGTH_NODE_IDS
public static final int OFFSET_COLLECTION_ID
public static final int OFFSET_VALUE_TYPE
public static final int OFFSET_DATA
public static final byte IDX_GENERIC
public static final byte IDX_QNAME
public static String PROPERTY_INDEX_CASE_SENSITIVE
| Constructor Detail |
|---|
public NativeValueIndex(DBBroker broker,
byte id,
String dataDir,
Configuration config)
throws DBException
DBException| Method Detail |
|---|
public String getFileName()
getFileName in interface ContentLoadingObserverpublic String getConfigKeyForFile()
getConfigKeyForFile in interface ContentLoadingObserverpublic NativeValueIndex getInstance()
public void setDocument(DocumentImpl document)
ContentLoadingObserver
setDocument in interface ContentLoadingObserver
public void storeElement(ElementImpl node,
String content,
int xpathType,
byte indexType,
boolean remove)
xpathType - The value typenode - The elementcontent - The string representation of the value
public void storeAttribute(AttrImpl node,
NodePath currentPath,
int indexingHint,
RangeIndexSpec spec,
boolean remove)
storeAttribute in interface ContentLoadingObserverspec - The index specificationnode - The attribute
public void storeText(TextImpl node,
NodePath currentPath,
int indexingHint)
ContentLoadingObserver
storeText in interface ContentLoadingObserver
public void startElement(ElementImpl node,
NodePath currentPath,
boolean index)
ContentLoadingObserver
startElement in interface ContentLoadingObserver
public void endElement(int xpathType,
ElementImpl node,
String content)
ContentLoadingObserver
endElement in interface ContentLoadingObserver
public void removeElement(ElementImpl node,
NodePath currentPath,
String content)
ContentLoadingObserverContentLoadingObserver.flush() is called later to flush all pending entries.
removeElement in interface ContentLoadingObserverpublic void sync()
ContentLoadingObserver
sync in interface ContentLoadingObserverpublic void flush()
flush in interface ContentLoadingObserverpublic void remove()
ContentLoadingObserver
remove in interface ContentLoadingObserverpublic void dropIndex(Collection collection)
ContentLoadingObserver
dropIndex in interface ContentLoadingObserver
public void dropIndex(DocumentImpl document)
throws ReadOnlyException
ContentLoadingObserver
dropIndex in interface ContentLoadingObserverReadOnlyException
public NodeSet find(int relation,
DocumentSet docs,
NodeSet contextSet,
int axis,
QName qname,
Indexable value)
throws TerminatedException
relation - binary operator used for the comparisonvalue - right hand comparison value
TerminatedException
public NodeSet match(DocumentSet docs,
NodeSet contextSet,
int axis,
String expr,
QName qname,
int type)
throws TerminatedException,
EXistException
TerminatedException
EXistException
public NodeSet match(DocumentSet docs,
NodeSet contextSet,
int axis,
String expr,
QName qname,
int type,
int flags,
boolean caseSensitiveQuery)
throws TerminatedException,
EXistException
type - like type argument for RegexMatcher constructorflags - like flags argument for RegexMatcher constructor
TerminatedException
EXistException
public ValueOccurrences[] scanIndexKeys(DocumentSet docs,
NodeSet contextSet,
Indexable start)
public void closeAndRemove()
closeAndRemove in interface ContentLoadingObserver
public boolean close()
throws DBException
close in interface ContentLoadingObserverDBExceptionpublic void printStatistics()
printStatistics in interface ContentLoadingObserverpublic String toString()
toString in class Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||