- java.lang.Object
-
- org.apache.lucene.util.fst.NodeHash.PagedGrowableHash
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BLOCK_SIZE_BYTES
private ByteBlockPoolReverseBytesReader
bytesReader
private PagedGrowableWriter
copiedNodeAddress
private ByteBlockPool
copiedNodes
private long
count
private PagedGrowableWriter
fstNodeAddress
private long
mask
-
Constructor Summary
Constructors Constructor Description PagedGrowableHash()
PagedGrowableHash(long lastNodeAddress, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
copyFallbackNodeBytes(long hashSlot, NodeHash.PagedGrowableHash fallbackTable, long fallbackHashSlot, int nodeLength)
promote the node bytes from the fallback table(package private) void
copyNodeBytes(long hashSlot, byte[] bytes, int length)
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 Detail
-
fstNodeAddress
private PagedGrowableWriter fstNodeAddress
-
copiedNodeAddress
private PagedGrowableWriter copiedNodeAddress
-
count
private long count
-
mask
private long mask
-
copiedNodes
private final ByteBlockPool copiedNodes
-
bytesReader
private final ByteBlockPoolReverseBytesReader bytesReader
-
BLOCK_SIZE_BYTES
private static final int BLOCK_SIZE_BYTES
- See Also:
- Constant Field Values
-
-
Method Detail
-
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, int length)
copy the node bytes from the FST
-
copyFallbackNodeBytes
void copyFallbackNodeBytes(long hashSlot, NodeHash.PagedGrowableHash fallbackTable, long fallbackHashSlot, int nodeLength)
promote the node bytes from the fallback table
-
rehash
private void rehash(long lastNodeAddress) throws java.io.IOException
- Throws:
java.io.IOException
-
hash
private long hash(long nodeAddress, long hashSlot) throws java.io.IOException
- Throws:
java.io.IOException
-
nodesEqual
private int nodesEqual(FSTCompiler.UnCompiledNode<T> node, long address, long hashSlot) throws java.io.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:
java.io.IOException
-
getBytesReader
private FST.BytesReader getBytesReader(long nodeAddress, long hashSlot)
-
-