public interface TransactionBuilder
JanusGraph.buildTransaction()
to build a new transaction.
The TransactionBuilder allows certain aspects of the resulting transaction to be configured up-front.Modifier and Type | Method and Description |
---|---|
TransactionBuilder |
checkExternalVertexExistence(boolean enabled)
Enables/disables checking whether the vertex with a user provided id indeed exists.
|
TransactionBuilder |
checkInternalVertexExistence(boolean enabled)
Enables/disables checks that verify that each vertex actually exists in the underlying data store when it is retrieved.
|
TransactionBuilder |
commitTime(Instant instant)
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.
|
TransactionBuilder |
disableBatchLoading()
Disables batch loading by ensuring that consistency checks are applied in this transaction.
|
TransactionBuilder |
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.
|
TransactionBuilder |
groupName(String name)
Sets the group name for this transaction which provides a way for gathering
reporting on multiple transactions into one group.
|
TransactionBuilder |
logIdentifier(String logName)
Name of the log to be used for logging the mutations in this transaction.
|
TransactionBuilder |
multiQuery(boolean enabled)
Enable or disable multi-query, i.e.
|
TransactionBuilder |
propertyPrefetching(boolean enabled)
Enable or disable property pre-fetching, i.e.
|
TransactionBuilder |
readOnly()
Makes the transaction read only.
|
TransactionBuilder |
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.
|
TransactionBuilder |
setHasStepStrategyMode(MultiQueryHasStepStrategyMode hasStepStrategyMode)
Sets `has` step strategy mode.
|
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
|
TransactionBuilder |
vertexCacheSize(int size)
Configures the size of the internal caches used in the transaction.
|
TransactionBuilder readOnly()
TransactionBuilder readOnlyOLAP()
TransactionBuilder enableBatchLoading()
TransactionBuilder disableBatchLoading()
TransactionBuilder propertyPrefetching(boolean enabled)
enabled
- TransactionBuilder multiQuery(boolean enabled)
enabled
- TransactionBuilder vertexCacheSize(int size)
size
- The size of the initial cache for the transactionTransactionBuilder dirtyVertexSize(int size)
size
- The initial size of the transaction's dirty vertex collectionTransactionBuilder checkInternalVertexExistence(boolean enabled)
Note, that these checks apply to vertex retrievals inside the query execution engine and not to vertex ids provided by the user.
enabled
- Enable or disable the internal vertex existence checksTransactionBuilder checkExternalVertexExistence(boolean enabled)
enabled
- Enable or disable the external vertex existence checksTransactionBuilder consistencyChecks(boolean enabled)
enabled
- Enable or disable consistency check and lockingTransactionBuilder commitTime(Instant instant)
instant
- The instant at which the commit took placeTransactionBuilder skipDBCacheRead()
Doesn't have any effect if database level cache was disabled via config `cache.db-cache`.
TransactionBuilder setHasStepStrategyMode(MultiQueryHasStepStrategyMode hasStepStrategyMode)
Doesn't have any effect if multi-query was disabled via config `query.batch.enabled = false`.
TransactionBuilder setPropertiesStrategyMode(MultiQueryPropertiesStrategyMode propertiesStrategyMode)
Doesn't have any effect if multi-query was disabled via config `query.batch.enabled = false`.
TransactionBuilder groupName(String name)
If 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.
name
- Metric name prefix for this transactionTransactionBuilder logIdentifier(String logName)
logName
- name of transaction logTransactionBuilder restrictedPartitions(int[] partitions)
partitions
- Array of the int identifier of the partitions to be queriedTransactionBuilder customOption(String k, Object v)
k
- Name of the configuration element.v
- Object containing the custom options to be applied.JanusGraphTransaction start()
Copyright © 2012–2023. All rights reserved.