class LogFile extends Object
(Note -- I use protected
here as an advisory notice.
Clearly, since this is package code, all classes in the package have
access, but fields marked protected
are expected to be
used only by subclasses. Use good taste.)
LogOutputFile
,
LogInputFile
Modifier and Type | Field and Description |
---|---|
protected static byte |
ABORT_OP
A log entry that records a transaction
abort . |
protected File |
baseDir
The directory in which the log files live.
|
protected String |
baseFile
The base part of the file name (e.g.,
"log." |
protected static byte |
BATCH_TAKE_OP
A log entry that records a batch
take . |
protected static byte |
BATCH_WRITE_OP
A log entry that records a batch
write . |
protected static byte |
BOOT_OP
A log entry that records a boot.
|
protected static byte |
CANCEL_OP
A log entry that records a
cancel . |
protected static byte |
COMMIT_OP
A log entry that records a transaction
commit . |
protected static byte |
JOINSTATE_OP
A log entry that records the join state.
|
(package private) static String |
LOG_TYPE
The type of log stream
|
protected static int |
LOG_VERSION
The version of the log stream (the highest one known).
|
private static Logger |
logger
Logger for logging persistent store related information
|
protected static byte |
NOTIFIED_OP
A log entry that records a notification and new sequence number.
|
protected static byte |
PREPARE_OP
A log entry that records a transaction
prepare . |
protected static byte |
REGISTER_OP
A log entry that records a
notify . |
protected static byte |
RENEW_OP
A log entry that records a
notify . |
protected static byte |
TAKE_OP
A log entry that records a
take . |
protected static byte |
UUID_OP
A log entry that records the service's
Uuid . |
protected static byte |
WRITE_OP
A log entry that records a
write . |
Modifier | Constructor and Description |
---|---|
protected |
LogFile(File baseDir,
String baseFile)
Create a log file with the given base directory, base file name
within the directory.
|
protected |
LogFile(String basePath)
Create a log file from the given template.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
destroy()
Destroy all log files associated with this stream.
|
(package private) int |
existingLogs(Collection files)
Fill in a list of existing matching log files, oldest to newest,
returning the highest number used as a suffix, or -1 if
no files were found.
|
protected File baseDir
protected String baseFile
"log."
for
"log.0"
, "log.1"
, ...)static final String LOG_TYPE
protected static final int LOG_VERSION
protected static final byte BOOT_OP
protected static final byte JOINSTATE_OP
protected static final byte WRITE_OP
write
.protected static final byte TAKE_OP
take
.protected static final byte REGISTER_OP
notify
.protected static final byte RENEW_OP
notify
.protected static final byte NOTIFIED_OP
protected static final byte CANCEL_OP
cancel
.protected static final byte PREPARE_OP
prepare
.protected static final byte COMMIT_OP
commit
.protected static final byte ABORT_OP
abort
.protected static final byte UUID_OP
Uuid
.protected static final byte BATCH_WRITE_OP
write
.protected static final byte BATCH_TAKE_OP
take
.private static final Logger logger
protected LogFile(File baseDir, String baseFile)
protected LogFile(String basePath) throws IOException
basePath
has a directory component, it is used as
the base directory. Otherwise the base directory is
"."
. If basePath
names a directory,
the base name will be ""
. Otherwise the file
component is used as the base, with a "." added at the end if it
is not already present.IOException
int existingLogs(Collection files)
void destroy()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.