public class LoggingBufferManager
extends java.lang.Object
Modifier and Type | Class | Description |
---|---|---|
static interface |
LoggingBufferManager.StoreDataAccessorFactory |
A factory interface for creating StoreDataAccessor objects from resource
names.
|
Constructor | Description |
---|---|
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.
|
Modifier and Type | Method | Description |
---|---|---|
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.
|
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)
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
Copyright © 2018. All rights reserved.