public interface GraphProvider<G extends com.tinkerpop.blueprints.TransactionalGraph>
This level of indirection is needed because many graph databases provide configuration and management features that are not accessible through plain Blueprints API.
| Modifier and Type | Method and Description |
|---|---|
default void |
commit(G graph,
InventoryBackend.Transaction t)
Commits the transaction in the graph.
|
void |
ensureIndices(G graph,
IndexSpec... indexSpecs)
Makes sure all the indexes needed for good performance.
|
G |
instantiateGraph(Configuration configuration)
Given provided configuration, tries to instantiate a graph to be used by the inventory.
|
default void |
rollback(G graph,
InventoryBackend.Transaction t)
Rolls back the transaction in the graph.
|
default InventoryBackend.Transaction |
startTransaction(G graph,
boolean mutating)
Starts a new transaction in the graph.
|
G instantiateGraph(Configuration configuration)
configuration - the configuration of the graphvoid ensureIndices(G graph, IndexSpec... indexSpecs)
The provided set of indexes is what the implementation thinks the indices should be. The graph provider is free to make more indexes if they choose so to support the "core" set of indices.
graph - the graph instance (coming from the
instantiateGraph(org.hawkular.inventory.api.Configuration) call) to indexindexSpecs - the core set of indices to definedefault InventoryBackend.Transaction startTransaction(G graph, boolean mutating)
The default implementation returns a new instance of
InventoryBackend.Transaction with the provided mutating flag.
graph - the graph to start the transaction inmutating - whether the transaction will mutate the storage or notdefault void commit(G graph, InventoryBackend.Transaction t)
The default implementation merely calls TransactionalGraph.commit().
graph - the graph to commit the transaction tot - the transactiondefault void rollback(G graph, InventoryBackend.Transaction t)
The default implementation merely calls TransactionalGraph.rollback().
graph - the graph to rollback the transaction fromt - the transactionCopyright © 2015 Red Hat, Inc.. All rights reserved.