public interface GraphProvider
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(org.apache.tinkerpop.gremlin.structure.Graph graph)
Commits the transaction in the graph.
|
void |
ensureIndices(org.apache.tinkerpop.gremlin.structure.Graph graph,
IndexSpec... indexSpecs)
Makes sure all the indexes needed for good performance.
|
org.apache.tinkerpop.gremlin.structure.Graph |
instantiateGraph(Configuration configuration)
Given provided configuration, tries to instantiate a graph to be used by the inventory.
|
boolean |
isPreferringBigTransactions() |
default boolean |
isTransactionRetryWarranted(org.apache.tinkerpop.gremlin.structure.Graph graph,
Throwable t)
Tries to determine if a transaction retry has a chance of recovering from a condition signified by the provided
throwable.
|
boolean |
isUniqueIndexSupported() |
boolean |
needsDraining()
Some implementations need the pipeline to be fully drained in order to be able to reclaim backend resources.
|
default boolean |
requiresRollbackAfterFailure(Throwable t)
Checks the exception thrown during the commit and returns true if the backend requires explicit rollback after
such failure occured or false if the failure caused the transaction to close itself automatically.
|
default void |
rollback(org.apache.tinkerpop.gremlin.structure.Graph graph)
Rolls back the transaction in the graph.
|
default org.apache.tinkerpop.gremlin.structure.Graph |
startTransaction(org.apache.tinkerpop.gremlin.structure.Graph graph)
Initializes new transaction for use with given graph.
|
default RuntimeException |
translateException(RuntimeException inputException,
org.hawkular.inventory.paths.CanonicalPath affectedPath)
Translates the graph specific exception to an inventory exception.
|
boolean isPreferringBigTransactions()
boolean needsDraining()
boolean isUniqueIndexSupported()
InventoryBackendorg.apache.tinkerpop.gremlin.structure.Graph instantiateGraph(Configuration configuration)
configuration - the configuration of the graphvoid ensureIndices(org.apache.tinkerpop.gremlin.structure.Graph 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(Configuration) call) to indexindexSpecs - the core set of indices to definedefault org.apache.tinkerpop.gremlin.structure.Graph startTransaction(org.apache.tinkerpop.gremlin.structure.Graph graph)
graph - the graph to start the transaction indefault void commit(org.apache.tinkerpop.gremlin.structure.Graph graph)
The default implementation merely calls Transaction.commit().
graph - the graph to commit the transaction todefault void rollback(org.apache.tinkerpop.gremlin.structure.Graph graph)
The default implementation merely calls Transaction.rollback().
graph - the graph to rollback the transaction fromdefault RuntimeException translateException(RuntimeException inputException, org.hawkular.inventory.paths.CanonicalPath affectedPath)
The default implementation is an identity function.
inputException - an exception to convertaffectedPath - the canonical path of the entity affected by the exceptiondefault boolean requiresRollbackAfterFailure(Throwable t)
t - the exception thrown during commitdefault boolean isTransactionRetryWarranted(org.apache.tinkerpop.gremlin.structure.Graph graph,
Throwable t)
graph - t - a throwable that caused a transaction payload to fail.Copyright © 2015–2016 Red Hat, Inc.. All rights reserved.