Class ReindexMetadata

java.lang.Object
org.elasticsearch.script.Metadata
org.elasticsearch.script.ReindexMetadata

public class ReindexMetadata extends Metadata
Metadata for the ReindexScript context. _index, _id, _version, _routing are all read-write. _id, _version and _routing are also nullable. _now is millis since epoch and read-only op is read-write one of 'index', 'noop', 'delete' If _version is set to null in the ctx map, that is interpreted as using internal versioning. The setVersionToInternal(Metadata) and isVersionInternal(Metadata) augmentations are provided for users of this class. These augmentations allow the class to appear as Metadata but handle the internal versioning scheme without scripts accessing the ctx map.
  • Field Details

    • index

      protected final String index
    • id

      protected final String id
    • version

      protected final Long version
    • routing

      protected final String routing
  • Constructor Details

  • Method Details

    • metadataMap

      protected static Map<String,Object> metadataMap(String index, String id, Long version, String routing, String op, long timestamp)
      Create the backing metadata map with the standard contents assuming default validators.
    • getVersion

      public long getVersion()
      Get version, if it's null, return sentinel value Long.MIN_VALUE
      Overrides:
      getVersion in class Metadata
    • isVersionInternal

      public boolean isVersionInternal()
    • isVersionInternal

      public static boolean isVersionInternal(Metadata receiver)
      Augmentation to allow ReindexScripts to check if the version is set to "internal"
    • setVersionToInternal

      public static void setVersionToInternal(Metadata receiver)
      Augmentation to allow ReindexScripts to set the version to "internal". This is necessary because Metadata.setVersion(long) takes a primitive long.
    • versionChanged

      public boolean versionChanged()
    • indexChanged

      public boolean indexChanged()
    • idChanged

      public boolean idChanged()
    • routingChanged

      public boolean routingChanged()