Class NodeHash.PagedGrowableHash

java.lang.Object
org.apache.lucene.util.fst.NodeHash.PagedGrowableHash
Enclosing class:
NodeHash<T>

class NodeHash.PagedGrowableHash extends Object
Inner class because it needs access to hash function and FST bytes.
  • Field Details

  • Constructor Details

    • PagedGrowableHash

      public PagedGrowableHash()
    • PagedGrowableHash

      public PagedGrowableHash(long lastNodeAddress, long size)
  • Method Details

    • getBytes

      public byte[] getBytes(long hashSlot, int length)
      Get the copied bytes at the provided hash slot
      Parameters:
      hashSlot - the hash slot to read from
      length - the number of bytes to read
      Returns:
      the copied byte array
    • getNodeAddress

      public long getNodeAddress(long hashSlot)
      Get the node address from the provided hash slot
      Parameters:
      hashSlot - the hash slot to read
      Returns:
      the node address
    • setNodeAddress

      public void setNodeAddress(long hashSlot, long nodeAddress)
      Set the node address from the provided hash slot
      Parameters:
      hashSlot - the hash slot to write to
      nodeAddress - the node address
    • copyNodeBytes

      void copyNodeBytes(long hashSlot, byte[] bytes)
      copy the node bytes from the FST
    • copyFallbackNodeBytes

      void copyFallbackNodeBytes(long hashSlot, NodeHash<T>.PagedGrowableHash fallbackTable, long fallbackHashSlot, int nodeLength)
      promote the node bytes from the fallback table
    • rehash

      private void rehash(long lastNodeAddress) throws IOException
      Throws:
      IOException
    • hash

      private long hash(long nodeAddress, long hashSlot) throws IOException
      Throws:
      IOException
    • nodesEqual

      private int nodesEqual(FSTCompiler.UnCompiledNode<T> node, long address, long hashSlot) throws IOException
      Compares an unfrozen node (UnCompiledNode) with a frozen node at byte location address (long), returning the node length if the two nodes are equals, or -1 otherwise

      The node length will be used to promote the node from the fallback table to the primary table

      Throws:
      IOException
    • getBytesReader

      private FST.BytesReader getBytesReader(long nodeAddress, long hashSlot)