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) |
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)
delta
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