|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.store.LoggingBufferManager
public class LoggingBufferManager
A paged random access buffer manager that caches access between a Store and the underlying filesystem and that also handles check point logging and crash recovery (via a JournalledSystem object).
Nested Class Summary | |
---|---|
static interface |
LoggingBufferManager.StoreDataAccessorFactory
A factory interface for creating StoreDataAccessor objects from resource names. |
Constructor Summary | |
---|---|
LoggingBufferManager(java.io.File journal_path,
boolean read_only,
int max_pages,
int page_size,
LoggingBufferManager.StoreDataAccessorFactory sda_factory,
DebugLogger debug,
boolean enable_logging)
Constructs the manager. |
|
LoggingBufferManager(java.io.File resource_path,
java.io.File journal_path,
boolean read_only,
int max_pages,
int page_size,
java.lang.String file_ext,
long max_slice_size,
DebugLogger debug,
boolean enable_logging)
Constructs the manager with a scattering store implementation that converts the resource to a file in the given path. |
Method Summary | |
---|---|
void |
lockForWrite()
Obtains a write lock on the buffer. |
void |
setCheckPoint(boolean flush_journals)
Sets a check point in the log. |
void |
start()
Starts the buffer manager. |
void |
stop()
Stops the buffer manager. |
void |
unlockForWrite()
Releases a write lock on the buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggingBufferManager(java.io.File journal_path, boolean read_only, int max_pages, int page_size, LoggingBufferManager.StoreDataAccessorFactory sda_factory, DebugLogger debug, boolean enable_logging)
public LoggingBufferManager(java.io.File resource_path, java.io.File journal_path, boolean read_only, int max_pages, int page_size, java.lang.String file_ext, long max_slice_size, DebugLogger debug, boolean enable_logging)
Method Detail |
---|
public void start() throws java.io.IOException
java.io.IOException
public void stop() throws java.io.IOException
java.io.IOException
public void lockForWrite() throws java.lang.InterruptedException
java.lang.InterruptedException
public void unlockForWrite()
public void setCheckPoint(boolean flush_journals) throws java.io.IOException, java.lang.InterruptedException
Some things to keep in mind when using this. You must ensure that no writes can occur while this operation is occuring. Typically this will happen at the end of a commit but you need to ensure that nothing can happen in the background, such as records being deleted or items being inserted. It is required that the 'no write' restriction is enforced at a high level. If care is not taken then the image written will not be clean and if a crash occurs the image that is recovered will not be stable.
java.io.IOException
java.lang.InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |