public interface Schema
Modifier and Type | Interface and Description |
---|---|
static class |
Schema.IndexState
The states that an index can be in.
|
IndexCreator indexFor(Label label)
IndexCreator
where details about the index to create can be
specified. When all details have been entered create
must be called for it to actually be created.
Creating an index enables indexing for nodes with the specified label. The index will
have the details supplied to the returned index creator
.
All existing and all future nodes matching the index definition will be indexed,
speeding up future operations.label
- label
on nodes to be indexedIndexCreator
capable of providing details for, as well as creating
an index for the given label
.Iterable<IndexDefinition> getIndexes(Label label)
Iterable<IndexDefinition> getIndexes()
indexes
in this database.Schema.IndexState getIndexState(IndexDefinition index)
populating
in the background, or has come
online
.index
- the index that we want to poll state forSchema.IndexState
of the indexIndexPopulationProgress getIndexPopulationProgress(IndexDefinition index)
populating
or online
, the state will contain current
progress. If the index is failed
then the state returned from this method
should be regarded as invalid.index
- the index that we want to poll state forString getIndexFailure(IndexDefinition index)
getIndexState(IndexDefinition)
return Schema.IndexState.FAILED
this method will
return the failure description.index
- the IndexDefinition
to get failure from.IllegalStateException
- if the index
isn't in a Schema.IndexState.FAILED
state.ConstraintCreator constraintFor(Label label)
ConstraintCreator
where details about the constraint can be
specified. When all details have been entered ConstraintCreator.create()
must be called for it to actually be created.
Creating a constraint will block on the create method until
all existing data has been verified for compliance. If any existing data doesn't comply with the constraint an
exception will be thrown, and the constraint will not be created.label
- the label this constraint is for.ConstraintCreator
capable of providing details for, as well as creating
a constraint for the given label.Iterable<ConstraintDefinition> getConstraints(Label label)
label
- the label to get constraints for.Iterable<ConstraintDefinition> getConstraints(RelationshipType type)
type
- the relationship type to get constraints for.Iterable<ConstraintDefinition> getConstraints()
void awaitIndexOnline(IndexDefinition index, long duration, TimeUnit unit)
index
- the index that we want to wait forduration
- duration to wait for the index to come onlineunit
- TimeUnit of durationIllegalStateException
- if the index did not enter the ONLINE state
within the given duration or if the index entered the FAILED
statevoid awaitIndexesOnline(long duration, TimeUnit unit)
duration
- duration to wait for all indexes to come onlineunit
- TimeUnit of durationIllegalStateException
- if some index did not enter the ONLINE
state within the given duration or if the index entered the
FAILED stateCopyright © 2002–2017 The Neo4j Graph Database Project. All rights reserved.