public class BrooklynMementoPersisterToObjectStore extends java.lang.Object implements BrooklynMementoPersister
BrooklynMementoPersister
backed by a pluggable
PersistenceObjectStore
such as a file system or a jclouds object storeBrooklynMementoPersister.Delta, BrooklynMementoPersister.LookupContext, BrooklynMementoPersister.MutableDelta
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.Integer> |
PERSISTER_MAX_SERIALIZATION_ATTEMPTS |
static ConfigKey<java.lang.Integer> |
PERSISTER_MAX_THREAD_POOL_SIZE |
Constructor and Description |
---|
BrooklynMementoPersisterToObjectStore(PersistenceObjectStore objectStore,
StringConfigMap brooklynProperties,
java.lang.ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
void |
checkpoint(BrooklynMemento newMemento,
PersistenceExceptionHandler exceptionHandler) |
void |
checkpoint(BrooklynMementoRawData newMemento,
PersistenceExceptionHandler exceptionHandler)
See
BrooklynPersistenceUtils for conveniences for using this method. |
void |
delta(BrooklynMementoPersister.Delta delta,
PersistenceExceptionHandler exceptionHandler)
applies a partial write of state delta
|
void |
disableWriteAccess(boolean graceful) |
void |
enableWriteAccess() |
java.lang.String |
getBackingStoreDescription() |
MementoSerializer<java.lang.Object> |
getMementoSerializer() |
PersistenceObjectStore |
getObjectStore() |
BrooklynMemento |
loadMemento(BrooklynMementoPersister.LookupContext lookupContext,
RebindExceptionHandler exceptionHandler) |
BrooklynMemento |
loadMemento(BrooklynMementoRawData mementoData,
BrooklynMementoPersister.LookupContext lookupContext,
RebindExceptionHandler exceptionHandler)
Retrieves the memento class, containing deserialized objects (but not the
BrooklynObject class). |
BrooklynMementoManifest |
loadMementoManifest(BrooklynMementoRawData mementoData,
RebindExceptionHandler exceptionHandler)
Loads minimal manifest information (almost entirely *not* deserialized).
|
BrooklynMementoManifest |
loadMementoManifest(RebindExceptionHandler exceptionHandler) |
BrooklynMementoRawData |
loadMementoRawData(RebindExceptionHandler exceptionHandler)
Loads raw data contents of the mementos.
|
void |
queueDelta(BrooklynMementoPersister.Delta delta)
inserts an additional delta to be written on the next delta request
|
void |
stop(boolean graceful)
permanently shuts down all access to the remote store
|
void |
waitForWritesCompleted(Duration timeout) |
void |
waitForWritesCompleted(long timeout,
java.util.concurrent.TimeUnit unit) |
public static final ConfigKey<java.lang.Integer> PERSISTER_MAX_THREAD_POOL_SIZE
public static final ConfigKey<java.lang.Integer> PERSISTER_MAX_SERIALIZATION_ATTEMPTS
public BrooklynMementoPersisterToObjectStore(PersistenceObjectStore objectStore, StringConfigMap brooklynProperties, java.lang.ClassLoader classLoader)
public MementoSerializer<java.lang.Object> getMementoSerializer()
public void enableWriteAccess()
enableWriteAccess
in interface BrooklynMementoPersister
public void disableWriteAccess(boolean graceful)
disableWriteAccess
in interface BrooklynMementoPersister
public void stop(boolean graceful)
BrooklynMementoPersister
stop
in interface BrooklynMementoPersister
public PersistenceObjectStore getObjectStore()
public BrooklynMementoRawData loadMementoRawData(RebindExceptionHandler exceptionHandler)
BrooklynMementoPersister
Some classes (esp deprecated ones) may return null here,
meaning that the BrooklynMementoPersister.loadMementoManifest(BrooklynMementoRawData, RebindExceptionHandler)
and BrooklynMementoPersister.loadMemento(BrooklynMementoRawData, LookupContext, RebindExceptionHandler)
methods
will populate the raw data via another source.
loadMementoRawData
in interface BrooklynMementoPersister
public BrooklynMementoManifest loadMementoManifest(RebindExceptionHandler exceptionHandler) throws java.io.IOException
loadMementoManifest
in interface BrooklynMementoPersister
java.io.IOException
public BrooklynMementoManifest loadMementoManifest(BrooklynMementoRawData mementoData, RebindExceptionHandler exceptionHandler) throws java.io.IOException
BrooklynMementoPersister
BrooklynMementoRawData
is not supplied,
but callers are encouraged to supply that for optimal performance.loadMementoManifest
in interface BrooklynMementoPersister
java.io.IOException
public BrooklynMemento loadMemento(BrooklynMementoPersister.LookupContext lookupContext, RebindExceptionHandler exceptionHandler) throws java.io.IOException
loadMemento
in interface BrooklynMementoPersister
java.io.IOException
public BrooklynMemento loadMemento(BrooklynMementoRawData mementoData, BrooklynMementoPersister.LookupContext lookupContext, RebindExceptionHandler exceptionHandler) throws java.io.IOException
BrooklynMementoPersister
BrooklynObject
class).
Implementations should load the raw data if BrooklynMementoRawData
is not supplied,
but callers are encouraged to supply that for optimal performance.
Note that this method is *not* thread safe.
loadMemento
in interface BrooklynMementoPersister
java.io.IOException
@Beta public void checkpoint(BrooklynMementoRawData newMemento, PersistenceExceptionHandler exceptionHandler)
BrooklynPersistenceUtils
for conveniences for using this method.checkpoint
in interface BrooklynMementoPersister
public void checkpoint(BrooklynMemento newMemento, PersistenceExceptionHandler exceptionHandler)
checkpoint
in interface BrooklynMementoPersister
public void delta(BrooklynMementoPersister.Delta delta, PersistenceExceptionHandler exceptionHandler)
BrooklynMementoPersister
delta
in interface BrooklynMementoPersister
public void queueDelta(BrooklynMementoPersister.Delta delta)
BrooklynMementoPersister
queueDelta
in interface BrooklynMementoPersister
public void waitForWritesCompleted(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
waitForWritesCompleted
in interface BrooklynMementoPersister
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public void waitForWritesCompleted(Duration timeout) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException
waitForWritesCompleted
in interface BrooklynMementoPersister
java.lang.InterruptedException
java.util.concurrent.TimeoutException
public java.lang.String getBackingStoreDescription()
getBackingStoreDescription
in interface BrooklynMementoPersister