Enum Constant Summary
Enum Constants
First version of snapshot file format.
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
Create a file of this format with the content of specified snapshot.
Returns the extension associated with this file format.
Returns the
CompressionType
corresponding to specified file name by examining its extension.
Returns the latest format.
Open an existing file of this format.
Returns the enum constant of this class with the specified name.
Returns an array containing the constants of this enum class, in
the order they are declared.
Methods inherited from class java.lang.Enum
clone , compareTo , describeConstable , equals , finalize , getDeclaringClass , hashCode , name , ordinal , toString , valueOf
Enum Constant Details
SNAPSHOT_V1
First version of snapshot file format.
Method Details
values
Returns an array containing the constants of this enum class, in
the order they are declared.
Returns:
an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this class. (Extraneous whitespace characters are
not permitted.)
Parameters:
name
- the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException
- if this enum class has no constant with the specified name
NullPointerException
- if the argument is null
extension
public final String extension ()
Returns the extension associated with this file format.
Returns:
the extension associated with this file format
latest
Returns the latest format.
Returns:
the latest format
forFileName
Returns the
CompressionType
corresponding to specified file name by examining its extension.
Parameters:
fileName
- the file name
Returns:
the CompressionType
, or null
if the file extension is not recognized.
createNew
Create a file of this format with the content of specified snapshot.
Parameters:
file
- the file to write
timestamp
- the timestamp
lastIncluded
- last journal entry included in the snapshot
votingConfig
- the server configuration
entryCompress
- the compression to apply to unapplied entries
unappliedEntries
- the unapplied entries
stateCompress
- the compression to apply to user state
state
- the state, or null
Returns:
a Closeable
representing the flush-and-close action
Throws:
IOException
- if an I/O error occurs
open
Open an existing file of this format.
Parameters:
file
- the file to open
Returns:
a SnapshotFile
Throws:
IOException
- if an I/O error occurs