public interface Schema
Modifier and Type | Interface and Description |
---|---|
static class |
Schema.IndexState
The states that an index can be in.
|
Modifier and Type | Method and Description |
---|---|
void |
awaitIndexesOnline(long duration,
TimeUnit unit)
Wait until all indices comes online
|
void |
awaitIndexOnline(IndexDefinition index,
long duration,
TimeUnit unit)
Wait until an index comes online
|
ConstraintCreator |
constraintFor(Label label)
Returns a
ConstraintCreator where details about the constraint can be
specified. |
Iterable<ConstraintDefinition> |
getConstraints() |
Iterable<ConstraintDefinition> |
getConstraints(Label label) |
Iterable<IndexDefinition> |
getIndexes() |
Iterable<IndexDefinition> |
getIndexes(Label label) |
String |
getIndexFailure(IndexDefinition index)
If
getIndexState(IndexDefinition) return Schema.IndexState.FAILED this method will
return the failure description. |
Schema.IndexState |
getIndexState(IndexDefinition index)
Poll the database for the state of a given index.
|
IndexCreator |
indexFor(Label label)
Returns an
IndexCreator where details about the index to create can be
specified. |
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 indexString getIndexFailure(IndexDefinition index)
getIndexState(IndexDefinition)
return Schema.IndexState.FAILED
this method will
return the failure description.index
- the IndexDescriptor
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 have the transaction creating it block on commit until
all existing data has been verified for compliance. If any existing data doesn't
comply with the constraint the transaction will not be able to commit, but
fail in Transaction.close()
.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()
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–2014 The Neo4j Graph Database Project. All rights reserved.