Class CollectInfo

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class CollectInfo
    extends alluxio.cli.AbstractShell
    Class for collecting various information about all nodes in the cluster.
    • Field Summary

      • Fields inherited from class alluxio.cli.AbstractShell

        mCloser, mConfiguration
    • Constructor Summary

      Constructors 
      Constructor Description
      CollectInfo​(alluxio.conf.AlluxioConfiguration alluxioConf)
      Creates a new instance of CollectInfo.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      static <T> java.util.concurrent.CompletableFuture<java.util.List<T>> collectAllFutures​(java.util.List<java.util.concurrent.CompletableFuture<T>> futures)
      Waits for ALL futures to complete and returns a list of results.
      java.util.Set<java.lang.String> getHosts()
      Finds all hosts in the Alluxio cluster.
      protected java.lang.String getShellName()  
      protected java.util.Map<java.lang.String,​alluxio.cli.Command> loadCommands()  
      static void main​(java.lang.String[] argv)
      Main method, starts a new CollectInfo shell.
      static void printHelp​(java.lang.String message)
      Prints the help message.
      • Methods inherited from class alluxio.cli.AbstractShell

        getCommands, printUsage, run
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CollectInfo

        public CollectInfo​(alluxio.conf.AlluxioConfiguration alluxioConf)
        Creates a new instance of CollectInfo.
        Parameters:
        alluxioConf - Alluxio configuration
    • Method Detail

      • getHosts

        public java.util.Set<java.lang.String> getHosts()
        Finds all hosts in the Alluxio cluster. We assume the masters and workers cover all the nodes in the cluster. This command now relies on conf/masters and conf/workers to contain the nodes in the cluster. This is the same requirement as bin/alluxio-start.sh. TODO(jiacheng): phase 2 specify hosts from cmdline TODO(jiacheng): phase 2 cross-check with the master for which nodes are in the cluster
        Returns:
        a set of hostnames in the cluster
      • printHelp

        public static void printHelp​(java.lang.String message)
        Prints the help message.
        Parameters:
        message - message before standard usage information
      • main

        public static void main​(java.lang.String[] argv)
                         throws java.io.IOException
        Main method, starts a new CollectInfo shell. CollectInfo will SSH to all hosts and invoke CollectInfo with --local option. Then collect the tarballs generated on each of the hosts to the localhost. And tarball all results into one final tarball.
        Parameters:
        argv - array of arguments given by the user's input from the terminal
        Throws:
        java.io.IOException
      • collectAllFutures

        public static <T> java.util.concurrent.CompletableFuture<java.util.List<T>> collectAllFutures​(java.util.List<java.util.concurrent.CompletableFuture<T>> futures)
        Waits for ALL futures to complete and returns a list of results. If any future completes exceptionally then the resulting future will also complete exceptionally.
        Type Parameters:
        T - this is the type the CompletableFuture contains
        Parameters:
        futures - a list of futures to collect
        Returns:
        a CompletableFuture of all futures
      • getShellName

        protected java.lang.String getShellName()
        Specified by:
        getShellName in class alluxio.cli.AbstractShell
      • loadCommands

        protected java.util.Map<java.lang.String,​alluxio.cli.Command> loadCommands()
        Specified by:
        loadCommands in class alluxio.cli.AbstractShell
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class alluxio.cli.AbstractShell
        Throws:
        java.io.IOException