Class BookieShell

  • All Implemented Interfaces:
    Tool

    public class BookieShell
    extends java.lang.Object
    implements Tool
    Bookie Shell is to provide utilities for users to administer a bookkeeper cluster.
    • 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.configuration.CompositeConfiguration conf)
                     throws java.lang.Exception
        Description copied from interface: Tool
        Passe a configuration object to the tool.
        Specified by:
        setConf in interface Tool
        Parameters:
        conf - configuration object
        Throws:
        java.lang.Exception
      • 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.Exception
        Description copied from interface: Tool
        Exectue the command with given arguments.
        Specified by:
        run in interface Tool
        Parameters:
        args - command specific arguments
        Returns:
        exit code.
        Throws:
        java.lang.Exception
      • 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 extensions
        extensions - - the file extensions, which we are interested in
        Returns:
        sorted list of files
      • main

        public static void main​(java.lang.String[] argv)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • printEntryLogMetadata

        protected void printEntryLogMetadata​(long logId)
                                      throws java.io.IOException
        Throws:
        java.io.IOException