public final class HeapWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.io.File |
heapFileREADY |
private java.io.File |
heapFileTMP |
private HandleMap |
index |
private int |
keylength |
private static ConcurrentLog |
log |
private java.io.DataOutputStream |
os |
private long |
seek |
static byte[] |
ZERO |
Constructor and Description |
---|
HeapWriter(java.io.File temporaryHeapFile,
java.io.File readyHeapFile,
int keylength,
ByteOrder ordering,
int outBuffer)
create a heap file: a arbitrary number of BLOBs, indexed by an access key
The heap file will be indexed upon initialization.
|
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] key,
byte[] blob)
add a BLOB to the heap: this adds the blob always to the end of the file
newly added heap entries must have keys that have not been added before
|
void |
close(boolean writeIDX)
close the BLOB table
|
static void |
delete(java.io.File f) |
protected static java.io.File |
fingerprintGapFile(java.io.File f,
java.lang.String fingerprint) |
protected static java.io.File |
fingerprintIndexFile(java.io.File f,
java.lang.String fingerprint) |
private static final ConcurrentLog log
public static final byte[] ZERO
private final int keylength
private HandleMap index
private final java.io.File heapFileTMP
private final java.io.File heapFileREADY
private java.io.DataOutputStream os
private long seek
public HeapWriter(java.io.File temporaryHeapFile, java.io.File readyHeapFile, int keylength, ByteOrder ordering, int outBuffer) throws java.io.IOException
temporaryHeapFile
- readyHeapFile
- keylength
- ordering
- java.io.IOException
public void add(byte[] key, byte[] blob) throws java.io.IOException, SpaceExceededException
key
- blob
- java.io.IOException
SpaceExceededException
SpaceExceededException
public void close(boolean writeIDX) throws java.io.IOException
java.io.IOException
public static void delete(java.io.File f)
protected static java.io.File fingerprintIndexFile(java.io.File f, java.lang.String fingerprint)
protected static java.io.File fingerprintGapFile(java.io.File f, java.lang.String fingerprint)