public class DiskHashReader
extends Object
DiskHashWriter
.Modifier and Type | Field and Description |
---|---|
(package private) static int |
headerSize
Size of the header we expect to find
|
private int |
nSlots
Number of hash slots in the subfile
|
private PackedByteBuf |
slotBuf
Used to decode hash slot values
|
private byte[] |
slotBytes
Buffer used to read hash slot bytes
|
private int |
slotSize
Size of each hash slot
|
private SubStoreReader |
subfile
SubStore to read the hash from
|
Constructor and Description |
---|
DiskHashReader(SubStoreReader subfile)
Read in the header of of the hash from the given subfile.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the reader (and its associated subfile).
|
PackedByteBuf |
find(String key)
Locate the entry for the given string key.
|
static final int headerSize
private SubStoreReader subfile
private int nSlots
private int slotSize
private byte[] slotBytes
private PackedByteBuf slotBuf
public DiskHashReader(SubStoreReader subfile) throws IOException
subfile
- Must have been created by DiskHashWriter.outputTo()IOException
public void close()
public PackedByteBuf find(String key) throws IOException
key
- key to look forIOException