|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkrati.store.AbstractDataArray
public abstract class AbstractDataArray
AbstractDataArray
Field Summary | |
---|---|
protected AddressArray |
_addrArray
|
protected SimpleDataArray |
_dataArray
|
protected File |
_homeDir
|
protected String |
_homePath
|
Constructor Summary | |
---|---|
protected |
AbstractDataArray(int length,
int batchSize,
int numSyncBatches,
File homeDirectory,
SegmentFactory segmentFactory,
int segmentFileSizeMB,
double segmentCompactFactor)
Constructs a data array. |
Method Summary | |
---|---|
void |
clear()
Clears this Array. |
protected abstract AddressArray |
createAddressArray(int length,
int batchSize,
int numSyncBatches,
File homeDirectory)
|
byte[] |
get(int index)
Gets data at a specified index. |
int |
get(int index,
byte[] dst)
Gets data at a specified index into a byte array. |
int |
get(int index,
byte[] dst,
int offset)
Gets data at a specified index into a byte array. |
File |
getHomeDir()
|
String |
getHomePath()
|
long |
getHWMark()
Gets the high water mark. |
int |
getLength(int index)
|
long |
getLWMark()
Gets the low water mark. |
String |
getStatus()
|
boolean |
hasData(int index)
|
boolean |
hasIndex(int index)
|
int |
length()
|
void |
persist()
Persist all updates from memory buffer into redo log files in non-blocking mode. |
void |
saveHWMark(long endOfPeriod)
Save the high water mark. |
void |
set(int index,
byte[] data,
int offset,
int length,
long scn)
Sets data at a specified index. |
void |
set(int index,
byte[] data,
long scn)
Sets data at a specified index. |
void |
sync()
Force all updates from memory buffer and redo log files to synchronize with the underlying persistent file in blocking mode. |
int |
transferTo(int index,
WritableByteChannel channel)
Transfers data at a given index to a writable file channel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final SimpleDataArray _dataArray
protected final AddressArray _addrArray
protected final String _homePath
protected final File _homeDir
Constructor Detail |
---|
protected AbstractDataArray(int length, int batchSize, int numSyncBatches, File homeDirectory, SegmentFactory segmentFactory, int segmentFileSizeMB, double segmentCompactFactor) throws Exception
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
Exception
Method Detail |
---|
protected abstract AddressArray createAddressArray(int length, int batchSize, int numSyncBatches, File homeDirectory) throws Exception
Exception
public File getHomeDir()
public String getHomePath()
public String getStatus()
public int length()
length
in interface Array
public boolean hasIndex(int index)
hasIndex
in interface Array
public byte[] get(int index)
DataArray
get
in interface DataArray
index
- data index in DataArray
public int get(int index, byte[] dst)
DataArray
get
in interface DataArray
index
- data index in DataArraydst
- the byte array to write to
public int get(int index, byte[] dst, int offset)
DataArray
get
in interface DataArray
index
- data index in DataArraydst
- the byte array to write tooffset
- the offset of byte array from where data will be written
public int getLength(int index)
getLength
in interface DataArray
public boolean hasData(int index)
hasData
in interface DataArray
true
if data exists at a given index. Otherwise, false
.public void set(int index, byte[] data, long scn) throws Exception
DataArray
set
in interface DataArray
index
- data index in DataArraydata
- data to write to DataArray
Exception
public void set(int index, byte[] data, int offset, int length, long scn) throws Exception
DataArray
set
in interface DataArray
index
- data index in DataArraydata
- data to write to DataArrayoffset
- the offset of the data array to start readlength
- the length of data to read from the data array
Exception
public int transferTo(int index, WritableByteChannel channel)
DataArray
transferTo
in interface DataArray
index
- data index in DataArraychannel
- channel to transfer data to
public void clear()
Array
clear
in interface Array
public long getHWMark()
Persistable
getHWMark
in interface Persistable
public long getLWMark()
Persistable
getLWMark
in interface Persistable
public void saveHWMark(long endOfPeriod) throws Exception
Persistable
saveHWMark
in interface Persistable
Exception
public void persist() throws IOException
Persistable
persist
in interface Persistable
IOException
public void sync() throws IOException
Persistable
sync
in interface Persistable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |