Package org.apache.bookkeeper.bookie
Class BookieShell
java.lang.Object
org.apache.bookkeeper.bookie.BookieShell
- All Implemented Interfaces:
Tool
Bookie Shell is to provide utilities for users to administer a bookkeeper cluster.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classCommand for administration of autorecovery.(package private) classFormats the local data present in current bookie server.(package private) class(package private) classCommand to run a bookie sanity test.(package private) classRebuild DbLedgerStorage ledgers index.(package private) classstatic interfaceBookieShell command.(package private) classConvert bookie indexes from InterleavedStorage to DbLedgerStorage format.(package private) classConvert bookie indexes from DbLedgerStorage to InterleavedStorage format.(package private) classCommand to trigger AuditTask by resetting lostBookieRecoveryDelay and then make sure the ledgers stored in the bookie are properly replicated and Cookie of the decommissioned bookie should be deleted from metadata server.(package private) classCommand to delete a given ledger.(package private) classCommand to retrieve remote bookie endpoint information.(package private) class(package private) classCommand to print help message.(package private) classInitializes bookie, by making sure that the journalDir, ledgerDirs and indexDirs are empty and there is no registered Bookie with this BookieId.(package private) classInitializes new cluster by creating required znodes for the cluster.(package private) classCommand to print last log mark.(package private) classLedger Command Handles ledger related operations.(package private) classPrint the metadata for a ledger.(package private) classList active ledgers on entry log file.(package private) classList available bookies.(package private) class(package private) classCommand to list all ledgers in the cluster.(package private) classCommand for listing underreplicated ledgers.(package private) classCheck local storage for inconsistencies.(package private) classSetter and Getter for LostBookieRecoveryDelay value (in seconds) in metadata store.(package private) classFormat the bookkeeper metadata present in zookeeper.(package private) class(package private) classNuke bookkeeper metadata of existing cluster in zookeeper.(package private) classCommand to query autorecovery status.(package private) classCommand to read journal files.(package private) classCommand for reading ledger entries.(package private) classCommand to read entry log files.(package private) classCommand to print metadata of entrylog.(package private) classRebuild DbLedgerStorage locations index.(package private) classRebuild DbLedgerStorage ledgers index.(package private) classRecover command for ledger data recovery for failed bookie.(package private) classRegenerate an index file for interleaved storage.(package private) classSimple test to create a ledger and write to it.(package private) classCommand to trigger AuditTask by resetting lostBookieRecoveryDelay to its current value.(package private) classUpdate bookie into ledger command.(package private) classUpdate cookie command.(package private) classUpdate ledger command.static interfaceA facility for reporting update ledger progress.(package private) classPrints the instanceid of the cluster.(package private) classPrint which node has the auditor lock. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ServerConfiguration(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) static final String(package private) final Map<String,BookieShell.Command> (package private) static final String(package private) int(package private) static final String(package private) EntryFormatter(package private) EntryLogger(package private) File[](package private) File[](package private) File[](package private) static final String(package private) LedgerIdFormatter(package private) static final int(package private) static final org.slf4j.Logger(package private) int -
Constructor Summary
ConstructorsConstructorDescriptionBookieShell(LedgerIdFormatter ledgeridFormatter, EntryFormatter entryFormatter) -
Method Summary
Modifier and TypeMethodDescriptionintlistFilesAndSort(File[] folderNames, String... extensions) Returns the sorted list of the files in the given folders with the given file extensions.static voidprotected voidprintEntryLogMetadata(long logId) (package private) void(package private) void(package private) voidprintLedgerMetadata(long ledgerId, LedgerMetadata md, boolean printMeta) intExectue the command with given arguments.voidsetConf(org.apache.commons.configuration2.CompositeConfiguration conf) Passe a configuration object to the tool.
-
Field Details
-
LOG
static final org.slf4j.Logger LOG -
CONF_OPT
- See Also:
-
ENTRY_FORMATTER_OPT
- See Also:
-
LEDGERID_FORMATTER_OPT
- See Also:
-
CMD_METAFORMAT
- See Also:
-
CMD_INITBOOKIE
- See Also:
-
CMD_INITNEWCLUSTER
- See Also:
-
CMD_NUKEEXISTINGCLUSTER
- See Also:
-
CMD_BOOKIEFORMAT
- See Also:
-
CMD_RECOVER
- See Also:
-
CMD_LEDGER
- See Also:
-
CMD_READ_LEDGER_ENTRIES
- See Also:
-
CMD_LISTLEDGERS
- See Also:
-
CMD_LEDGERMETADATA
- See Also:
-
CMD_LISTUNDERREPLICATED
- See Also:
-
CMD_WHOISAUDITOR
- See Also:
-
CMD_WHATISINSTANCEID
- See Also:
-
CMD_SIMPLETEST
- See Also:
-
CMD_BOOKIESANITYTEST
- See Also:
-
CMD_READLOG
- See Also:
-
CMD_READLOGMETADATA
- See Also:
-
CMD_READJOURNAL
- See Also:
-
CMD_LASTMARK
- See Also:
-
CMD_AUTORECOVERY
- See Also:
-
CMD_LISTBOOKIES
- See Also:
-
CMD_LISTFILESONDISC
- See Also:
-
CMD_UPDATECOOKIE
- See Also:
-
CMD_UPDATELEDGER
- See Also:
-
CMD_UPDATE_BOOKIE_IN_LEDGER
- See Also:
-
CMD_DELETELEDGER
- See Also:
-
CMD_BOOKIEINFO
- See Also:
-
CMD_CLUSTERINFO
- See Also:
-
CMD_ACTIVE_LEDGERS_ON_ENTRY_LOG_FILE
- See Also:
-
CMD_DECOMMISSIONBOOKIE
- See Also:
-
CMD_ENDPOINTINFO
- See Also:
-
CMD_LOSTBOOKIERECOVERYDELAY
- See Also:
-
CMD_TRIGGERAUDIT
- See Also:
-
CMD_FORCEAUDITCHECKS
- See Also:
-
CMD_CONVERT_TO_DB_STORAGE
- See Also:
-
CMD_CONVERT_TO_INTERLEAVED_STORAGE
- See Also:
-
CMD_REBUILD_DB_LEDGER_LOCATIONS_INDEX
- See Also:
-
CMD_REBUILD_DB_LEDGERS_INDEX
- See Also:
-
CMD_CHECK_DB_LEDGERS_INDEX
- See Also:
-
CMD_REGENERATE_INTERLEAVED_STORAGE_INDEX_FILE
- See Also:
-
CMD_QUERY_AUTORECOVERY_STATUS
- See Also:
-
CMD_CREATE_COOKIE
- See Also:
-
CMD_DELETE_COOKIE
- See Also:
-
CMD_UPDATE_COOKIE
- See Also:
-
CMD_GET_COOKIE
- See Also:
-
CMD_GENERATE_COOKIE
- See Also:
-
CMD_HELP
- See Also:
-
CMD_LOCALCONSISTENCYCHECK
- See Also:
-
bkConf
-
indexDirectories
File[] indexDirectories -
ledgerDirectories
File[] ledgerDirectories -
journalDirectories
File[] journalDirectories -
entryLogger
EntryLogger entryLogger -
journals
-
entryFormatter
EntryFormatter entryFormatter -
ledgerIdFormatter
LedgerIdFormatter ledgerIdFormatter -
pageSize
int pageSize -
entriesPerPage
int entriesPerPage -
LIST_BATCH_SIZE
static final int LIST_BATCH_SIZE- See Also:
-
commands
-
-
Constructor Details
-
BookieShell
public BookieShell() -
BookieShell
-
-
Method Details
-
printInfoLine
-
printErrorLine
-
printLedgerMetadata
-
setConf
Description copied from interface:ToolPasse a configuration object to the tool. -
execute
- Throws:
Exception
-
run
Description copied from interface:ToolExectue the command with given arguments. -
listFilesAndSort
Returns the sorted list of the files in the given folders with the given file extensions. Sorting is done on the basis of CreationTime if the CreationTime is not available or if they are equal then sorting is done by LastModifiedTime- Parameters:
folderNames- - array of folders which we need to look recursively for files with given extensionsextensions- - the file extensions, which we are interested in- Returns:
- sorted list of files
-
main
-
printEntryLogMetadata
- Throws:
IOException
-