com.thinkaurelius.titan.diskstorage.idmanagement

## Enum ConflictAvoidanceMode

- java.lang.Object
- - java.lang.Enum<ConflictAvoidanceMode>
  - - com.thinkaurelius.titan.diskstorage.idmanagement.ConflictAvoidanceMode

- All Implemented Interfaces:
    Serializable, Comparable<ConflictAvoidanceMode>

      public enum ConflictAvoidanceMode
      extends Enum<ConflictAvoidanceMode>

  Represents ID allocation strategies for avoiding contention between concurrent Titan instances using a shared storage backend. These strategies are implemented in `ConsistentKeyIDAuthority`.

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `GLOBAL_AUTO` Titan randomly selects a tag from the space of all possible tags when performing allocations.
    `GLOBAL_MANUAL` The user assigns a tag to each Titan instance.
    `LOCAL_MANUAL` Expert feature: use with care. The user manually assigns each Titan instance a unique conflict avoidance tag in its local graph configuration.
    `NONE` Disables ID allocation conflict avoidance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ConflictAvoidanceMode` | `valueOf(String name)` Returns the enum constant of this type with the specified name.
    `static ConflictAvoidanceMode[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

    - ### Methods inherited from class java.lang.Enum

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### NONE

          public static final ConflictAvoidanceMode NONE

      Disables ID allocation conflict avoidance. This setting does not compromise correctness. However, in a clustered Titan deployment, this may result in ID allocations frequently failing due to contention and then retrying, slowing overall write throughput.

    - #### LOCAL_MANUAL

          public static final ConflictAvoidanceMode LOCAL_MANUAL

      Expert feature: use with care. The user manually assigns each Titan instance a unique conflict avoidance tag in its local graph configuration. The tag becomes part of globally-visible graph element IDs allocated by that Titan instance. Each Titan instance assumes it has exclusive control over its tag, and it uses datacenter-local-quorum-level consistency (on storage backends that support this concept) when allocating IDs with its tag.

      This is useful for reducing write latency in Titan deployments atop a multi-datacenter distributed store.

      When this mode is set, the user is responsible for setting a unique tag in each Titan graph configuration. Setting the same tag on two different Titan configurations can lead to silent graph corruption in this mode! Each tag must be unique. If you're unsure about this or its implications, then use one of the other modes instead.

    - #### GLOBAL_MANUAL

          public static final ConflictAvoidanceMode GLOBAL_MANUAL

      The user assigns a tag to each Titan instance. The tags should be globally unique for optimal performance, but duplicates will not compromise correctness. The tag becomes part of globally-visible graph element IDs allocated by the instance. If each instance has a unique tag, then ID allocations will never conflict.

      Unlike `LOCAL_MANUAL`, setting the same tag on multiple instances is safe in this mode. Titan uses global-quorum-level or greater on storage backends that have a notion of eventual consistency, so Titan will detect contention and avoid double allocation even when multiple instances share a tag.

    - #### GLOBAL_AUTO

          public static final ConflictAvoidanceMode GLOBAL_AUTO

      Titan randomly selects a tag from the space of all possible tags when performing allocations. Like `GLOBAL_MANUAL`, this uses at least global-quorum-level consistency, so even if two instances happen to select the same ID simultaneously, the conflict will still be detected.

  - ### Method Detail

    - #### values

          public static ConflictAvoidanceMode[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (ConflictAvoidanceMode c : ConflictAvoidanceMode.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static ConflictAvoidanceMode valueOf(String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `IllegalArgumentException` - if this enum type has no constant with the specified name
        `NullPointerException` - if the argument is null

Copyright © 2012–2014. All rights reserved.