Package org.apache.bookkeeper.bookie
Class BookieStatus
java.lang.Object
org.apache.bookkeeper.bookie.BookieStatus
The status object represents the current status of a bookie instance.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanbooleanbooleanparse(BufferedReader reader) Parse the bookie status object using appropriate layout version.(package private) voidreadFromDirectories(List<File> directories) Read bookie status from the status files, and update the bookie status if read succeed.(package private) booleansetToReadOnlyMode(boolean isManuallyModify) (package private) booleantoString()(package private) voidwriteToDirectories(List<File> directories) Write bookie status to multiple directories in best effort.
-
Field Details
-
CURRENT_STATUS_LAYOUT_VERSION
static final int CURRENT_STATUS_LAYOUT_VERSION- See Also:
-
-
Constructor Details
-
BookieStatus
BookieStatus()
-
-
Method Details
-
isInWritable
public boolean isInWritable() -
setToWritableMode
boolean setToWritableMode() -
isInReadOnlyMode
boolean isInReadOnlyMode() -
setToReadOnlyMode
boolean setToReadOnlyMode(boolean isManuallyModify) -
writeToDirectories
Write bookie status to multiple directories in best effort.- Parameters:
directories- list of directories to write to
-
readFromDirectories
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
Parse the bookie status object using appropriate layout version.- Parameters:
reader-- Returns:
- BookieStatus if parse succeed, otherwise return null
- Throws:
IOExceptionIllegalArgumentException
-
toString
-
isManuallyModifiedToReadOnly
public boolean isManuallyModifiedToReadOnly()
-