public abstract class LuceneAutoIndex<T extends Element> extends LuceneIndex<T> implements OracleAutoIndex<T>
EDGE_ID_PROP, EDGE_LABEL_PROP, END_NODE_ID_PROP, START_NODE_ID_PROP, TYPE_DT_BOOL, TYPE_DT_DATE, TYPE_DT_DOUBLE, TYPE_DT_FLOAT, TYPE_DT_INTEGER, TYPE_DT_SERIALIZABLE, TYPE_DT_STRING, VERTEX_ID_PROP
Constructor and Description |
---|
LuceneAutoIndex(String indexName, Class<T> indexClass, OraclePropertyGraphBase graph, Parameter<String,Object>[] indexParameters, boolean erase)
Constructs a new LuceneAutoIndex object.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this OracleIndex object
|
abstract void |
closeConnectionsArray()
Closes the associated connection array used to load vertices/edges in parallel from the underlying graph.
|
boolean |
containsIndexedKey(String key)
Verifies if the given key is already indexed using this automatic index.
|
abstract Object[] |
getConnectionsArray()
Gets the connection array used to load vertices/edges in parallel from the underlying graph.
|
abstract Iterable<T> |
getElementsFromPG()
Gets an Iterable<T> of elements from the associated property graph.
|
abstract Iterable<T> |
getElementsFromPG(String key)
Gets an Iterable<T> of elements from the associated property graph, matching the specified key.
|
abstract Iterable<T> |
getElementsFromPG(String[] keys)
Gets an Iterable<T> of elements from the associated property graph, matching any of the specified keys.
|
abstract Iterable<T>[] |
getElementsFromPG(String[] keys, Object[] conns, int startSplitID)
Gets an array of
CloseableIterable objects that hold all the elements with an attribute matching any of the given key property names. |
Set<String> |
getIndexedKeys()
Get the keys associated to this auto index.
|
abstract int |
getPartitionsNumber()
Gets the number of partitions (or splits) of the element's table for the associated property graph.
|
void |
indexElements()
Index elements in a property graph with respect to the current indexed keys.
|
void |
indexElementsPartitioned()
Index elements in a property graph with respect to the current indexed keys using getElementsPartitioned APIs.
|
List<String> |
loadIndexedKeys()
Gets a list of all the indexed keys used for this automatic index.
|
void |
put(String key, Object value, T element)
Indexes an element with respect to the specified key and value.
|
void |
put(String key, Object value, T element, OracleIndexWriter[] indexWriters)
Indexes an element with respect to the specified key and value.
|
void |
reindexElements()
Re-index the elements of the associated property graph based on the current indexed keys.
|
void |
reindexElements(String key)
Re-index the elements of the associated property graph based on the specified key.
|
void |
reindexElements(String[] indexedKeys)
Re-index the elements of the associated property graph based on the specified keys using getElementsPartitioned APIs.
|
void |
reindexElementsNoPartitioned(String[] indexedKeys)
Re-index the elements of the associated property graph based on the specified keys.
|
void |
reindexElementsPartitioned()
Re-index the elements of the associated property graph based on the current indexed keys using getElementsPartitioned APIs.
|
void |
reindexElementsPartitioned(String key)
Re-index the elements of the associated property graph based on the specified key using getElementsPartitioned APIs.
|
void |
reindexElementsPartitioned(String[] indexedKeys)
Re-index all elements over a partitioned graph.
|
add, addToDeleteCache, buildSearchTerm, buildSearchTerm, clearIndex, commit, count, count, count, deleteExistingDirectories, dropIndex, get, get, get, getDirectory, getDirectoryName, getDocIdentifier, getGraphName, getIndexClass, getIndexName, getIndexParameters, getOracleDirectory, getOracleIndexParameters, getOracleSearcherManager, getParameters, getPartitioned, getPartitioned, getSearcherFactory, getTotalShards, isAutoIndex, isDelBatchEmpty, isDelBatchFull, isUpdatesBatchEmpty, isUpdatesBatchFull, query, query, remove, remove, remove, remove, removeAll, removeAll
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
add, buildSearchTerm, buildSearchTerm, clearIndex, commit, count, count, dropIndex, get, getDirectoryName, getDocIdentifier, getGraphName, getIndexClass, getOracleIndexParameters, getParameters, getPartitioned, getPartitioned, getTotalShards, isDelBatchEmpty, isDelBatchFull, isUpdatesBatchEmpty, isUpdatesBatchFull, query, refreshIndex, remove, removeAll
public LuceneAutoIndex(String indexName, Class<T> indexClass, OraclePropertyGraphBase graph, Parameter<String,Object>[] indexParameters, boolean erase)
indexName
- the name of the index.indexClass
- the element class that this index is indexing (can be base class)graph
- an OraclePropertyGraphBase
object.indexParameters
- a collection of parameters for the underlying index implementation.erase
- a boolean specifying if the index should be cleared at the beginning.public void close()
close
in interface OracleIndex<T extends Element>
close
in class LuceneIndex<T extends Element>
public abstract void closeConnectionsArray()
closeConnectionsArray
in interface OracleAutoIndex<T extends Element>
public boolean containsIndexedKey(String key)
containsIndexedKey
in interface OracleAutoIndex<T extends Element>
public abstract Object[] getConnectionsArray() throws Exception
getConnectionsArray
in interface OracleAutoIndex<T extends Element>
Exception
public abstract Iterable<T> getElementsFromPG()
getElementsFromPG
in interface OracleAutoIndex<T extends Element>
public abstract Iterable<T> getElementsFromPG(String key)
getElementsFromPG
in interface OracleAutoIndex<T extends Element>
key
- name of the property. It can be NULL which implies all vertices in the graph will be returned.public abstract Iterable<T> getElementsFromPG(String[] keys)
getElementsFromPG
in interface OracleAutoIndex<T extends Element>
keys
- an array of property key names. It can be NULL which implies all vertices in the graph will be returned.public abstract Iterable<T>[] getElementsFromPG(String[] keys, Object[] conns, int startSplitID)
CloseableIterable
objects that hold all the elements with an attribute matching any of the given key property names. Each element in the CloseableIterable
array uses a separate connection provided to fetch a subset of the results from a corresponding OraclePropertyGraph instance. Note that we assign an integer ID (in the range of [0, N - 1]) to all the splits of a vertex or edge table with N splits. The subset of splits queried will consist of those shards with ID value in the range of [startSplitID, startSplitID - 1 + size of connections array].getElementsFromPG
in interface OracleAutoIndex<T extends Element>
keys
- an array of property key names. It can be NULL which implies all vertices in the graph will be returned.conns
- an array of Object connections to the database where the property graph relies.startSplitID
- the start split ID used to query the property graph.public final Set<String> getIndexedKeys()
getIndexedKeys
in interface OracleAutoIndex<T extends Element>
public abstract int getPartitionsNumber()
getPartitionsNumber
in interface OracleAutoIndex<T extends Element>
public final void indexElements()
indexElements
in interface OracleAutoIndex<T extends Element>
public final void indexElementsPartitioned()
indexElementsPartitioned
in interface OracleAutoIndex<T extends Element>
public List<String> loadIndexedKeys()
loadIndexedKeys
in interface OracleAutoIndex<T extends Element>
public final void put(String key, Object value, T element)
public final void put(String key, Object value, T element, OracleIndexWriter[] indexWriters)
put
in class LuceneIndex<T extends Element>
key
- the key to index the element by.value
- the value to index the element by.element
- the element to index.indexWriters
- if not null, the cache of indexWriters to use, this avoids opening/closing index writers at flush time, but locks writing operations over the index.public void reindexElements()
reindexElements
in interface OracleAutoIndex<T extends Element>
public void reindexElements(String key)
reindexElements
in interface OracleAutoIndex<T extends Element>
key
- the key to use for re-indexing.public void reindexElements(String[] indexedKeys)
reindexElements
in interface OracleAutoIndex<T extends Element>
indexedKeys
- an array of the indexed keys to use for re-indexing.public void reindexElementsNoPartitioned(String[] indexedKeys)
reindexElementsNoPartitioned
in interface OracleAutoIndex<T extends Element>
indexedKeys
- an array of the indexed keys to use for re-indexing.public void reindexElementsPartitioned()
reindexElementsPartitioned
in interface OracleAutoIndex<T extends Element>
public void reindexElementsPartitioned(String key)
reindexElementsPartitioned
in interface OracleAutoIndex<T extends Element>
key
- the key to use for re-indexing.public void reindexElementsPartitioned(String[] indexedKeys)
reindexElementsPartitioned
in interface OracleAutoIndex<T extends Element>
indexedKeys
- an array of keys to be indexedCopyright © 2015 Oracle and/or its afflilates. All Rights Reserved.