Package org.apache.bookkeeper.bookie
Class BookieStatus
- java.lang.Object
-
- org.apache.bookkeeper.bookie.BookieStatus
-
public class BookieStatus extends java.lang.Object
The status object represents the current status of a bookie instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
BookieStatus.BookieMode
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
CURRENT_STATUS_LAYOUT_VERSION
-
Constructor Summary
Constructors Constructor Description BookieStatus()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) boolean
isInReadOnlyMode()
boolean
isInWritable()
BookieStatus
parse(java.io.BufferedReader reader)
Parse the bookie status object using appropriate layout version.(package private) void
readFromDirectories(java.util.List<java.io.File> directories)
Read bookie status from the status files, and update the bookie status if read succeed.(package private) boolean
setToReadOnlyMode()
(package private) boolean
setToWritableMode()
java.lang.String
toString()
(package private) void
writeToDirectories(java.util.List<java.io.File> directories)
Write bookie status to multiple directories in best effort.
-
-
-
Field Detail
-
CURRENT_STATUS_LAYOUT_VERSION
static final int CURRENT_STATUS_LAYOUT_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isInWritable
public boolean isInWritable()
-
setToWritableMode
boolean setToWritableMode()
-
isInReadOnlyMode
boolean isInReadOnlyMode()
-
setToReadOnlyMode
boolean setToReadOnlyMode()
-
writeToDirectories
void writeToDirectories(java.util.List<java.io.File> directories)
Write bookie status to multiple directories in best effort.- Parameters:
directories
- list of directories to write to
-
readFromDirectories
void readFromDirectories(java.util.List<java.io.File> directories)
Read bookie status from the status files, and update the bookie status if read succeed. If a status file is not readable or not found, it will skip and try to read from the next file.- Parameters:
directories
- list of directories that store the status file
-
parse
public BookieStatus parse(java.io.BufferedReader reader) throws java.io.IOException, java.lang.IllegalArgumentException
Parse the bookie status object using appropriate layout version.- Parameters:
reader
-- Returns:
- BookieStatus if parse succeed, otherwise return null
- Throws:
java.io.IOException
java.lang.IllegalArgumentException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-