Class ReusableEntry<KeyType>

java.lang.Object
org.apache.druid.query.groupby.epinephelinae.ReusableEntry<KeyType>
All Implemented Interfaces:
Grouper.Entry<KeyType>

public class ReusableEntry<KeyType> extends Object implements Grouper.Entry<KeyType>
A Grouper.Entry implementation that is reusable. Grouper.iterator(boolean) allows reuse of Entries, and so this class helps implementations taking advantage of that.
  • Constructor Details

    • ReusableEntry

      public ReusableEntry(@Nullable KeyType key, @Nullable Object[] values)
  • Method Details

    • create

      public static <T> ReusableEntry<T> create(Grouper.KeySerde<T> keySerde, int numValues)
      Create a new instance based on a particular Grouper.KeySerde and a particular Object values size.
    • getKey

      public KeyType getKey()
      Returns the key, which enables modifying the key.
      Specified by:
      getKey in interface Grouper.Entry<KeyType>
    • getValues

      public Object[] getValues()
      Returns the values array, which enables setting individual values.
      Specified by:
      getValues in interface Grouper.Entry<KeyType>
    • setKey

      public void setKey(KeyType key)
      Replaces the key completely.
    • setValues

      public void setValues(Object[] values)
      Replaces the values array completely.
    • toString

      public String toString()
      Overrides:
      toString in class Object