public abstract class SchemaIndexProvider extends LifecycleAdapter implements Comparable<SchemaIndexProvider>
IndexingService is notified. It will, in turn, ask
your SchemaIndexProvider for a batch index writer.
A background index job is triggered, and all existing data that applies to the new rule, as well as new data
from the "outside", will be inserted using the writer. You are guaranteed that usage of this writer,
during population, will be single threaded.
These are the rules you must adhere to here:
InternalIndexState.ONLINEIndexPopulator.close(boolean)
method, that population is done, and that the index should turn it's state to InternalIndexState.ONLINE or
InternalIndexState.FAILED depending on the value given to the
close method.
If the index is persisted to disk, this is a vital part of the index lifecycle.
For a persisted index, the index MUST NOT store the state as online unless it first guarantees that the entire index
is flushed to disk. Failure to do so could produce a situation where, after a crash,
an index is believed to be online when it in fact was not yet fully populated. This would break the database
recovery process.
If you are implementing this interface, you can choose to not store index state. In that case,
you should report index state as InternalIndexState.POPULATING upon startup.
This will cause the database to re-create the index from scratch again.
These are the rules you must adhere to here:
InternalIndexState.ONLINEInternalIndexState.POPULATINGonline accessor to
write to the index.| Modifier and Type | Class and Description |
|---|---|
static class |
SchemaIndexProvider.Descriptor |
| Modifier and Type | Field and Description |
|---|---|
static DependencyResolver.SelectionStrategy<SchemaIndexProvider> |
HIGHEST_PRIORITIZED_OR_NONE |
static SchemaIndexProvider |
NO_INDEX_PROVIDER |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(SchemaIndexProvider o) |
boolean |
equals(Object o) |
abstract InternalIndexState |
getInitialState(long indexId)
Called during startup to find out which state an index is in.
|
abstract IndexAccessor |
getOnlineAccessor(long indexId,
IndexConfiguration config)
Used for updating an index once initial population has completed.
|
abstract IndexPopulator |
getPopulator(long indexId,
IndexConfiguration config)
Used for initially populating a created index, using batch insertion.
|
SchemaIndexProvider.Descriptor |
getProviderDescriptor() |
int |
hashCode() |
init, shutdown, start, stoppublic static final SchemaIndexProvider NO_INDEX_PROVIDER
public static final DependencyResolver.SelectionStrategy<SchemaIndexProvider> HIGHEST_PRIORITIZED_OR_NONE
public abstract IndexPopulator getPopulator(long indexId, IndexConfiguration config)
public abstract IndexAccessor getOnlineAccessor(long indexId, IndexConfiguration config) throws IOException
IOExceptionpublic abstract InternalIndexState getInitialState(long indexId)
public SchemaIndexProvider.Descriptor getProviderDescriptor()
public int compareTo(SchemaIndexProvider o)
compareTo in interface Comparable<SchemaIndexProvider>Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.