Class IsmFormat.IsmRecord<V>

  • Enclosing class:
    IsmFormat

    public abstract static class IsmFormat.IsmRecord<V>
    extends java.lang.Object
    A record containing a composite key and either a value or metadata. The composite key must not contain the metadata key component place holder if producing a value record, and must contain the metadata component key place holder if producing a metadata record.

    The composite key is a fixed number of component keys where the first N component keys are used to create a shard id via hashing. See IsmFormat.IsmRecordCoder.hash(List) for further details.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getKeyComponent​(int index)
      Returns the key component at the specified index.
      java.util.List<?> getKeyComponents()
      Returns the list of key components.
      byte[] getMetadata()
      Returns the metadata.
      V getValue()
      Returns the value.
      static <V> IsmFormat.IsmRecord<V> meta​(java.util.List<?> keyComponents, byte[] metadata)  
      static <V> IsmFormat.IsmRecord<V> of​(java.util.List<?> keyComponents, V value)
      Returns an IsmRecord with the specified key components and value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • of

        public static <V> IsmFormat.IsmRecord<V> of​(java.util.List<?> keyComponents,
                                                    V value)
        Returns an IsmRecord with the specified key components and value.
      • meta

        public static <V> IsmFormat.IsmRecord<V> meta​(java.util.List<?> keyComponents,
                                                      byte[] metadata)
      • getKeyComponents

        public java.util.List<?> getKeyComponents()
        Returns the list of key components.
      • getKeyComponent

        public java.lang.Object getKeyComponent​(int index)
        Returns the key component at the specified index.
      • getValue

        public V getValue()
        Returns the value. Throws IllegalStateException if this is not a value record.
      • getMetadata

        public byte[] getMetadata()
        Returns the metadata. Throws IllegalStateException if this is not a metadata record.