|
|||||||||
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 contents to a durable backing store.
Nested Class Summary | |
---|---|
static interface |
IStorePersister.ErrorHandler
Callback interface to report persistence errors |
static class |
IStorePersister.Type
Enumerates the persister type |
Nested classes/interfaces inherited from interface com.neeve.ods.IStoreJournallingPersister |
---|
IStoreJournallingPersister.LogEmptinessExpectation, IStoreJournallingPersister.LogPresenceExpectation, IStoreJournallingPersister.StartupExpectation |
Nested classes/interfaces inherited from interface com.neeve.ods.IStoreJournallingWriter |
---|
IStoreJournallingWriter.JournallingParameters, IStoreJournallingWriter.LogCounters |
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. |
IStorePersister.ErrorHandler |
getErrorHandler()
Get a persister's error handler. |
String |
getName()
Get the name of a persister. |
IStorePersisterStats |
getStats()
Gets a persister's stats. |
IStorePersister.Type |
getType()
Get the persister type. |
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(IStoreJournallingPersister.StartupExpectation expectation,
Enum<?> value)
Set a startup expectation |
Methods inherited from interface com.neeve.ods.IStoreJournallingPersister |
---|
wasRepaired |
Methods inherited from interface com.neeve.ods.IStoreJournallingWriter |
---|
getJournallingParameters |
Methods inherited from interface com.neeve.ods.IStoreWriter |
---|
commit, isShared, onRoleChange, recordPersisterMetadata, recordPut, recordRemove, recordSend, recordUpdate, sync |
Methods inherited from interface com.neeve.ods.IStoreReader |
---|
read, readMetadata |
Method Detail |
---|
String getName()
IStorePersister.Type getType()
void setStartupExpectation(IStoreJournallingPersister.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
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 |