public class StandardTransactionBuilder extends Object implements TransactionConfiguration, TransactionBuilder
TitanTransaction.TitanTransaction| Constructor and Description |
|---|
StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig,
StandardTitanGraph graph)
Constructs a new TitanTransaction configuration with default configuration parameters.
|
StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig,
StandardTitanGraph graph,
Configuration customOptions) |
| Modifier and Type | Method and Description |
|---|---|
StandardTransactionBuilder |
checkExternalVertexExistence(boolean enabled)
Enables/disables checking whether the vertex with a user provided id indeed exists.
|
StandardTransactionBuilder |
checkInternalVertexExistence(boolean enabled)
Enables/disables checks that verify that each vertex actually exists in the underlying data store when it is retrieved.
|
StandardTransactionBuilder |
commitTime(java.time.Instant timestampSinceEpoch)
Sets the timestamp for this transaction.
|
TransactionBuilder |
consistencyChecks(boolean enabled)
Enables/disables consistency checking and locking for this transaction.
|
TransactionBuilder |
customOption(String k,
Object v)
Configures a custom option on this transaction which will be passed through to the storage and indexing backends.
|
TransactionBuilder |
dirtyVertexSize(int size)
Configures the initial size of the map of modified vertices held by this
transaction.
|
StandardTransactionBuilder |
disableBatchLoading()
Disables batch loading by ensuring that consistency checks are applied in this transaction.
|
StandardTransactionBuilder |
enableBatchLoading()
Enabling batch loading disables a number of consistency checks inside Titan to speed up the ingestion of
data under the assumptions that inconsistencies are resolved prior to loading.
|
DefaultSchemaMaker |
getAutoSchemaMaker() |
java.time.Instant |
getCommitTime()
Returns the commit time of this transaction which is either a custom timestamp provided
by the user, the commit time as set by the enclosing operation, or the first time this method is called.
|
<V> V |
getCustomOption(ConfigOption<V> opt)
Get an arbitrary transaction-specific option.
|
Configuration |
getCustomOptions()
Return any transaction-specific options.
|
int |
getDirtyVertexSize()
The initial size of the dirty (modified) vertex map used by a transaction.
|
String |
getGroupName()
Returns the (possibly null) group name for this transaction.
|
long |
getIndexCacheWeight()
The maximum weight for the index cache store used in this particular transaction
|
String |
getLogIdentifier()
The name of the log to be used for logging the mutations in this transaction.
|
int[] |
getRestrictedPartitions()
Querying of partitioned vertices is restricted to the partitions returned by this
method.
|
TimestampProvider |
getTimestampProvider()
Returns the timestamp provider of this transaction.
|
int |
getVertexCacheSize()
The maximum number of recently-used vertices to cache in this transaction.
|
StandardTransactionBuilder |
groupName(String p)
Sets the group name for this transaction which provides a way for gathering
reporting on multiple transactions into one group.
|
boolean |
hasAcquireLocks()
Whether the persistence layer should acquire locks for this transaction during persistence.
|
boolean |
hasAssignIDsImmediately() |
boolean |
hasCommitTime()
Returns true if a commit time has been set on this transaction.
|
boolean |
hasEnabledBatchLoading()
Whether this transaction should be optimized for batch-loading, i.e.
|
boolean |
hasForceIndexUsage()
Whether this transaction should throw an exception when a graph query is issued that cannot be answered
with any existing index but instead requires a full graph-scan.
|
boolean |
hasGroupName()
True when
BaseTransactionConfig.getGroupName() is non-null, false when null. |
boolean |
hasPreloadedData()
Whether the incident relation data on vertices is being externally pre-loaded.
|
boolean |
hasPropertyPrefetching()
Whether this transaction loads all properties on a vertex when a single property is requested.
|
boolean |
hasRestrictedPartitions()
Returns true of the queryied partitions should be restricted in this transaction
|
boolean |
hasVerifyExternalVertexExistence()
Whether the graph transaction is configured to verify that a vertex with the id GIVEN BY THE USER actually exists
in the database or not.
|
boolean |
hasVerifyInternalVertexExistence()
Whether the graph transaction is configured to verify that a vertex with the id actually exists
in the database or not on every retrieval.
|
boolean |
hasVerifyUniqueness()
Whether the graph transaction is configured to verify that an added key does not yet exist in the database.
|
boolean |
isReadOnly()
Checks whether the graph transaction is configured as read-only.
|
boolean |
isSingleThreaded()
Whether this transaction is only accessed by a single thread.
|
boolean |
isThreadBound()
Whether this transaction is bound to a running thread.
|
StandardTransactionBuilder |
logIdentifier(String logName)
Name of the log to be used for logging the mutations in this transaction.
|
StandardTransactionBuilder |
readOnly()
Makes the transaction read only.
|
TransactionBuilder |
restrictedPartitions(int[] partitions)
Configures this transaction such that queries against partitioned vertices are
restricted to the given partitions.
|
void |
setCommitTime(java.time.Instant time)
Sets the commit time of this transaction.
|
TransactionBuilder |
setPreloadedData(boolean preloaded) |
TitanTransaction |
start()
Starts and returns the transaction build by this builder
|
StandardTransactionBuilder |
threadBound() |
StandardTransactionBuilder |
vertexCacheSize(int size)
Configures the size of the internal caches used in the transaction.
|
public StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig, StandardTitanGraph graph)
public StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig, StandardTitanGraph graph, Configuration customOptions)
public StandardTransactionBuilder threadBound()
public StandardTransactionBuilder readOnly()
TransactionBuilderreadOnly in interface TransactionBuilderpublic StandardTransactionBuilder enableBatchLoading()
TransactionBuilderenableBatchLoading in interface TransactionBuilderpublic StandardTransactionBuilder disableBatchLoading()
TransactionBuilderdisableBatchLoading in interface TransactionBuilderpublic StandardTransactionBuilder vertexCacheSize(int size)
TransactionBuildervertexCacheSize in interface TransactionBuilderpublic TransactionBuilder dirtyVertexSize(int size)
TransactionBuilderdirtyVertexSize in interface TransactionBuildersize - initial size of the transaction's dirty vertex collectionpublic StandardTransactionBuilder checkInternalVertexExistence(boolean enabled)
TransactionBuildercheckInternalVertexExistence in interface TransactionBuilderpublic StandardTransactionBuilder checkExternalVertexExistence(boolean enabled)
TransactionBuildercheckExternalVertexExistence in interface TransactionBuilderpublic TransactionBuilder consistencyChecks(boolean enabled)
TransactionBuilderconsistencyChecks in interface TransactionBuilderpublic StandardTransactionBuilder commitTime(java.time.Instant timestampSinceEpoch)
TransactionBuildercommitTime in interface TransactionBuildertimestampSinceEpoch - The instant at which the commit took placepublic void setCommitTime(java.time.Instant time)
BaseTransactionConfigBaseTransactionConfig.hasCommitTime() to check prior to setting.setCommitTime in interface BaseTransactionConfigpublic StandardTransactionBuilder groupName(String p)
TransactionBuilderIf null, Metrics collection is totally disabled for this transaction.
If empty, Metrics collection is enabled, but there will be no prefix. Where the default setting would generate metrics names in the form "prefix.x.y.z", this transaction will instead use metric names in the form "x.y.z".
If nonempty, Metrics collection is enabled and the prefix will be used for all of this transaction's measurements.
Note: setting this to a non-null value only partially overrides
GraphDatabaseConfiguration.BASIC_METRICS = false in the graph
database configuration. When Metrics are disabled at the graph level and
enabled at the transaction level, storage backend timings and counters
will remain disabled.
The default value is
GraphDatabaseConfiguration.METRICS_PREFIX_DEFAULT.
Sets the name prefix used for Metrics recorded by this transaction. If
metrics is enabled via GraphDatabaseConfiguration.BASIC_METRICS,
this string will be prepended to all Titan metric names.
groupName in interface TransactionBuilderp - Metric name prefix for this transactionpublic StandardTransactionBuilder logIdentifier(String logName)
TransactionBuilderlogIdentifier in interface TransactionBuilderpublic TransactionBuilder restrictedPartitions(int[] partitions)
TransactionBuilderrestrictedPartitions in interface TransactionBuilderpublic TransactionBuilder setPreloadedData(boolean preloaded)
public TransactionBuilder customOption(String k, Object v)
TransactionBuildercustomOption in interface TransactionBuilderpublic TitanTransaction start()
TransactionBuilderstart in interface TransactionBuilderpublic final boolean isReadOnly()
TransactionConfigurationisReadOnly in interface TransactionConfigurationpublic final boolean hasAssignIDsImmediately()
hasAssignIDsImmediately in interface TransactionConfigurationpublic boolean hasPreloadedData()
TransactionConfigurationhasPreloadedData in interface TransactionConfigurationpublic final boolean hasForceIndexUsage()
TransactionConfigurationhasForceIndexUsage in interface TransactionConfigurationpublic boolean hasEnabledBatchLoading()
TransactionConfigurationhasEnabledBatchLoading in interface TransactionConfigurationpublic final boolean hasVerifyExternalVertexExistence()
TransactionConfigurationhasVerifyExternalVertexExistence in interface TransactionConfigurationpublic final boolean hasVerifyInternalVertexExistence()
TransactionConfigurationTransactionConfiguration.hasVerifyExternalVertexExistence() this is about internally verifying ids.hasVerifyInternalVertexExistence in interface TransactionConfigurationpublic final boolean hasAcquireLocks()
TransactionConfigurationhasAcquireLocks in interface TransactionConfigurationpublic final DefaultSchemaMaker getAutoSchemaMaker()
getAutoSchemaMaker in interface TransactionConfigurationpublic final boolean hasVerifyUniqueness()
TransactionConfigurationhasVerifyUniqueness in interface TransactionConfigurationpublic boolean hasPropertyPrefetching()
TransactionConfigurationhasPropertyPrefetching in interface TransactionConfigurationpublic final boolean isSingleThreaded()
TransactionConfigurationisSingleThreaded in interface TransactionConfigurationpublic final boolean isThreadBound()
TransactionConfigurationisThreadBound in interface TransactionConfigurationpublic final int getVertexCacheSize()
TransactionConfigurationgetVertexCacheSize in interface TransactionConfigurationpublic final int getDirtyVertexSize()
TransactionConfigurationgetDirtyVertexSize in interface TransactionConfigurationpublic final long getIndexCacheWeight()
TransactionConfigurationgetIndexCacheWeight in interface TransactionConfigurationpublic String getLogIdentifier()
TransactionConfigurationgetLogIdentifier in interface TransactionConfigurationpublic int[] getRestrictedPartitions()
TransactionConfigurationgetRestrictedPartitions in interface TransactionConfigurationpublic boolean hasRestrictedPartitions()
TransactionConfigurationhasRestrictedPartitions in interface TransactionConfigurationpublic String getGroupName()
BaseTransactionConfiggetGroupName in interface BaseTransactionConfigpublic boolean hasGroupName()
BaseTransactionConfigBaseTransactionConfig.getGroupName() is non-null, false when null.hasGroupName in interface BaseTransactionConfigpublic java.time.Instant getCommitTime()
BaseTransactionConfiggetCommitTime in interface BaseTransactionConfigpublic boolean hasCommitTime()
BaseTransactionConfighasCommitTime in interface BaseTransactionConfigpublic <V> V getCustomOption(ConfigOption<V> opt)
BaseTransactionConfiggetCustomOption in interface BaseTransactionConfigopt - option for which to return a valuepublic Configuration getCustomOptions()
BaseTransactionConfiggetCustomOptions in interface BaseTransactionConfigBaseTransactionConfig.getCustomOption(ConfigOption)public TimestampProvider getTimestampProvider()
BaseTransactionConfiggetTimestampProvider in interface BaseTransactionConfigCopyright © 2012–2015. All rights reserved.