|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.store.AbstractStore
com.mckoi.store.JournalledFileStore
public final class JournalledFileStore
An implementation of AbstractStore that persists to an underlying data format via a robust journalling system that supports check point and crash recovery. Note that this object is a bridge between the Store API and the journalled behaviour defined in LoggingBufferManager, JournalledSystem and the StoreDataAccessor implementations.
Note that access to the resources is abstracted via a 'resource_name' string. The LoggingBufferManager object converts the resource name into a concrete object that accesses the actual data.
Field Summary |
---|
Fields inherited from class com.mckoi.store.AbstractStore |
---|
BIN_AREA_OFFSET, BIN_ENTRIES, DATA_AREA_OFFSET, FIXED_AREA_OFFSET, free_bin_list, header_buf, MAGIC, read_only, total_allocated_space, wilderness_pointer |
Constructor Summary | |
---|---|
JournalledFileStore(java.lang.String resource_name,
LoggingBufferManager buffer_manager,
boolean read_only)
Constructs the ScatteringFileStore. |
Method Summary | |
---|---|
boolean |
delete()
Deletes this store from the file system. |
protected long |
endOfDataAreaPointer()
Returns a pointer to the end of the current data area. |
boolean |
exists()
Returns true if this store exists in the file system. |
protected void |
internalClose()
Internally closes the backing area. |
protected void |
internalOpen(boolean read_only)
Internally opens the backing area. |
void |
lockForWrite()
It is often useful to guarentee that a certain sequence of updates to a store is completed and not broken in the middle. |
protected int |
readByteArrayFrom(long position,
byte[] buf,
int off,
int len)
Reads a byte array from the given position in the file. |
protected int |
readByteFrom(long position)
Reads a byte from the given position in the file. |
protected void |
setDataAreaSize(long new_size)
Sets the size of the data area. |
java.lang.String |
toString()
|
void |
unlockForWrite()
See the 'lockForWrite' method description. |
protected void |
writeByteArrayTo(long position,
byte[] buf,
int off,
int len)
Writes a byte array to the given position in the file. |
protected void |
writeByteTo(long position,
int b)
Writes a byte to the given position in the file. |
Methods inherited from class com.mckoi.store.AbstractStore |
---|
checkPointer, close, coalescArea, createArea, deleteArea, expandDataArea, findAllocatedAreasNotIn, getAllAreas, getArea, getAreaHeader, getAreaInputStream, getMutableArea, getNextAreaHeader, getPreviousAreaHeader, isValidBoundarySize, lastCloseClean, open, openScanAndFix, readBins, reboundArea, splitArea, statsScan, totalAllocatedSinceStart, writeAllBins, writeBinIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JournalledFileStore(java.lang.String resource_name, LoggingBufferManager buffer_manager, boolean read_only)
Method Detail |
---|
public boolean delete() throws java.io.IOException
java.io.IOException
public boolean exists() throws java.io.IOException
java.io.IOException
public void lockForWrite()
Store
To achieve this, the 'lockForWrite' and 'unlockForWrite' methods are available. When 'lockForWrite' has been called, a check point can not created until there are no write locks obtained on the table.
public void unlockForWrite()
Store
protected void internalOpen(boolean read_only) throws java.io.IOException
internalOpen
in class AbstractStore
java.io.IOException
protected void internalClose() throws java.io.IOException
internalClose
in class AbstractStore
java.io.IOException
protected int readByteFrom(long position) throws java.io.IOException
AbstractStore
readByteFrom
in class AbstractStore
java.io.IOException
protected int readByteArrayFrom(long position, byte[] buf, int off, int len) throws java.io.IOException
AbstractStore
readByteArrayFrom
in class AbstractStore
java.io.IOException
protected void writeByteTo(long position, int b) throws java.io.IOException
AbstractStore
writeByteTo
in class AbstractStore
java.io.IOException
protected void writeByteArrayTo(long position, byte[] buf, int off, int len) throws java.io.IOException
AbstractStore
writeByteArrayTo
in class AbstractStore
java.io.IOException
protected long endOfDataAreaPointer() throws java.io.IOException
AbstractStore
endOfDataAreaPointer
in class AbstractStore
java.io.IOException
protected void setDataAreaSize(long new_size) throws java.io.IOException
AbstractStore
setDataAreaSize
in class AbstractStore
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |