Package org.apache.cassandra.service
Class StartupChecks
java.lang.Object
org.apache.cassandra.service.StartupChecks
Verifies that the system and environment is in a fit state to be started.
Used in CassandraDaemon#setup() to check various settings and invariants.
Each individual test is modelled as an implementation of StartupCheck, these are run
at the start of CassandraDaemon#setup() before any local state is mutated. The default
checks are a mix of informational tests (inspectJvmOptions), initialization
(initSigarLibrary, checkCacheServiceInitialization) and invariant checking
(checkValidLaunchDate, checkSystemKeyspaceState, checkSSTablesFormat).
In addition, if checkSystemKeyspaceState determines that the release version has
changed since last startup (i.e. the node has been upgraded) it snapshots the system
keyspace to make it easier to back out if necessary.
If any check reports a failure, then the setup method exits with an error (after
logging any output from the tests). If all tests report success, setup can continue.
We should be careful in future to ensure anything which mutates local state (such as
writing new sstables etc) only happens after we've verified the initial setup.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheckstatic final StartupCheck -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathgetReadAheadKBPath(String blockDirectoryPath) voidverify(StartupChecksOptions options) Run the configured tests and return a report detailing the results.withTest(StartupCheck test) Add system test to be run before schema is loaded during startup
-
Field Details
-
checkKernelBug1057843
-
checkJemalloc
-
checkLz4Native
-
checkValidLaunchDate
-
checkJMXPorts
-
checkJMXProperties
-
inspectJvmOptions
-
checkNativeLibraryInitialization
-
initSigarLibrary
-
checkReadAheadKbSetting
-
checkMaxMapCount
-
checkDataDirs
-
checkSSTablesFormat
-
checkSystemKeyspaceState
-
checkDatacenter
-
checkRack
-
checkLegacyAuthTables
-
-
Constructor Details
-
StartupChecks
public StartupChecks()
-
-
Method Details
-
withDefaultTests
-
withTest
Add system test to be run before schema is loaded during startup- Parameters:
test- the system test to include
-
verify
Run the configured tests and return a report detailing the results.- Parameters:
options- options to pass to respective checks for their configration- Throws:
StartupException- if any test determines that the system is not in an valid state to startup
-
getReadAheadKBPath
-