Package alluxio.cli.bundler
Class CollectInfo
- java.lang.Object
-
- alluxio.cli.AbstractShell
-
- alluxio.cli.bundler.CollectInfo
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class CollectInfo extends alluxio.cli.AbstractShellClass for collecting various information about all nodes in the cluster.
-
-
Constructor Summary
Constructors Constructor Description CollectInfo(alluxio.conf.AlluxioConfiguration alluxioConf)Creates a new instance ofCollectInfo.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()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.StringgetShellName()protected java.util.Map<java.lang.String,alluxio.cli.Command>loadCommands()static voidmain(java.lang.String[] argv)Main method, starts a new CollectInfo shell.static voidprintHelp(java.lang.String message)Prints the help message.
-
-
-
Constructor Detail
-
CollectInfo
public CollectInfo(alluxio.conf.AlluxioConfiguration alluxioConf)
Creates a new instance ofCollectInfo.- 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.IOExceptionMain method, starts a new CollectInfo shell. CollectInfo will SSH to all hosts and invokeCollectInfowith --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 theCompletableFuturecontains- Parameters:
futures- a list of futures to collect- Returns:
- a
CompletableFutureof all futures
-
getShellName
protected java.lang.String getShellName()
- Specified by:
getShellNamein classalluxio.cli.AbstractShell
-
loadCommands
protected java.util.Map<java.lang.String,alluxio.cli.Command> loadCommands()
- Specified by:
loadCommandsin classalluxio.cli.AbstractShell
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classalluxio.cli.AbstractShell- Throws:
java.io.IOException
-
-