Enum Class VersionType

<VersionType>
org.elasticsearch.index.VersionType
All Implemented Interfaces:
, <, Writeable

public enum VersionType extends <VersionType> implements Writeable
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.

    < extends <>>

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
     
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract
    explainConflictForReads​(long currentVersion, long expectedVersion)
    Returns a human readable explanation for a version conflict on read.
    abstract
    explainConflictForWrites​(long currentVersion, long expectedVersion, boolean deleted)
    Returns a human readable explanation for a version conflict on write.
     versionType)
     
     versionType, VersionType defaultVersionType)
     
    fromValue​(byte value)
     
    byte
     
    abstract boolean
    isVersionConflictForReads​(long currentVersion, long expectedVersion)
    Checks whether the current version conflicts with the expected version, based on the current version type.
    abstract boolean
    isVersionConflictForWrites​(long currentVersion, long expectedVersion, boolean deleted)
    Checks whether the current version conflicts with the expected version, based on the current version type.
     
    static
    toString​(VersionType versionType)
     
    abstract long
    updateVersion​(long currentVersion, long expectedVersion)
    Returns the new version for a document, based on its current one and the specified in the request
    abstract boolean
    validateVersionForReads​(long version)
    validate the version is a valid value for this type when reading.
    abstract boolean
    validateVersionForWrites​(long version)
    validate the version is a valid value for this type when writing.
     name)
    Returns the enum constant of this class with the specified name.
    static VersionType[]
    Returns an array containing the constants of this enum class, in the order they are declared.
    void
    Write this into the StreamOutput.

    Methods inherited from class java.lang.

    , , , , , , , , , ,

    Methods inherited from class java.lang.

    , , , , ,
  • Enum Constant Details

    • INTERNAL

      public static final VersionType INTERNAL
    • EXTERNAL

      public static final VersionType EXTERNAL
    • EXTERNAL_GTE

      public static final VersionType EXTERNAL_GTE
  • Method Details

    • values

      public static VersionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static  name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      - if this enum class has no constant with the specified name
      - if the argument is null
    • getValue

      public byte getValue()
    • isVersionConflictForWrites

      public abstract boolean isVersionConflictForWrites(long currentVersion, long expectedVersion, boolean deleted)
      Checks whether the current version conflicts with the expected version, based on the current version type.
      Parameters:
      currentVersion - the current version for the document
      expectedVersion - the version specified for the write operation
      deleted - true if the document is currently deleted (note that #currentVersion will typically be Versions.NOT_FOUND, but may be something else if the document was recently deleted
      Returns:
      true if versions conflict false o.w.
    • explainConflictForWrites

      public abstract  explainConflictForWrites(long currentVersion, long expectedVersion, boolean deleted)
      Returns a human readable explanation for a version conflict on write. Note that this method is only called if isVersionConflictForWrites(long, long, boolean) returns true;
      Parameters:
      currentVersion - the current version for the document
      expectedVersion - the version specified for the write operation
      deleted - true if the document is currently deleted (note that #currentVersion will typically be Versions.NOT_FOUND, but may be something else if the document was recently deleted
    • isVersionConflictForReads

      public abstract boolean isVersionConflictForReads(long currentVersion, long expectedVersion)
      Checks whether the current version conflicts with the expected version, based on the current version type.
      Parameters:
      currentVersion - the current version for the document
      expectedVersion - the version specified for the read operation
      Returns:
      true if versions conflict false o.w.
    • explainConflictForReads

      public abstract  explainConflictForReads(long currentVersion, long expectedVersion)
      Returns a human readable explanation for a version conflict on read. Note that this method is only called if isVersionConflictForReads(long, long) returns true;
      Parameters:
      currentVersion - the current version for the document
      expectedVersion - the version specified for the read operation
    • updateVersion

      public abstract long updateVersion(long currentVersion, long expectedVersion)
      Returns the new version for a document, based on its current one and the specified in the request
      Returns:
      new version
    • validateVersionForWrites

      public abstract boolean validateVersionForWrites(long version)
      validate the version is a valid value for this type when writing.
      Returns:
      true if valid, false o.w
    • validateVersionForReads

      public abstract boolean validateVersionForReads(long version)
      validate the version is a valid value for this type when reading.
      Returns:
      true if valid, false o.w
    • fromString

      public static  versionType)
    • fromString

      public static  versionType, VersionType defaultVersionType)
    • toString

      public static  toString(VersionType versionType)
    • fromValue

      public static VersionType fromValue(byte value)
    • readFromStream

      public static VersionType readFromStream(StreamInput in) throws
      Throws:
    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws: