Package org.apache.bookkeeper.bookie
Class BookieShell
- java.lang.Object
-
- org.apache.bookkeeper.bookie.BookieShell
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classBookieShell.AutoRecoveryCmdCommand for administration of autorecovery.(package private) classBookieShell.BookieFormatCmdFormats the local data present in current bookie server.(package private) classBookieShell.BookieInfoCmd(package private) classBookieShell.BookieSanityTestCmdCommand to run a bookie sanity test.(package private) classBookieShell.CheckDbLedgersIndexCmdRebuild DbLedgerStorage ledgers index.(package private) classBookieShell.ClusterInfoCmdstatic interfaceBookieShell.CommandBookieShell command.(package private) classBookieShell.ConvertToDbStorageCmdConvert bookie indexes from InterleavedStorage to DbLedgerStorage format.(package private) classBookieShell.ConvertToInterleavedStorageCmdConvert bookie indexes from DbLedgerStorage to InterleavedStorage format.(package private) classBookieShell.DecommissionBookieCmdCommand 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) classBookieShell.DeleteLedgerCmdCommand to delete a given ledger.(package private) classBookieShell.EndpointInfoCmdCommand to retrieve remote bookie endpoint information.(package private) classBookieShell.ForceAuditorChecksCmd(package private) classBookieShell.HelpCmdCommand to print help message.(package private) classBookieShell.InitBookieCmdInitializes bookie, by making sure that the journalDir, ledgerDirs and indexDirs are empty and there is no registered Bookie with this BookieId.(package private) classBookieShell.InitNewClusterInitializes new cluster by creating required znodes for the cluster.(package private) classBookieShell.LastMarkCmdCommand to print last log mark.(package private) classBookieShell.LedgerCmdLedger Command Handles ledger related operations.(package private) classBookieShell.LedgerMetadataCmdPrint the metadata for a ledger.(package private) classBookieShell.ListActiveLedgersCmdList active ledgers on entry log file.(package private) classBookieShell.ListBookiesCmdList available bookies.(package private) classBookieShell.ListDiskFilesCmd(package private) classBookieShell.ListLedgersCmdCommand to list all ledgers in the cluster.(package private) classBookieShell.ListUnderreplicatedCmdCommand for listing underreplicated ledgers.(package private) classBookieShell.LocalConsistencyCheckCheck local storage for inconsistencies.(package private) classBookieShell.LostBookieRecoveryDelayCmdSetter and Getter for LostBookieRecoveryDelay value (in seconds) in metadata store.(package private) classBookieShell.MetaFormatCmdFormat the bookkeeper metadata present in zookeeper.(package private) classBookieShell.MyCommand(package private) classBookieShell.NukeExistingClusterNuke bookkeeper metadata of existing cluster in zookeeper.(package private) classBookieShell.QueryAutoRecoveryStatusCmdCommand to query autorecovery status.(package private) classBookieShell.ReadJournalCmdCommand to read journal files.(package private) classBookieShell.ReadLedgerEntriesCmdCommand for reading ledger entries.(package private) classBookieShell.ReadLogCmdCommand to read entry log files.(package private) classBookieShell.ReadLogMetadataCmdCommand to print metadata of entrylog.(package private) classBookieShell.RebuildDbLedgerLocationsIndexCmdRebuild DbLedgerStorage locations index.(package private) classBookieShell.RebuildDbLedgersIndexCmdRebuild DbLedgerStorage ledgers index.(package private) classBookieShell.RecoverCmdRecover command for ledger data recovery for failed bookie.(package private) classBookieShell.RegenerateInterleavedStorageIndexFileRegenerate an index file for interleaved storage.(package private) classBookieShell.SimpleTestCmdSimple test to create a ledger and write to it.(package private) classBookieShell.TriggerAuditCmdCommand to trigger AuditTask by resetting lostBookieRecoveryDelay to its current value.(package private) classBookieShell.UpdateBookieInLedgerCmdUpdate bookie into ledger command.(package private) classBookieShell.UpdateCookieCmdUpdate cookie command.(package private) classBookieShell.UpdateLedgerCmdUpdate ledger command.static interfaceBookieShell.UpdateLedgerNotifierA facility for reporting update ledger progress.(package private) classBookieShell.WhatIsInstanceIdPrints the instanceid of the cluster.(package private) classBookieShell.WhoIsAuditorCmdPrint which node has the auditor lock.
-
Field Summary
Fields Modifier and Type Field Description (package private) ServerConfigurationbkConf(package private) static java.lang.StringCMD_ACTIVE_LEDGERS_ON_ENTRY_LOG_FILE(package private) static java.lang.StringCMD_AUTORECOVERY(package private) static java.lang.StringCMD_BOOKIEFORMAT(package private) static java.lang.StringCMD_BOOKIEINFO(package private) static java.lang.StringCMD_BOOKIESANITYTEST(package private) static java.lang.StringCMD_CHECK_DB_LEDGERS_INDEX(package private) static java.lang.StringCMD_CLUSTERINFO(package private) static java.lang.StringCMD_CONVERT_TO_DB_STORAGE(package private) static java.lang.StringCMD_CONVERT_TO_INTERLEAVED_STORAGE(package private) static java.lang.StringCMD_CREATE_COOKIE(package private) static java.lang.StringCMD_DECOMMISSIONBOOKIE(package private) static java.lang.StringCMD_DELETE_COOKIE(package private) static java.lang.StringCMD_DELETELEDGER(package private) static java.lang.StringCMD_ENDPOINTINFO(package private) static java.lang.StringCMD_FORCEAUDITCHECKS(package private) static java.lang.StringCMD_GENERATE_COOKIE(package private) static java.lang.StringCMD_GET_COOKIE(package private) static java.lang.StringCMD_HELP(package private) static java.lang.StringCMD_INITBOOKIE(package private) static java.lang.StringCMD_INITNEWCLUSTER(package private) static java.lang.StringCMD_LASTMARK(package private) static java.lang.StringCMD_LEDGER(package private) static java.lang.StringCMD_LEDGERMETADATA(package private) static java.lang.StringCMD_LISTBOOKIES(package private) static java.lang.StringCMD_LISTFILESONDISC(package private) static java.lang.StringCMD_LISTLEDGERS(package private) static java.lang.StringCMD_LISTUNDERREPLICATED(package private) static java.lang.StringCMD_LOCALCONSISTENCYCHECK(package private) static java.lang.StringCMD_LOSTBOOKIERECOVERYDELAY(package private) static java.lang.StringCMD_METAFORMAT(package private) static java.lang.StringCMD_NUKEEXISTINGCLUSTER(package private) static java.lang.StringCMD_QUERY_AUTORECOVERY_STATUS(package private) static java.lang.StringCMD_READ_LEDGER_ENTRIES(package private) static java.lang.StringCMD_READJOURNAL(package private) static java.lang.StringCMD_READLOG(package private) static java.lang.StringCMD_READLOGMETADATA(package private) static java.lang.StringCMD_REBUILD_DB_LEDGER_LOCATIONS_INDEX(package private) static java.lang.StringCMD_REBUILD_DB_LEDGERS_INDEX(package private) static java.lang.StringCMD_RECOVER(package private) static java.lang.StringCMD_REGENERATE_INTERLEAVED_STORAGE_INDEX_FILE(package private) static java.lang.StringCMD_SIMPLETEST(package private) static java.lang.StringCMD_TRIGGERAUDIT(package private) static java.lang.StringCMD_UPDATE_BOOKIE_IN_LEDGER(package private) static java.lang.StringCMD_UPDATE_COOKIE(package private) static java.lang.StringCMD_UPDATECOOKIE(package private) static java.lang.StringCMD_UPDATELEDGER(package private) static java.lang.StringCMD_WHATISINSTANCEID(package private) static java.lang.StringCMD_WHOISAUDITOR(package private) java.util.Map<java.lang.String,BookieShell.Command>commands(package private) static java.lang.StringCONF_OPT(package private) intentriesPerPage(package private) static java.lang.StringENTRY_FORMATTER_OPT(package private) EntryFormatterentryFormatter(package private) EntryLoggerentryLogger(package private) java.io.File[]indexDirectories(package private) java.io.File[]journalDirectories(package private) java.util.List<Journal>journals(package private) java.io.File[]ledgerDirectories(package private) static java.lang.StringLEDGERID_FORMATTER_OPT(package private) LedgerIdFormatterledgerIdFormatter(package private) static intLIST_BATCH_SIZE(package private) static org.slf4j.LoggerLOG(package private) intpageSize
-
Constructor Summary
Constructors Constructor Description BookieShell()BookieShell(LedgerIdFormatter ledgeridFormatter, EntryFormatter entryFormatter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intexecute(java.lang.String... args)static java.util.List<java.io.File>listFilesAndSort(java.io.File[] folderNames, java.lang.String... extensions)Returns the sorted list of the files in the given folders with the given file extensions.static voidmain(java.lang.String[] argv)protected voidprintEntryLogMetadata(long logId)(package private) voidprintErrorLine(java.lang.String s)(package private) voidprintInfoLine(java.lang.String s)(package private) voidprintLedgerMetadata(long ledgerId, LedgerMetadata md, boolean printMeta)intrun(java.lang.String[] args)Exectue the command with given arguments.voidsetConf(org.apache.commons.configuration2.CompositeConfiguration conf)Passe a configuration object to the tool.
-
-
-
Field Detail
-
LOG
static final org.slf4j.Logger LOG
-
CONF_OPT
static final java.lang.String CONF_OPT
- See Also:
- Constant Field Values
-
ENTRY_FORMATTER_OPT
static final java.lang.String ENTRY_FORMATTER_OPT
- See Also:
- Constant Field Values
-
LEDGERID_FORMATTER_OPT
static final java.lang.String LEDGERID_FORMATTER_OPT
- See Also:
- Constant Field Values
-
CMD_METAFORMAT
static final java.lang.String CMD_METAFORMAT
- See Also:
- Constant Field Values
-
CMD_INITBOOKIE
static final java.lang.String CMD_INITBOOKIE
- See Also:
- Constant Field Values
-
CMD_INITNEWCLUSTER
static final java.lang.String CMD_INITNEWCLUSTER
- See Also:
- Constant Field Values
-
CMD_NUKEEXISTINGCLUSTER
static final java.lang.String CMD_NUKEEXISTINGCLUSTER
- See Also:
- Constant Field Values
-
CMD_BOOKIEFORMAT
static final java.lang.String CMD_BOOKIEFORMAT
- See Also:
- Constant Field Values
-
CMD_RECOVER
static final java.lang.String CMD_RECOVER
- See Also:
- Constant Field Values
-
CMD_LEDGER
static final java.lang.String CMD_LEDGER
- See Also:
- Constant Field Values
-
CMD_READ_LEDGER_ENTRIES
static final java.lang.String CMD_READ_LEDGER_ENTRIES
- See Also:
- Constant Field Values
-
CMD_LISTLEDGERS
static final java.lang.String CMD_LISTLEDGERS
- See Also:
- Constant Field Values
-
CMD_LEDGERMETADATA
static final java.lang.String CMD_LEDGERMETADATA
- See Also:
- Constant Field Values
-
CMD_LISTUNDERREPLICATED
static final java.lang.String CMD_LISTUNDERREPLICATED
- See Also:
- Constant Field Values
-
CMD_WHOISAUDITOR
static final java.lang.String CMD_WHOISAUDITOR
- See Also:
- Constant Field Values
-
CMD_WHATISINSTANCEID
static final java.lang.String CMD_WHATISINSTANCEID
- See Also:
- Constant Field Values
-
CMD_SIMPLETEST
static final java.lang.String CMD_SIMPLETEST
- See Also:
- Constant Field Values
-
CMD_BOOKIESANITYTEST
static final java.lang.String CMD_BOOKIESANITYTEST
- See Also:
- Constant Field Values
-
CMD_READLOG
static final java.lang.String CMD_READLOG
- See Also:
- Constant Field Values
-
CMD_READLOGMETADATA
static final java.lang.String CMD_READLOGMETADATA
- See Also:
- Constant Field Values
-
CMD_READJOURNAL
static final java.lang.String CMD_READJOURNAL
- See Also:
- Constant Field Values
-
CMD_LASTMARK
static final java.lang.String CMD_LASTMARK
- See Also:
- Constant Field Values
-
CMD_AUTORECOVERY
static final java.lang.String CMD_AUTORECOVERY
- See Also:
- Constant Field Values
-
CMD_LISTBOOKIES
static final java.lang.String CMD_LISTBOOKIES
- See Also:
- Constant Field Values
-
CMD_LISTFILESONDISC
static final java.lang.String CMD_LISTFILESONDISC
- See Also:
- Constant Field Values
-
CMD_UPDATECOOKIE
static final java.lang.String CMD_UPDATECOOKIE
- See Also:
- Constant Field Values
-
CMD_UPDATELEDGER
static final java.lang.String CMD_UPDATELEDGER
- See Also:
- Constant Field Values
-
CMD_UPDATE_BOOKIE_IN_LEDGER
static final java.lang.String CMD_UPDATE_BOOKIE_IN_LEDGER
- See Also:
- Constant Field Values
-
CMD_DELETELEDGER
static final java.lang.String CMD_DELETELEDGER
- See Also:
- Constant Field Values
-
CMD_BOOKIEINFO
static final java.lang.String CMD_BOOKIEINFO
- See Also:
- Constant Field Values
-
CMD_CLUSTERINFO
static final java.lang.String CMD_CLUSTERINFO
- See Also:
- Constant Field Values
-
CMD_ACTIVE_LEDGERS_ON_ENTRY_LOG_FILE
static final java.lang.String CMD_ACTIVE_LEDGERS_ON_ENTRY_LOG_FILE
- See Also:
- Constant Field Values
-
CMD_DECOMMISSIONBOOKIE
static final java.lang.String CMD_DECOMMISSIONBOOKIE
- See Also:
- Constant Field Values
-
CMD_ENDPOINTINFO
static final java.lang.String CMD_ENDPOINTINFO
- See Also:
- Constant Field Values
-
CMD_LOSTBOOKIERECOVERYDELAY
static final java.lang.String CMD_LOSTBOOKIERECOVERYDELAY
- See Also:
- Constant Field Values
-
CMD_TRIGGERAUDIT
static final java.lang.String CMD_TRIGGERAUDIT
- See Also:
- Constant Field Values
-
CMD_FORCEAUDITCHECKS
static final java.lang.String CMD_FORCEAUDITCHECKS
- See Also:
- Constant Field Values
-
CMD_CONVERT_TO_DB_STORAGE
static final java.lang.String CMD_CONVERT_TO_DB_STORAGE
- See Also:
- Constant Field Values
-
CMD_CONVERT_TO_INTERLEAVED_STORAGE
static final java.lang.String CMD_CONVERT_TO_INTERLEAVED_STORAGE
- See Also:
- Constant Field Values
-
CMD_REBUILD_DB_LEDGER_LOCATIONS_INDEX
static final java.lang.String CMD_REBUILD_DB_LEDGER_LOCATIONS_INDEX
- See Also:
- Constant Field Values
-
CMD_REBUILD_DB_LEDGERS_INDEX
static final java.lang.String CMD_REBUILD_DB_LEDGERS_INDEX
- See Also:
- Constant Field Values
-
CMD_CHECK_DB_LEDGERS_INDEX
static final java.lang.String CMD_CHECK_DB_LEDGERS_INDEX
- See Also:
- Constant Field Values
-
CMD_REGENERATE_INTERLEAVED_STORAGE_INDEX_FILE
static final java.lang.String CMD_REGENERATE_INTERLEAVED_STORAGE_INDEX_FILE
- See Also:
- Constant Field Values
-
CMD_QUERY_AUTORECOVERY_STATUS
static final java.lang.String CMD_QUERY_AUTORECOVERY_STATUS
- See Also:
- Constant Field Values
-
CMD_CREATE_COOKIE
static final java.lang.String CMD_CREATE_COOKIE
- See Also:
- Constant Field Values
-
CMD_DELETE_COOKIE
static final java.lang.String CMD_DELETE_COOKIE
- See Also:
- Constant Field Values
-
CMD_UPDATE_COOKIE
static final java.lang.String CMD_UPDATE_COOKIE
- See Also:
- Constant Field Values
-
CMD_GET_COOKIE
static final java.lang.String CMD_GET_COOKIE
- See Also:
- Constant Field Values
-
CMD_GENERATE_COOKIE
static final java.lang.String CMD_GENERATE_COOKIE
- See Also:
- Constant Field Values
-
CMD_HELP
static final java.lang.String CMD_HELP
- See Also:
- Constant Field Values
-
CMD_LOCALCONSISTENCYCHECK
static final java.lang.String CMD_LOCALCONSISTENCYCHECK
- See Also:
- Constant Field Values
-
bkConf
final ServerConfiguration bkConf
-
indexDirectories
java.io.File[] indexDirectories
-
ledgerDirectories
java.io.File[] ledgerDirectories
-
journalDirectories
java.io.File[] journalDirectories
-
entryLogger
EntryLogger entryLogger
-
journals
java.util.List<Journal> journals
-
entryFormatter
EntryFormatter entryFormatter
-
ledgerIdFormatter
LedgerIdFormatter ledgerIdFormatter
-
pageSize
int pageSize
-
entriesPerPage
int entriesPerPage
-
LIST_BATCH_SIZE
static final int LIST_BATCH_SIZE
- See Also:
- Constant Field Values
-
commands
final java.util.Map<java.lang.String,BookieShell.Command> commands
-
-
Constructor Detail
-
BookieShell
public BookieShell()
-
BookieShell
public BookieShell(LedgerIdFormatter ledgeridFormatter, EntryFormatter entryFormatter)
-
-
Method Detail
-
printInfoLine
void printInfoLine(java.lang.String s)
-
printErrorLine
void printErrorLine(java.lang.String s)
-
printLedgerMetadata
void printLedgerMetadata(long ledgerId, LedgerMetadata md, boolean printMeta)
-
setConf
public void setConf(org.apache.commons.configuration2.CompositeConfiguration conf) throws java.lang.ExceptionDescription copied from interface:ToolPasse a configuration object to the tool.
-
execute
public int execute(java.lang.String... args) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
public int run(java.lang.String[] args) throws java.lang.ExceptionDescription copied from interface:ToolExectue the command with given arguments.
-
listFilesAndSort
public static java.util.List<java.io.File> listFilesAndSort(java.io.File[] folderNames, java.lang.String... extensions)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
public static void main(java.lang.String[] argv)
-
printEntryLogMetadata
protected void printEntryLogMetadata(long logId) throws java.io.IOException- Throws:
java.io.IOException
-
-