java.lang.Object
org.apache.lucene.util.fst.NodeHash.PagedGrowableHash
Inner class because it needs access to hash function and FST bytes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final ByteBlockPoolReverseBytesReader
private PagedGrowableWriter
private final ByteBlockPool
private long
private PagedGrowableWriter
private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
copyFallbackNodeBytes
(long hashSlot, NodeHash<T>.PagedGrowableHash fallbackTable, long fallbackHashSlot, int nodeLength) promote the node bytes from the fallback table(package private) void
copyNodeBytes
(long hashSlot, byte[] bytes) copy the node bytes from the FSTbyte[]
getBytes
(long hashSlot, int length) Get the copied bytes at the provided hash slotprivate FST.BytesReader
getBytesReader
(long nodeAddress, long hashSlot) long
getNodeAddress
(long hashSlot) Get the node address from the provided hash slotprivate long
hash
(long nodeAddress, long hashSlot) private int
nodesEqual
(FSTCompiler.UnCompiledNode<T> node, long address, long hashSlot) 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 otherwiseprivate void
rehash
(long lastNodeAddress) void
setNodeAddress
(long hashSlot, long nodeAddress) Set the node address from the provided hash slot
-
Field Details
-
fstNodeAddress
-
copiedNodeAddress
-
count
private long count -
mask
private long mask -
copiedNodes
-
bytesReader
-
BLOCK_SIZE_BYTES
private static final int BLOCK_SIZE_BYTES- See Also:
-
-
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 fromlength
- 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 tonodeAddress
- 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
- Throws:
IOException
-
hash
- 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 otherwiseThe node length will be used to promote the node from the fallback table to the primary table
- Throws:
IOException
-
getBytesReader
-