|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectDiskHashReader
public class DiskHashReader
Provides quick access to a disk-based hash table created by
a DiskHashWriter.
| Field Summary | |
|---|---|
(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 Summary | |
|---|---|
DiskHashReader(SubStoreReader subfile)
Read in the header of of the hash from the given subfile. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the reader (and its associated subfile). |
PackedByteBuf |
find(String key)
Locate the entry for the given string key. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int headerSize
private SubStoreReader subfile
private int nSlots
private int slotSize
private byte[] slotBytes
private PackedByteBuf slotBuf
| Constructor Detail |
|---|
public DiskHashReader(SubStoreReader subfile)
throws IOException
subfile - Must have been created by DiskHashWriter.outputTo()
IOException| Method Detail |
|---|
public void close()
public PackedByteBuf find(String key)
throws IOException
key - key to look for
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||