com.thinkaurelius.titan.core

## Interface TransactionBuilder

- All Known Implementing Classes:
    StandardTransactionBuilder

      public interface TransactionBuilder

  Constructor returned by `TitanGraph.buildTransaction()` to build a new transaction. The TransactionBuilder allows certain aspects of the resulting transaction to be configured up-front.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TransactionBuilder` | `checkInternalVertexExistence()` Enables checks that verify that each vertex actually exists in the underlying data store when it is retrieved.
    `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 Titan to speed up the ingestion of data under the assumptions that inconsistencies are resolved prior to loading.
    `TransactionBuilder` | `readOnly()` Makes the transaction read only.
    `TransactionBuilder` | `setCommitTime(long timestampSinceEpoch, TimeUnit unit)` Sets the timestamp for this transaction.
    `TransactionBuilder` | `setCustomOption(String k, Object v)` Configures a custom option on this transaction which will be passed through to the storage and indexing backends.
    `TransactionBuilder` | `setDirtyVertexSize(int size)` Configures the initial size of the map of modified vertices held by this transaction.
    `TransactionBuilder` | `setGroupName(String name)` Sets the group name for this transaction which provides a way for gathering reporting on multiple transactions into one group.
    `TransactionBuilder` | `setLogIdentifier(String logName)` Name of the log to be used for logging the mutations in this transaction.
    `TransactionBuilder` | `setRestrictedPartitions(int[] partitions)` Configures this transaction such that queries against partitioned vertices are restricted to the given partitions.
    `TransactionBuilder` | `setVertexCacheSize(int size)` Configures the size of the internal caches used in the transaction.
    `TitanTransaction` | `start()` Starts and returns the transaction build by this builder

- - ### Method Detail

    - #### readOnly

          TransactionBuilder readOnly()

      Makes the transaction read only. Any writes will cause an exception. Read-only transactions do not have to maintain certain data structures and can hence be more efficient.
      Returns:

    - #### enableBatchLoading

          TransactionBuilder 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.
      Returns:

    - #### disableBatchLoading

          TransactionBuilder disableBatchLoading()

      Disables batch loading by ensuring that consistency checks are applied in this transaction. This allows an individual transaction to use consistency checks when the graph as a whole is configured to not use them, which is useful when defining schema elements in a graph with batch-loading enabled.
      Returns:

    - #### setVertexCacheSize

          TransactionBuilder setVertexCacheSize(int size)

      Configures the size of the internal caches used in the transaction.
      Parameters:
        `size` -
      Returns:

    - #### setDirtyVertexSize

          TransactionBuilder setDirtyVertexSize(int size)

      Configures the initial size of the map of modified vertices held by this transaction. This is a performance hint, not a hard upper bound. The map will grow if the transaction ends up modifying more vertices than expected.
      Parameters:
        `size` - initial size of the transaction's dirty vertex collection
      Returns:

    - #### checkInternalVertexExistence

          TransactionBuilder checkInternalVertexExistence()

      Enables checks that verify that each vertex actually exists in the underlying data store when it is retrieved. This might be useful to address common data degradation issues but has adverse impacts on performance due to repeated existence checks.
      Returns:

    - #### setCommitTime

          TransactionBuilder setCommitTime(long timestampSinceEpoch,
                                         TimeUnit unit)

      Sets the timestamp for this transaction. The transaction will be recorded with this timestamp in those storage backends where the timestamp is recorded.
      Parameters:
        `timestampSinceEpoch` - number of units elapsed since the UNIX Epoch, that is, 00:00:00 UTC, Thursday, 1 January 1970
        `unit` - units of the `timestampSinceEpoch argument`
      Returns:

    - #### setGroupName

          TransactionBuilder setGroupName(String name)

      Sets the group name for this transaction which provides a way for gathering reporting on multiple transactions into one group. By setting a group one enables Metrics for this transaction, and defines what string should start the transaction's metric names.

      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 Titan metric names.

      Parameters:
        `name` - Metric name prefix for this transaction
      Returns:

    - #### setLogIdentifier

          TransactionBuilder setLogIdentifier(String logName)

      Name of the log to be used for logging the mutations in this transaction. If no log identifier is set, then this transaction will not be logged.
      Parameters:
        `logName` -
      Returns:

    - #### setRestrictedPartitions

          TransactionBuilder setRestrictedPartitions(int[] partitions)

      Configures this transaction such that queries against partitioned vertices are restricted to the given partitions.
      Parameters:
        `partitions` -
      Returns:

    - #### setCustomOption

          TransactionBuilder setCustomOption(String k,
                                           Object v)

      Configures a custom option on this transaction which will be passed through to the storage and indexing backends.
      Parameters:
        `k` -
        `v` -
      Returns:

    - #### start

          TitanTransaction start()

      Starts and returns the transaction build by this builder
      Returns:
        A new transaction configured according to this builder

Copyright © 2012–2014. All rights reserved.