public class StandardTransactionBuilder extends Object implements TransactionConfiguration, TransactionBuilder
JanusGraphTransaction.JanusGraphTransaction| Constructor and Description |
|---|
StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig,
StandardJanusGraph graph)
Constructs a new JanusGraphTransaction configuration with default configuration parameters.
|
StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig,
StandardJanusGraph 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(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 JanusGraph to speed up the ingestion of
data under the assumptions that inconsistencies are resolved prior to loading.
|
DefaultSchemaMaker |
getAutoSchemaMaker() |
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.
|
MultiQueryHasStepStrategyMode |
getHasStepStrategyMode() |
long |
getIndexCacheWeight()
The maximum weight for the index cache store used in this particular transaction
|
MultiQueryLabelStepStrategyMode |
getLabelStepStrategyMode() |
String |
getLogIdentifier()
The name of the log to be used for logging the mutations in this transaction.
|
MultiQueryPropertiesStrategyMode |
getPropertiesStrategyMode() |
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 |
hasDisabledSchemaConstraints()
Allows to disable schema constraints.
|
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 if the queried 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 |
isLazyLoadRelations()
Returns true if all properties and edges are lazy-loaded: ids and values are deserialized upon demand.
|
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 |
isSkipDBCacheRead()
Returns true if read queries should skip accessing JanusGraph database level cache (db-cache).
|
boolean |
isThreadBound()
Whether this transaction is bound to a running thread.
|
TransactionBuilder |
lazyLoadRelations()
Set lazy-load for all properties and edges: ids and values are deserialized upon demand.
|
StandardTransactionBuilder |
logIdentifier(String logName)
Name of the log to be used for logging the mutations in this transaction.
|
StandardTransactionBuilder |
multiQuery(boolean enabled)
Enable or disable multi-query, i.e.
|
StandardTransactionBuilder |
propertyPrefetching(boolean enabled)
Enable or disable property pre-fetching, i.e.
|
StandardTransactionBuilder |
readOnly()
Makes the transaction read only.
|
StandardTransactionBuilder |
readOnlyOLAP()
A shortcut for a number of configs that are commonly used by read-only OLAP jobs.
|
TransactionBuilder |
restrictedPartitions(int[] partitions)
Configures this transaction such that queries against partitioned vertices are
restricted to the given partitions.
|
void |
setCommitTime(Instant time)
Sets the commit time of this transaction.
|
TransactionBuilder |
setHasStepStrategyMode(MultiQueryHasStepStrategyMode hasStepStrategyMode)
Sets `has` step strategy mode.
|
TransactionBuilder |
setLabelsStepStrategyMode(MultiQueryLabelStepStrategyMode labelStepStrategyMode)
Sets `label` step strategy mode.
|
TransactionBuilder |
setPreloadedData(boolean preloaded) |
TransactionBuilder |
setPropertiesStrategyMode(MultiQueryPropertiesStrategyMode propertiesStrategyMode)
Sets properties strategy mode.
|
TransactionBuilder |
skipDBCacheRead()
Skips usage of JanusGraph database level cache during read operations.
|
JanusGraphTransaction |
start()
Starts and returns the transaction build by this builder
|
StandardTransactionBuilder |
threadBound() |
boolean |
useMultiQuery()
Whether this transaction should batch backend queries.
|
StandardTransactionBuilder |
vertexCacheSize(int size)
Configures the size of the internal caches used in the transaction.
|
public StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig, StandardJanusGraph graph)
public StandardTransactionBuilder(GraphDatabaseConfiguration graphConfig, StandardJanusGraph graph, Configuration customOptions)
public StandardTransactionBuilder threadBound()
public StandardTransactionBuilder readOnly()
TransactionBuilderreadOnly in interface TransactionBuilderpublic StandardTransactionBuilder readOnlyOLAP()
TransactionBuilderreadOnlyOLAP in interface TransactionBuilderpublic StandardTransactionBuilder enableBatchLoading()
TransactionBuilderenableBatchLoading in interface TransactionBuilderpublic StandardTransactionBuilder disableBatchLoading()
TransactionBuilderdisableBatchLoading in interface TransactionBuilderpublic StandardTransactionBuilder propertyPrefetching(boolean enabled)
TransactionBuilderpropertyPrefetching in interface TransactionBuilderpublic StandardTransactionBuilder multiQuery(boolean enabled)
TransactionBuildermultiQuery in interface TransactionBuilderpublic StandardTransactionBuilder vertexCacheSize(int size)
TransactionBuildervertexCacheSize in interface TransactionBuildersize - The size of the initial cache for the transactionpublic TransactionBuilder dirtyVertexSize(int size)
TransactionBuilderdirtyVertexSize in interface TransactionBuildersize - The initial size of the transaction's dirty vertex collectionpublic StandardTransactionBuilder checkInternalVertexExistence(boolean enabled)
TransactionBuilderNote, that these checks apply to vertex retrievals inside the query execution engine and not to vertex ids provided by the user.
checkInternalVertexExistence in interface TransactionBuilderenabled - Enable or disable the internal vertex existence checkspublic StandardTransactionBuilder checkExternalVertexExistence(boolean enabled)
TransactionBuildercheckExternalVertexExistence in interface TransactionBuilderenabled - Enable or disable the external vertex existence checkspublic TransactionBuilder consistencyChecks(boolean enabled)
TransactionBuilderconsistencyChecks in interface TransactionBuilderenabled - Enable or disable consistency check and lockingpublic StandardTransactionBuilder commitTime(Instant timestampSinceEpoch)
TransactionBuildercommitTime in interface TransactionBuildertimestampSinceEpoch - The instant at which the commit took placepublic TransactionBuilder skipDBCacheRead()
TransactionBuilderDoesn't have any effect if database level cache was disabled via config `cache.db-cache`.
skipDBCacheRead in interface TransactionBuilderpublic TransactionBuilder lazyLoadRelations()
TransactionBuilderWhen enabled, it can have a boost on large scale read operations, when only certain type of relations are being read.
lazyLoadRelations in interface TransactionBuilderpublic TransactionBuilder setHasStepStrategyMode(MultiQueryHasStepStrategyMode hasStepStrategyMode)
TransactionBuilderDoesn't have any effect if multi-query was disabled via config `query.batch.enabled = false`.
setHasStepStrategyMode in interface TransactionBuilderpublic TransactionBuilder setPropertiesStrategyMode(MultiQueryPropertiesStrategyMode propertiesStrategyMode)
TransactionBuilderDoesn't have any effect if multi-query was disabled via config `query.batch.enabled = false`.
setPropertiesStrategyMode in interface TransactionBuilderpublic TransactionBuilder setLabelsStepStrategyMode(MultiQueryLabelStepStrategyMode labelStepStrategyMode)
TransactionBuilderDoesn't have any effect if multi-query was disabled via config `query.batch.enabled = false`.
setLabelsStepStrategyMode in interface TransactionBuilderpublic void setCommitTime(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 JanusGraph metric names.
groupName in interface TransactionBuilderp - Metric name prefix for this transactionpublic StandardTransactionBuilder logIdentifier(String logName)
TransactionBuilderlogIdentifier in interface TransactionBuilderlogName - name of transaction logpublic TransactionBuilder restrictedPartitions(int[] partitions)
TransactionBuilderrestrictedPartitions in interface TransactionBuilderpartitions - Array of the int identifier of the partitions to be queriedpublic TransactionBuilder setPreloadedData(boolean preloaded)
public TransactionBuilder customOption(String k, Object v)
TransactionBuildercustomOption in interface TransactionBuilderk - Name of the configuration element.v - Object containing the custom options to be applied.public JanusGraphTransaction 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()
TransactionConfigurationHence, this is a defensive setting against data degradation, where edges and/or index entries might point to no longer existing vertices. Use this setting with caution as it introduces additional overhead entailed by checking the existence.
Unlike TransactionConfiguration.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 boolean hasDisabledSchemaConstraints()
TransactionConfigurationhasDisabledSchemaConstraints in interface TransactionConfigurationpublic final boolean hasVerifyUniqueness()
TransactionConfigurationhasVerifyUniqueness in interface TransactionConfigurationpublic boolean hasPropertyPrefetching()
TransactionConfigurationhasPropertyPrefetching in interface TransactionConfigurationpublic boolean useMultiQuery()
TransactionConfigurationuseMultiQuery 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 boolean isSkipDBCacheRead()
TransactionConfigurationisSkipDBCacheRead in interface TransactionConfigurationpublic boolean isLazyLoadRelations()
TransactionConfigurationisLazyLoadRelations in interface TransactionConfigurationpublic MultiQueryHasStepStrategyMode getHasStepStrategyMode()
getHasStepStrategyMode in interface TransactionConfigurationpublic MultiQueryPropertiesStrategyMode getPropertiesStrategyMode()
getPropertiesStrategyMode in interface TransactionConfigurationpublic MultiQueryLabelStepStrategyMode getLabelStepStrategyMode()
getLabelStepStrategyMode in interface TransactionConfigurationpublic String getGroupName()
BaseTransactionConfiggetGroupName in interface BaseTransactionConfigpublic boolean hasGroupName()
BaseTransactionConfigBaseTransactionConfig.getGroupName() is non-null, false when null.hasGroupName in interface BaseTransactionConfigpublic 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–2024. All rights reserved.