public class LoggingBufferManager extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
LoggingBufferManager.StoreDataAccessorFactory
A factory interface for creating StoreDataAccessor objects from resource
names.
|
Constructor and Description |
---|
LoggingBufferManager(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(File resource_path,
File journal_path,
boolean read_only,
int max_pages,
int page_size,
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 and 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(File journal_path, boolean read_only, int max_pages, int page_size, LoggingBufferManager.StoreDataAccessorFactory sda_factory, DebugLogger debug, boolean enable_logging)
public LoggingBufferManager(File resource_path, File journal_path, boolean read_only, int max_pages, int page_size, String file_ext, long max_slice_size, DebugLogger debug, boolean enable_logging)
public void start() throws IOException
IOException
public void stop() throws IOException
IOException
public void lockForWrite() throws InterruptedException
InterruptedException
public void unlockForWrite()
public void setCheckPoint(boolean flush_journals) throws IOException, 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.
IOException
InterruptedException
Copyright © 2015. All rights reserved.