|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkrati.core.array.basic.DynamicLongArray
public class DynamicLongArray
DynamicLongArray
Field Summary | |
---|---|
protected ArrayFile |
_arrayFile
|
protected File |
_directory
|
protected EntryFactory<V> |
_entryFactory
|
protected ArrayEntryManager<V> |
_entryManager
|
protected int |
_length
|
Constructor Summary | |
---|---|
DynamicLongArray(int entrySize,
int maxEntries,
File directory)
|
Method Summary | |
---|---|
void |
arrayExpanded(DynamicArray dynArray)
|
void |
clear()
Clears this Array. |
void |
expandCapacity(int index)
Expands the capacity of array to accommodate a given index. |
long |
get(int index)
Gets data at a specified index. |
File |
getDirectory()
|
EntryFactory<V> |
getEntryFactory()
|
ArrayEntryManager<V> |
getEntryManager()
|
long |
getHWMark()
Gets the high water mark. |
long[] |
getInternalArray()
Gets the internal primitive array. |
long |
getLWMark()
Gets the low water mark. |
EntryPersistListener |
getPersistListener()
Gets the listener that is called whenever an entry is persisted. |
boolean |
hasIndex(int index)
|
protected void |
init()
Loads data from the array file. |
protected void |
initArrayFile()
|
int |
length()
|
protected void |
loadArrayFileData()
|
protected ArrayFile |
openArrayFile(File file,
int initialLength,
int elementSize)
|
void |
persist()
Persists this array. |
void |
saveHWMark(long endOfPeriod)
Sync-up the high water mark to a given value. |
void |
set(int index,
long value,
long scn)
Sets data at a specified index. |
void |
setCompactionAddress(int index,
long address,
long scn)
Sets the compaction address (produced by a compactor) at a specified index. |
void |
setPersistListener(EntryPersistListener persistListener)
Sets the listener that is called whenever an entry is persisted. |
int |
subArrayLength()
|
void |
sync()
Sync array file with all entry logs. |
void |
updateArrayFile(List<Entry<V>> entryList)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface krati.array.Array |
---|
hasIndex, length |
Methods inherited from interface krati.Persistable |
---|
getHWMark, getLWMark, persist, sync |
Field Detail |
---|
protected int _length
protected File _directory
protected ArrayFile _arrayFile
protected EntryFactory<V extends EntryValue> _entryFactory
protected ArrayEntryManager<V extends EntryValue> _entryManager
Constructor Detail |
---|
public DynamicLongArray(int entrySize, int maxEntries, File directory) throws Exception
Exception
Method Detail |
---|
protected void loadArrayFileData()
public void saveHWMark(long endOfPeriod)
saveHWMark
in interface Persistable
endOfPeriod
- public void clear()
Array
clear
in interface Array
public long get(int index)
LongArray
get
in interface LongArray
public void set(int index, long value, long scn) throws Exception
LongArray
set
in interface LongArray
Exception
public void setCompactionAddress(int index, long address, long scn) throws Exception
AddressArray
setCompactionAddress
in interface AddressArray
index
- - the index to address arrayaddress
- - the address value for updatescn
- - the scn associated with this change
Exception
public long[] getInternalArray()
LongArray
getInternalArray
in interface LongArray
public EntryPersistListener getPersistListener()
AddressArray
getPersistListener
in interface AddressArray
public void setPersistListener(EntryPersistListener persistListener)
AddressArray
setPersistListener
in interface AddressArray
public void expandCapacity(int index) throws Exception
DynamicArray
expandCapacity
in interface DynamicArray
index
- an index in the array
Exception
public void arrayExpanded(DynamicArray dynArray)
arrayExpanded
in interface ArrayExpandListener
public final int subArrayLength()
protected void init() throws IOException
IOException
protected final ArrayFile openArrayFile(File file, int initialLength, int elementSize) throws IOException
IOException
protected void initArrayFile()
public File getDirectory()
getDirectory
in interface RecoverableArray<V extends EntryValue>
public EntryFactory<V> getEntryFactory()
getEntryFactory
in interface RecoverableArray<V extends EntryValue>
public ArrayEntryManager<V> getEntryManager()
public boolean hasIndex(int index)
hasIndex
in interface Array
public int length()
length
in interface Array
public void sync() throws IOException
sync
in interface Persistable
IOException
public void persist() throws IOException
persist
in interface Persistable
IOException
public long getHWMark()
Persistable
getHWMark
in interface Persistable
public long getLWMark()
Persistable
getLWMark
in interface Persistable
public void updateArrayFile(List<Entry<V>> entryList) throws IOException
updateArrayFile
in interface RecoverableArray<V extends EntryValue>
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |