| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final ClassLoader | |
| private final DiskStorePathManager | |
| private static final Logger | |
| private final Lock | |
| private volatile boolean | |
| private static final String | |
| private static final String | |
| private static final String | |
| private final Lock |
| Access | Constructor and Description |
|---|---|
| pack-priv | RotatingSnapshotFile(final DiskStorePathManager diskStorePathManager, final String
use as base name of the files cacheName, final ClassLoader classLoader)Constructor |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| pack-priv File | Returns: the file to read fromCreates a File representing the uncorrupted file on disk |
| pack-priv File | Returns: the File to write toCreates a File representing the one to write new entries to |
| pack-priv < the type of the each element T> Set | Returns: the Set of all entries in the latest uncorrupted file on diskReads all the keys from the file on disk, doing cleanup if required of previously unterminated file written to |
| private boolean | |
| pack-priv void | setShutdownOnThreadInterrupted(final boolean
true, if shutdown needs to happen in the middle of a write shutdownOnThreadInterrupted)Whether to shutdown as soon as the writer Thread is interrupted, or to let all keys be written to disk first |
| pack-priv void | snapshotNowOrWaitForCurrentToFinish(final Set<E>
the latest current local set localKeys)Calling this method will result in writing all keys to be written to disk or wait for the one in progress to finish |
| private void | |
| pack-priv File | Returns: the File representing the previous successful snapshot (temp file to be deleted)Creates a File representing the old uncorrupted file, when the new one has successfully been written to disk |
| pack-priv void |
| cacheName | back to summary |
|---|---|
| private final String cacheName | |
| classLoader | back to summary |
|---|---|
| private final ClassLoader classLoader | |
| diskStorePathManager | back to summary |
|---|---|
| private final DiskStorePathManager diskStorePathManager | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| readLock | back to summary |
|---|---|
| private final Lock readLock | |
| shutdownOnThreadInterrupted | back to summary |
|---|---|
| private volatile boolean shutdownOnThreadInterrupted | |
| SUFFIX_MOVE | back to summary |
|---|---|
| private static final String SUFFIX_MOVE | |
| SUFFIX_OK | back to summary |
|---|---|
| private static final String SUFFIX_OK | |
| SUFFIX_PROGRESS | back to summary |
|---|---|
| private static final String SUFFIX_PROGRESS | |
| writeLock | back to summary |
|---|---|
| private final Lock writeLock | |
| RotatingSnapshotFile | back to summary |
|---|---|
| pack-priv RotatingSnapshotFile(final DiskStorePathManager diskStorePathManager, final String cacheName, final ClassLoader classLoader) Constructor
| |
| cleanUp | back to summary |
|---|---|
| private void cleanUp() | |
| cleanUp | back to summary |
|---|---|
| private void cleanUp(final File inProgress) | |
| closeAndDeleteAssociatedFileOnFailure | back to summary |
|---|---|
| private void closeAndDeleteAssociatedFileOnFailure(final FileInputStream fis, final File associatedFile) | |
| currentSnapshotFile | back to summary |
|---|---|
| pack-priv File currentSnapshotFile() Creates a File representing the uncorrupted file on disk
| |
| newSnapshotFile | back to summary |
|---|---|
| pack-priv File newSnapshotFile() Creates a File representing the one to write new entries to
| |
| readAll | back to summary |
|---|---|
| pack-priv <T> Set Reads all the keys from the file on disk, doing cleanup if required of previously unterminated file written to
| |
| requiresCleanUp | back to summary |
|---|---|
| private boolean requiresCleanUp() | |
| setShutdownOnThreadInterrupted | back to summary |
|---|---|
| pack-priv void setShutdownOnThreadInterrupted(final boolean shutdownOnThreadInterrupted) Whether to shutdown as soon as the writer Thread is interrupted, or to let all keys be written to disk first
| |
| snapshotNowOrWaitForCurrentToFinish | back to summary |
|---|---|
| pack-priv void snapshotNowOrWaitForCurrentToFinish(final Set<E> localKeys) throws IOException Calling this method will result in writing all keys to be written to disk or wait for the one in progress to finish
| |
| swapForOldWithNewSnapshot | back to summary |
|---|---|
| private void swapForOldWithNewSnapshot(final File inProgress) | |
| tempSnapshotFile | back to summary |
|---|---|
| pack-priv File tempSnapshotFile() Creates a File representing the old uncorrupted file, when the new one has successfully been written to disk
| |
| writeAll | back to summary |
|---|---|
| pack-priv void writeAll(final Iterable<T> localKeys) throws IOException Writes all values of the iterable to a new file and does the necessary clean up when done
| |