Package org.apache.bookkeeper.bookie
Class UncleanShutdownDetectionImpl
- java.lang.Object
-
- org.apache.bookkeeper.bookie.UncleanShutdownDetectionImpl
-
- All Implemented Interfaces:
UncleanShutdownDetection
public class UncleanShutdownDetectionImpl extends java.lang.Object implements UncleanShutdownDetection
Used to determine if the prior shutdown was unclean or not. It does so by adding a file to each ledger directory after successful start-up and removing the file on graceful shutdown. Any abrupt termination will cause one or more of these files to not be cleared and so on the subsequent boot-up, the presence of any of these files will indicate an unclean shutdown.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String
DIRTY_FILENAME
-
Constructor Summary
Constructors Constructor Description UncleanShutdownDetectionImpl(LedgerDirsManager ledgerDirsManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
lastShutdownWasUnclean()
void
registerCleanShutdown()
void
registerStartUp()
-
-
-
Field Detail
-
DIRTY_FILENAME
static final java.lang.String DIRTY_FILENAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UncleanShutdownDetectionImpl
public UncleanShutdownDetectionImpl(LedgerDirsManager ledgerDirsManager)
-
-
Method Detail
-
registerStartUp
public void registerStartUp() throws java.io.IOException
- Specified by:
registerStartUp
in interfaceUncleanShutdownDetection
- Throws:
java.io.IOException
-
registerCleanShutdown
public void registerCleanShutdown()
- Specified by:
registerCleanShutdown
in interfaceUncleanShutdownDetection
-
lastShutdownWasUnclean
public boolean lastShutdownWasUnclean()
- Specified by:
lastShutdownWasUnclean
in interfaceUncleanShutdownDetection
-
-