|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkrati.store.StaticDataSet
public class StaticDataSet
A simple implementation of data set with a fixed capacity. The values are stored in the underlying DataArray using the following format:
[count:int][value-length:int][value:bytes][value-length:int][value:bytes]... +-----------value 1------------+-----------value 2-----------+
Constructor Summary | |
---|---|
StaticDataSet(File homeDir,
int capacity,
int entrySize,
int maxEntries,
int segmentFileSizeMB,
SegmentFactory segmentFactory)
Creates a DataSet instance with the settings below: |
|
StaticDataSet(File homeDir,
int capacity,
int entrySize,
int maxEntries,
int segmentFileSizeMB,
SegmentFactory segmentFactory,
double segmentCompactFactor,
HashFunction<byte[]> hashFunction)
Creates a DataSet instance. |
|
StaticDataSet(File homeDir,
int capacity,
int entrySize,
int maxEntries,
int segmentFileSizeMB,
SegmentFactory segmentFactory,
HashFunction<byte[]> hashFunction)
Creates a DataSet instance with the settings below: |
|
StaticDataSet(File homeDir,
int capacity,
int segmentFileSizeMB,
SegmentFactory segmentFactory)
Creates a DataSet instance with the settings below: |
|
StaticDataSet(File homeDir,
int capacity,
SegmentFactory segmentFactory)
Creates a DataSet instance with the settings below: |
Method Summary | |
---|---|
boolean |
add(byte[] value)
|
void |
clear()
|
int |
countCollisions(byte[] value)
|
protected AddressArray |
createAddressArray(int length,
int entrySize,
int maxEntries,
File homeDirectory)
|
boolean |
delete(byte[] value)
|
DataArray |
getDataArray()
|
boolean |
has(byte[] value)
|
protected long |
hash(byte[] value)
|
boolean |
hasWithoutCollisions(byte[] value)
|
protected long |
nextScn()
|
void |
persist()
|
void |
sync()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StaticDataSet(File homeDir, int capacity, SegmentFactory segmentFactory) throws Exception
Entry Size : 10000 Max Entries : 5 Segment File Size : 256MB Segment Compact Factor : 0.5 Hash Function : krati.util.FnvHashFunction
homeDir
- the home directorycapacity
- the capacity of data setsegmentFactory
- the segment factory
Exception
public StaticDataSet(File homeDir, int capacity, int segmentFileSizeMB, SegmentFactory segmentFactory) throws Exception
Entry Size : 10000 Max Entries : 5 Segment Compact Factor : 0.5 Hash Function : krati.util.FnvHashFunction
homeDir
- the home directorycapacity
- the capacity of data setsegmentFileSizeMB
- the size of segment file in MBsegmentFactory
- the segment factory
Exception
public StaticDataSet(File homeDir, int capacity, int entrySize, int maxEntries, int segmentFileSizeMB, SegmentFactory segmentFactory) throws Exception
Segment Compact Factor : 0.5 Hash Function : krati.util.FnvHashFunction
homeDir
- the home directorycapacity
- the capacity of data setentrySize
- the redo entry size (i.e., batch size)maxEntries
- the number of redo entries required for updating the underlying address arraysegmentFileSizeMB
- the size of segment file in MBsegmentFactory
- the segment factory
Exception
public StaticDataSet(File homeDir, int capacity, int entrySize, int maxEntries, int segmentFileSizeMB, SegmentFactory segmentFactory, HashFunction<byte[]> hashFunction) throws Exception
Segment Compact Factor : 0.5
homeDir
- the home directorycapacity
- the capacity of data setentrySize
- the redo entry size (i.e., batch size)maxEntries
- the number of redo entries required for updating the underlying address arraysegmentFileSizeMB
- the size of segment file in MBsegmentFactory
- the segment factoryhashFunction
- the hash function for mapping values to indexes
Exception
public StaticDataSet(File homeDir, int capacity, int entrySize, int maxEntries, int segmentFileSizeMB, SegmentFactory segmentFactory, double segmentCompactFactor, HashFunction<byte[]> hashFunction) throws Exception
homeDir
- the home directorycapacity
- the capacity of data setentrySize
- the redo entry size (i.e., batch size)maxEntries
- the number of redo entries required for updating the underlying address arraysegmentFileSizeMB
- the size of segment file in MBsegmentFactory
- the segment factorysegmentCompactFactor
- the load factor of segment, below which a segment is eligible for compactionhashFunction
- the hash function for mapping values to indexes
Exception
Method Detail |
---|
protected AddressArray createAddressArray(int length, int entrySize, int maxEntries, File homeDirectory) throws Exception
Exception
protected long hash(byte[] value)
protected long nextScn()
public void sync() throws IOException
sync
in interface DataSet<byte[]>
IOException
public void persist() throws IOException
persist
in interface DataSet<byte[]>
IOException
public boolean has(byte[] value)
has
in interface DataSet<byte[]>
public final int countCollisions(byte[] value)
public final boolean hasWithoutCollisions(byte[] value)
public boolean add(byte[] value) throws Exception
add
in interface DataSet<byte[]>
Exception
public boolean delete(byte[] value) throws Exception
delete
in interface DataSet<byte[]>
Exception
public void clear() throws IOException
clear
in interface DataSet<byte[]>
IOException
public final DataArray getDataArray()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |