krati.store
Class StaticDataArray
java.lang.Object
krati.store.AbstractDataArray
krati.store.StaticDataArray
- All Implemented Interfaces:
- Array, DataArray, Persistable
public final class StaticDataArray
- extends AbstractDataArray
StaticDataArray - a convenient class for creating a fixed-size data array.
- Author:
- jwu
Sep 24, 2010
Constructor Summary |
StaticDataArray(int length,
File homeDirectory,
SegmentFactory segmentFactory)
Constructs a static data array with the following default params. |
StaticDataArray(int length,
File homeDirectory,
SegmentFactory segmentFactory,
int segmentFileSizeMB)
Constructs a static data array with the following default params. |
StaticDataArray(int length,
int batchSize,
int numSyncBatches,
File homeDirectory,
SegmentFactory segmentFactory,
int segmentFileSizeMB,
double segmentCompactFactor)
Constructs a static data array. |
Methods inherited from class krati.store.AbstractDataArray |
clear, get, get, get, getHomeDir, getHomePath, getHWMark, getLength, getLWMark, getStatus, hasData, hasIndex, length, persist, saveHWMark, set, set, sync, transferTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StaticDataArray
public StaticDataArray(int length,
File homeDirectory,
SegmentFactory segmentFactory)
throws Exception
- Constructs a static data array with the following default params.
batchSize : 10000
numSyncBatches : 5
segmentCompactFactor : 0.5
segmentFileSizeMB : 256
- Parameters:
length
- - the array lengthhomeDirectory
- - the home directory of data arraysegmentFactory
- - the segment factory
- Throws:
Exception
StaticDataArray
public StaticDataArray(int length,
File homeDirectory,
SegmentFactory segmentFactory,
int segmentFileSizeMB)
throws Exception
- Constructs a static data array with the following default params.
batchSize : 10000
numSyncBatches : 5
segmentCompactFactor : 0.5
- Parameters:
length
- - the array lengthhomeDirectory
- - the home directory of data arraysegmentFactory
- - the segment factorysegmentFileSizeMB
- - the segment size in MB
- Throws:
Exception
StaticDataArray
public StaticDataArray(int length,
int batchSize,
int numSyncBatches,
File homeDirectory,
SegmentFactory segmentFactory,
int segmentFileSizeMB,
double segmentCompactFactor)
throws Exception
- Constructs a static data array.
- Parameters:
length
- - the array lengthbatchSize
- - the number of updates per update batch, i.e. the redo entry sizenumSyncBatches
- - the number of update batches required for updating the underlying address arrayhomeDirectory
- - the home directory of data arraysegmentFactory
- - the segment factorysegmentFileSizeMB
- - the segment size in MBsegmentCompactFactor
- - the segment load threshold, below which a segment is eligible for compaction
- Throws:
Exception
createAddressArray
protected AddressArray createAddressArray(int length,
int batchSize,
int numSyncBatches,
File homeDirectory)
throws Exception
- Specified by:
createAddressArray
in class AbstractDataArray
- Throws:
Exception
Copyright © 2011. All Rights Reserved.