Class ItemSlot

java.lang.Object
com.apple.foundationdb.async.rtree.ItemSlot
All Implemented Interfaces:
NodeSlot

public class ItemSlot extends Object implements NodeSlot
An item slot that is used by LeafNodes. Holds the actual data of the item as well as the items Hilbert value and its key.
  • Field Details

  • Constructor Details

  • Method Details

    • getHilbertValue

      @Nonnull public BigInteger getHilbertValue()
    • getKey

      @Nonnull public Tuple getKey()
    • getKeySuffix

      @Nonnull public Tuple getKeySuffix()
    • getValue

      @Nonnull public Tuple getValue()
    • getPosition

      @Nonnull public RTree.Point getPosition()
    • getSmallestHilbertValue

      @Nonnull public BigInteger getSmallestHilbertValue()
      Specified by:
      getSmallestHilbertValue in interface NodeSlot
    • getLargestHilbertValue

      @Nonnull public BigInteger getLargestHilbertValue()
      Specified by:
      getLargestHilbertValue in interface NodeSlot
    • getSmallestKey

      @Nonnull public Tuple getSmallestKey()
      Specified by:
      getSmallestKey in interface NodeSlot
    • getLargestKey

      @Nonnull public Tuple getLargestKey()
      Specified by:
      getLargestKey in interface NodeSlot
    • getSlotKey

      @Nonnull public Tuple getSlotKey(boolean storeHilbertValues)
      Description copied from interface: NodeSlot
      Create a tuple for the key part of this slot. This tuple is used when the slot is persisted in the database. Note that the serialization format is not yet finalized.
      Specified by:
      getSlotKey in interface NodeSlot
      Parameters:
      storeHilbertValues - indicator if the hilbert value should be encoded into the slot key or null-ed out
      Returns:
      a new tuple
    • getSlotValue

      @Nonnull public Tuple getSlotValue()
      Description copied from interface: NodeSlot
      Create a tuple for the value part of this slot. This tuple is used when the slot is persisted in the database. Note that the serialization format is not yet finalized.
      Specified by:
      getSlotValue in interface NodeSlot
      Returns:
      a new tuple
    • compareHilbertValueAndKey

      public int compareHilbertValueAndKey(@Nonnull BigInteger hilbertValue, @Nonnull Tuple key)
      Compare this node slot's (hilbertValue, key) pair with another (hilbertValue, key) pair. We do not use a proper Comparator as we don't want to wrap the pair in another object.
      Parameters:
      hilbertValue - Hilbert value
      key - first key
      Returns:
      -1, 0, 1 if this node slot's pair is less/equal/greater than the pair passed in
    • toString

      public String toString()
      Overrides:
      toString in class Object