Class SolrCLI.UtilsTool

    • Constructor Detail

      • UtilsTool

        public UtilsTool()
    • Method Detail

      • getName

        public String getName()
      • getOptions

        public org.apache.commons.cli.Option[] getOptions()
      • archiveGcLogs

        public int archiveGcLogs()
                          throws Exception
        Moves gc logs into archived/
        Returns:
        0 on success
        Throws:
        Exception - on failure
      • archiveConsoleLogs

        public int archiveConsoleLogs()
                               throws Exception
        Moves console log(s) into archiced/
        Returns:
        0 on success
        Throws:
        Exception - on failure
      • rotateSolrLogs

        public int rotateSolrLogs​(int generations)
                           throws Exception
        Rotates solr.log before starting Solr. Mimics log4j2 behavior, i.e. with generations=9:
           solr.log.9 (and higher) are deleted
           solr.log.8 -> solr.log.9
           solr.log.7 -> solr.log.8
           ...
           solr.log   -> solr.log.1
         
        Parameters:
        generations - number of generations to keep. Should agree with setting in log4j2.xml
        Returns:
        0 if success
        Throws:
        Exception - if problems
      • removeOldSolrLogs

        public int removeOldSolrLogs​(int daysToKeep)
                              throws Exception
        Deletes time-stamped old solr logs, if older than n days
        Parameters:
        daysToKeep - number of days logs to keep before deleting
        Returns:
        0 on success
        Throws:
        Exception - on failure
      • setLogPath

        public void setLogPath​(Path logsPath)
      • setServerPath

        public void setServerPath​(Path serverPath)
      • setQuiet

        public void setQuiet​(boolean shouldPrintStdout)