|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IStorePersister
Represents a store persister.
This interface defines a store persister. Store persisters are used to persist store events to a persistent transaction log.
Nested Class Summary | |
---|---|
static interface |
IStorePersister.ErrorHandler
Callback interface to report persistence errors |
static class |
IStorePersister.LogEmptinessExpectation
Enumerates the set of values permissible with the log emptiness expectation |
static class |
IStorePersister.LogPresenceExpectation
Enumerates the set of values permissible with the log presence expectation |
static class |
IStorePersister.StartupExpectation
Enumerates the set of supported startup expectations. |
Nested classes/interfaces inherited from interface com.neeve.ods.IStoreWriter |
---|
IStoreWriter.LogCounters, IStoreWriter.Parameters |
Nested classes/interfaces inherited from interface com.neeve.ods.IStoreReader |
---|
IStoreReader.ReadCallback |
Method Summary | |
---|---|
void |
close()
Close a persister. |
void |
fail()
Force fail the persister. |
void |
fail(Exception cause)
Force fail a persister. |
StorePersisterDescriptor |
getDescriptor()
Get a persister's descriptor. |
IStorePersister.ErrorHandler |
getErrorHandler()
Get a persister's error handler. |
String |
getName()
Get the name of a persister. |
IStorePersisterStats |
getStats()
Gets a persister's stats. |
boolean |
isOpen()
Get whether the persister is opened |
void |
open()
Open a persister. |
void |
open(PktBuffer serializedMetadata,
boolean truncateLive)
Open a persister with provided metadata. |
void |
setErrorHandler(IStorePersister.ErrorHandler errorHandler)
Set a persister's error handler. |
void |
setStartupExpectation(IStorePersister.StartupExpectation expectation,
Enum<?> value)
Set a startup expectation |
boolean |
wasRepaired()
Indicates whether the transaction log was repaired during open. |
Methods inherited from interface com.neeve.ods.IStoreWriter |
---|
getParameters, isShared, onRoleChange, sync, writeCommitEntry |
Methods inherited from interface com.neeve.ods.IStoreReader |
---|
read, read, readMetadata |
Method Detail |
---|
String getName()
StorePersisterDescriptor getDescriptor()
void setStartupExpectation(IStorePersister.StartupExpectation expectation, Enum<?> value)
void open(PktBuffer serializedMetadata, boolean truncateLive) throws Exception
serializedMetadata
- Serialized form of the metadata to use
for the log being opened. A value of null indicates that the
existing metadata be used for the log and, if any metadata
does not exist, then start with a fresh metadata objecttruncateLive
- If true, then the live log file is truncated
during open. If metadata is supplied to this method, then
the live log is determined from that metadata.
Exception
void open() throws Exception
Invoking this method is equivalent to invoking open(null, false)
Exception
boolean isOpen() throws Exception
Exception
boolean wasRepaired()
This method can only be invoked on an open persister.
void setErrorHandler(IStorePersister.ErrorHandler errorHandler)
IStorePersister.ErrorHandler getErrorHandler()
IStorePersisterStats getStats()
void fail(Exception cause)
cause
- The cause of the failure.
CAUTION: This method is only for testing purposes and should not be invoked outside of test frameworks.
This method invokes the error handler if installed and marks the persister has failed. This will cause all subsequent commits or syncs to immediately fail with a runtime exception.
void fail()
This method invokes the following:
fail(new OdsException("force failed by user"))
void close()
This method implcitly syncs and closes the persister.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |