net.sf.ehcache.bootstrap.BootstrapCacheLoader that will load Elements into a Terracotta clustered cache, based on a previously
snapshotted key set. It is also responsible to create snapshot files to disk
| Modifier and Type | Class and Description |
|---|---|
| private class | TerracottaBootstrapCacheLoader.BootstrapThread
A background daemon thread that asynchronously calls doLoad |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| public static final boolean | DEFAULT_DEDICATED_THREAD
The default on whether to do the snapshot on a dedicated thread or using the CacheManager's
|
| public static final long | DEFAULT_INTERVAL
The default interval in seconds, between each snapshot |
| private final DiskStorePathManager | |
| private final boolean | |
| private final boolean | |
| private volatile boolean | |
| private volatile boolean | |
| private final long | |
| private volatile KeySnapshotter | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| private | TerracottaBootstrapCacheLoader(final boolean doKeySnapshot, final boolean aSynchronous, final String directory, final long interval, final boolean doKeySnapshotOnDedicatedThread)
|
| public | TerracottaBootstrapCacheLoader(final boolean
do the loading asynchronously, or synchronously asynchronous, String the directory to read snapshot files from, and write them to directory, boolean Whether to do keysnapshotting doKeySnapshots)Constructor |
| public | TerracottaBootstrapCacheLoader(final boolean
do the loading asynchronously, or synchronously asynchronous, String the directory to read snapshot files from, and write them to directory, long the interval in seconds at which the snapshots of the local key set has to occur interval)Constructor |
| public | TerracottaBootstrapCacheLoader(final boolean
do the loading asynchronously, or synchronously asynchronous, String the directory to read snapshot files from, and write them to directory, long the interval in seconds at which the snapshots of the local key set has to occur interval, boolean whether to do the snapshot on a dedicated thread or using the CacheManager's
onDedicatedThread)ScheduledExecutorServiceConstructor |
| Modifier and Type | Method and Description |
|---|---|
| public Object | clone()
Overrides net. Implements net. |
| public void | dispose()
Implements net. |
| private void | |
| public void | doLocalKeySnapshot()
Calling this method will result in a snapshot being taken or wait for the one in progress to finish |
| pack-priv KeySnapshotter | Returns: theKeySnapshotter used by this loader instanceAccessor to the associated |
| public boolean | |
| public boolean | Returns: true if disposable is immediateWhether the on going keysnapshot will finish before the instance is disposed |
| public void | load(final Ehcache
cache to load cache)Implements net. |
| public void | setImmediateShutdown(final boolean
true if immediate, false to let the snapshot finish immediateShutdown)Sets whether the disposal of the instance will let the potential current key set being written to disk finish, or whether the shutdown will be immediate |
| public void | setSnapshotOnDispose(final boolean
whether to snapshot on loader disposal doKeySnapshotOnDispose)Configures the Loader to take a snapshot when it is being disposed |
| aSynchronous | back to summary |
|---|---|
| private final boolean aSynchronous | |
| DEFAULT_DEDICATED_THREAD | back to summary |
|---|---|
| public static final boolean DEFAULT_DEDICATED_THREAD The default on whether to do the snapshot on a dedicated thread or using the CacheManager's
| |
| DEFAULT_INTERVAL | back to summary |
|---|---|
| public static final long DEFAULT_INTERVAL The default interval in seconds, between each snapshot | |
| diskStorePathManager | back to summary |
|---|---|
| private final DiskStorePathManager diskStorePathManager | |
| doKeySnapshot | back to summary |
|---|---|
| private final boolean doKeySnapshot | |
| doKeySnapshotOnDedicatedThread | back to summary |
|---|---|
| private final boolean doKeySnapshotOnDedicatedThread | |
| doKeySnapshotOnDispose | back to summary |
|---|---|
| private volatile boolean doKeySnapshotOnDispose | |
| immediateShutdown | back to summary |
|---|---|
| private volatile boolean immediateShutdown | |
| interval | back to summary |
|---|---|
| private final long interval | |
| keySnapshotter | back to summary |
|---|---|
| private volatile KeySnapshotter keySnapshotter | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| TerracottaBootstrapCacheLoader | back to summary |
|---|---|
| private TerracottaBootstrapCacheLoader(final boolean doKeySnapshot, final boolean aSynchronous, final String directory, final long interval, final boolean doKeySnapshotOnDedicatedThread) | |
| TerracottaBootstrapCacheLoader | back to summary |
|---|---|
| public TerracottaBootstrapCacheLoader(final boolean asynchronous, String directory, boolean doKeySnapshots) Constructor
| |
| TerracottaBootstrapCacheLoader | back to summary |
|---|---|
| public TerracottaBootstrapCacheLoader(final boolean asynchronous, String directory, long interval) Constructor
| |
| TerracottaBootstrapCacheLoader | back to summary |
|---|---|
| public TerracottaBootstrapCacheLoader(final boolean asynchronous, String directory, long interval, boolean onDedicatedThread) Constructor
| |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides net. Implements net. Doc from net. Clones the loader
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements net. Will shut the keysnapshot thread and other resources down.
If a snapshot is currently in progress, the method will either shutdown immediately or let the snapshot finish
based on the configured | |
| doLoad | back to summary |
|---|---|
| private void doLoad(final Ehcache cache) | |
| doLocalKeySnapshot | back to summary |
|---|---|
| public void doLocalKeySnapshot() throws IOException Calling this method will result in a snapshot being taken or wait for the one in progress to finish
| |
| getKeySnapshotter | back to summary |
|---|---|
| pack-priv KeySnapshotter getKeySnapshotter() Accessor to the associated
| |
| isAsynchronous | back to summary |
|---|---|
| public boolean isAsynchronous() Implements net.
| |
| isImmediateShutdown | back to summary |
|---|---|
| public boolean isImmediateShutdown() Whether the on going keysnapshot will finish before the instance is disposed
| |
| load | back to summary |
|---|---|
| public void load(final Ehcache cache) throws CacheException Implements net. Doc from net. Instructs the loader to load the given cache
| |
| setImmediateShutdown | back to summary |
|---|---|
| public void setImmediateShutdown(final boolean immediateShutdown) Sets whether the disposal of the instance will let the potential current key set being written to disk finish, or whether the shutdown will be immediate
| |
| setSnapshotOnDispose | back to summary |
|---|---|
| public void setSnapshotOnDispose(final boolean doKeySnapshotOnDispose) Configures the Loader to take a snapshot when it is being disposed
| |
| Modifier and Type | Field and Description |
|---|---|
| private Ehcache |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final void | run()
Overrides java. Implements java. |
| cache | back to summary |
|---|---|
| private Ehcache cache | |
| BootstrapThread | back to summary |
|---|---|
| public BootstrapThread(Ehcache cache) | |
| run | back to summary |
|---|---|
| public final void run() Overrides java. Implements java. RemoteDebugger thread method.
| |