Interface DiffableUtils.ValueSerializer<K,V>

Type Parameters:
K - key type of map
V - value type of map
All Known Implementing Classes:
DiffableUtils.DiffableValueReader, DiffableUtils.DiffableValueSerializer, DiffableUtils.NonDiffableValueSerializer, DiffableUtils.StringSetValueSerializer, NamedDiffableValueSerializer
Enclosing class:
DiffableUtils

public static interface DiffableUtils.ValueSerializer<K,V>
Provides read and write operations to serialize map values. Reading of values can be made dependent on map key.

Also provides operations to distinguish whether map values are diffable.

Should not be directly implemented, instead implement either DiffableUtils.DiffableValueSerializer or DiffableUtils.NonDiffableValueSerializer.

Opensearch.internal:
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    diff(V value, V beforePart)
    Computes diff if this serializer supports diffable values
    read(org.opensearch.core.common.io.stream.StreamInput in, K key)
    Reads value from stream.
    readDiff(org.opensearch.core.common.io.stream.StreamInput in, K key)
    Reads value as diff from stream if this serializer supports diffable values.
    boolean
    Whether this serializer supports diffable values
    default boolean
    supportsVersion(Diff<V> value, org.opensearch.Version version)
    Whether this serializer supports the version of the output stream
    default boolean
    supportsVersion(V value, org.opensearch.Version version)
    Whether this serializer supports the version of the output stream
    void
    write(V value, org.opensearch.core.common.io.stream.StreamOutput out)
    Writes value to stream
    void
    writeDiff(Diff<V> value, org.opensearch.core.common.io.stream.StreamOutput out)
    Writes value as diff to stream if this serializer supports diffable values
  • Method Details Link icon

    • write Link icon

      void write(V value, org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Writes value to stream
      Throws:
      IOException
    • read Link icon

      V read(org.opensearch.core.common.io.stream.StreamInput in, K key) throws IOException
      Reads value from stream. Reading operation can be made dependent on map key.
      Throws:
      IOException
    • supportsDiffableValues Link icon

      boolean supportsDiffableValues()
      Whether this serializer supports diffable values
    • supportsVersion Link icon

      default boolean supportsVersion(Diff<V> value, org.opensearch.Version version)
      Whether this serializer supports the version of the output stream
    • supportsVersion Link icon

      default boolean supportsVersion(V value, org.opensearch.Version version)
      Whether this serializer supports the version of the output stream
    • diff Link icon

      Diff<V> diff(V value, V beforePart)
      Computes diff if this serializer supports diffable values
    • writeDiff Link icon

      void writeDiff(Diff<V> value, org.opensearch.core.common.io.stream.StreamOutput out) throws IOException
      Writes value as diff to stream if this serializer supports diffable values
      Throws:
      IOException
    • readDiff Link icon

      Diff<V> readDiff(org.opensearch.core.common.io.stream.StreamInput in, K key) throws IOException
      Reads value as diff from stream if this serializer supports diffable values. Reading operation can be made dependent on map key.
      Throws:
      IOException