krati.store
Class BytesDB
java.lang.Object
krati.store.BytesDB
public final class BytesDB
- extends Object
BytesDB.
- Author:
- jwu
Constructor Summary |
BytesDB(File homeDir,
int initLevel,
int batchSize,
int numSyncBatches,
int segmentFileSizeMB,
SegmentFactory segmentFactory)
|
BytesDB(File homeDir,
int initLevel,
int batchSize,
int numSyncBatches,
int segmentFileSizeMB,
SegmentFactory segmentFactory,
double segmentCompactFactor)
|
Method Summary |
int |
add(byte[] data,
int offset,
int length,
long scn)
|
int |
add(byte[] data,
long scn)
|
void |
clear()
|
void |
close()
|
protected DynamicLongArray |
createAddressArray(int batchSize,
int numSyncBatches,
File homeDirectory)
|
byte[] |
get(int index)
|
int |
get(int index,
byte[] data)
|
int |
get(int index,
byte[] data,
int offset)
|
int |
getLength(int index)
|
boolean |
hasData(int index)
|
boolean |
hasIndex(int index)
|
void |
persist()
|
void |
set(int index,
byte[] data,
int offset,
int length,
long scn)
|
void |
set(int index,
byte[] data,
long scn)
|
void |
sync()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BytesDB
public BytesDB(File homeDir,
int initLevel,
int batchSize,
int numSyncBatches,
int segmentFileSizeMB,
SegmentFactory segmentFactory)
throws Exception
- Throws:
Exception
BytesDB
public BytesDB(File homeDir,
int initLevel,
int batchSize,
int numSyncBatches,
int segmentFileSizeMB,
SegmentFactory segmentFactory,
double segmentCompactFactor)
throws Exception
- Throws:
Exception
createAddressArray
protected DynamicLongArray createAddressArray(int batchSize,
int numSyncBatches,
File homeDirectory)
throws Exception
- Throws:
Exception
hasData
public boolean hasData(int index)
hasIndex
public boolean hasIndex(int index)
getLength
public int getLength(int index)
get
public byte[] get(int index)
get
public int get(int index,
byte[] data)
get
public int get(int index,
byte[] data,
int offset)
set
public void set(int index,
byte[] data,
long scn)
throws Exception
- Throws:
Exception
set
public void set(int index,
byte[] data,
int offset,
int length,
long scn)
throws Exception
- Throws:
Exception
add
public int add(byte[] data,
long scn)
throws Exception
- Throws:
Exception
add
public int add(byte[] data,
int offset,
int length,
long scn)
throws Exception
- Throws:
Exception
clear
public void clear()
close
public void close()
throws IOException
- Throws:
IOException
sync
public void sync()
throws IOException
- Throws:
IOException
persist
public void persist()
throws IOException
- Throws:
IOException
Copyright © 2011. All Rights Reserved.