public class HadoopHelper extends Object
HadoopDescription to manage a hadoop cluster.
Methods are thread-safe but not distributed-thread-safe, so must be called
by a single hydra client JVM to avoid problems at the hadoop cluster level.| Modifier and Type | Field and Description |
|---|---|
static String |
GFXD_SECURE_KEYTAB_FILE |
static String |
HDFS_SECURE_KEYTAB_FILE |
static String |
MAPRED_SECURE_KEYTAB_FILE |
static String |
YARN_SECURE_KEYTAB_FILE |
| Constructor and Description |
|---|
HadoopHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configureHadoop(String hadoopConfig)
Builds the Hadoop configuration files for the given cluster configuration.
|
static void |
configureHDFS(String hadoopConfig)
Builds the Hadoop configuration files for the given cluster configuration.
|
static void |
executeHadoopCommand(String host,
HadoopDescription hdd,
String command,
String outfn)
Executes a Hadoop command on a given host using the given HadoopDescription from
HadoopPrms.names. |
static void |
executeHadoopCommand(String host,
String hadoopConfig,
String command,
String outfn)
Executes a Hadoop command on given host using the given cluster configuration from
HadoopPrms.names. |
static void |
executeKdestroyCommand(String host,
int maxWaitSec)
Executes "kdestroy" on the specified host.
|
static void |
executeKinitCommand(String host,
String command,
int maxWaitSec)
Executes "kinit" on the given command on the specified host.
|
static void |
formatNameNode(String hadoopConfig,
String host)
Formats the Hadoop NameNode on the given host using the given node
configuration.
|
static void |
formatNameNodes(String hadoopConfig)
Formats Hadoop NameNodes using the given cluster configuration.
|
static HadoopDescription |
getHadoopDescription(String hadoopConfig)
Returns the
HadoopDescription for the given cluster configuration. |
static void |
runHadoopCommand(HadoopDescription hdd,
String command,
String outfn)
Runs a Hadoop command using the given HadoopDescription from
HadoopPrms.names. |
static void |
runHadoopCommand(String hadoopConfig,
String command,
String outfn)
Runs a Hadoop command using the given cluster configuration from
HadoopPrms.names. |
static void |
runYarnCommand(String hadoopConfig,
String command,
String outfn)
Runs a YARN command using the given cluster configuration from
HadoopPrms.names. |
static void |
startCluster(String hadoopConfig)
Starts the Hadoop cluster using the given cluster configuration.
|
static void |
startDataNode(HadoopDescription hdd,
HadoopDescription.NodeDescription nd)
Starts the Hadoop DataNode using the given node configuration.
|
static void |
startDataNode(String hadoopConfig,
String host)
Starts the Hadoop DataNode on the given host using the given cluster
configuration.
|
static void |
startDataNodes(List<HadoopInfo> hadoops)
Starts all data nodes in the given list of configurations.
|
static void |
startDataNodes(String hadoopConfig)
Starts Hadoop DataNodes using the given cluster configuration.
|
static void |
startHadoopProcess(HadoopDescription hdd,
HadoopDescription.NodeDescription nd)
Starts the Hadoop process using the given node configuration.
|
static void |
startHadoopProcesses(List<HadoopInfo> hadoops)
Starts all Hadoop process using the given list of configurations.
|
static void |
startHDFSCluster(String hadoopConfig)
Starts the HDFS cluster using the given cluster configuration.
|
static void |
startNameNode(HadoopDescription hdd,
HadoopDescription.NodeDescription nd)
Starts the Hadoop NameNode using the given node configuration.
|
static void |
startNameNode(String hadoopConfig,
String host)
Starts the Hadoop NameNode on the given host using the given cluster
configuration.
|
static void |
startNameNodes(List<HadoopInfo> hadoops)
Starts all name nodes in the given list of configurations.
|
static void |
startNameNodes(String hadoopConfig)
Starts Hadoop NameNodes using the given cluster configuration.
|
static void |
startNodeManager(HadoopDescription hdd,
HadoopDescription.NodeDescription nd)
Starts the YARN NodeManager using the given node configuration.
|
static void |
startNodeManager(String hadoopConfig,
String host)
Starts the YARN NodeManager on the given host using the given cluster
configuration.
|
static void |
startNodeManagers(List<HadoopInfo> hadoops)
Starts all node managers in the given list of configurations.
|
static void |
startNodeManagers(String hadoopConfig)
Starts YARN NodeManagers using the given cluster configuration.
|
static void |
startResourceManager(HadoopDescription hdd,
HadoopDescription.NodeDescription nd)
Starts the YARN ResourceManager using the given node configuration.
|
static void |
startResourceManager(String hadoopConfig)
Starts the YARN ResourceManager using the given cluster configuration.
|
static void |
startResourceManager(String hadoopConfig,
String host)
Starts the YARN ResourceManager on the given host using the given cluster
configuration.
|
static void |
startResourceManagers(List<HadoopInfo> hadoops)
Starts all resource managers in the given list of configurations.
|
static void |
stopCluster(String hadoopConfig)
Stops the Hadoop cluster using the given cluster configuration, as found
in
HadoopPrms.names. |
static void |
stopDataNode(String hadoopConfig,
String host)
Stops the Hadoop DataNode on the given host using the given cluster
configuration, as found in
HadoopPrms.names. |
static void |
stopDataNodes(String hadoopConfig)
Stops Hadoop DataNodes using the given cluster configuration, as found in
HadoopPrms.names. |
static void |
stopHDFSCluster(String hadoopConfig)
Stops the HDFS cluster using the given cluster configuration, as found
in
HadoopPrms.names. |
static void |
stopNameNode(String hadoopConfig,
String host)
Stops the Hadoop NameNode on the given host using the given cluster
configuration, as found in
HadoopPrms.names. |
static void |
stopNameNodes(String hadoopConfig)
Stops the Hadoop NameNodes using the given cluster configuration, as found
in
HadoopPrms.names. |
static void |
stopNodeManager(String hadoopConfig,
String host)
Starts the YARN NodeManager on the given host using the given cluster
configuration, as found in
HadoopPrms.names. |
static void |
stopNodeManagers(String hadoopConfig)
Stops YARN NodeManagers using the given cluster configuration, as found in
HadoopPrms.names. |
static void |
stopResourceManager(String hadoopConfig)
Stops the YARN ResourceManager using the given cluster configuration, as
found in
HadoopPrms.names. |
static void |
stopResourceManager(String hadoopConfig,
String host)
Stops the YARN ResourceManager on the given host using the given cluster
configuration, as found in
HadoopPrms.names. |
public static final String GFXD_SECURE_KEYTAB_FILE
public static final String HDFS_SECURE_KEYTAB_FILE
public static final String MAPRED_SECURE_KEYTAB_FILE
public static final String YARN_SECURE_KEYTAB_FILE
public static void configureHadoop(String hadoopConfig)
HadoopDescription corresponding to the
cluster configuration from HadoopPrms.names.
The files are placed in the test directory in a subdirectory named for
the cluster, node type, and host. For example:
mycluster_DataNode_w2-2013-lin-08_conf
The subdirectory includes generated configuration files such as
hadoop-env.sh and slaves, and other files that are copied from
$JTESTS/hydra/hadoop/conf.
public static void configureHDFS(String hadoopConfig)
HadoopDescription corresponding to the
cluster configuration from HadoopPrms.names.
The files are placed in the test directory in a subdirectory named for
the cluster, node type, and host. For example:
mycluster_DataNode_w2-2013-lin-08_conf
The subdirectory includes generated configuration files such as
hadoop-env.sh and slaves, and other files that are copied from
$JTESTS/hydra/hadoop/conf.
public static void startCluster(String hadoopConfig)
The cluster is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void stopCluster(String hadoopConfig)
HadoopPrms.names.public static void startHDFSCluster(String hadoopConfig)
The cluster is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void stopHDFSCluster(String hadoopConfig)
HadoopPrms.names.public static void formatNameNodes(String hadoopConfig)
The nodes are configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void formatNameNode(String hadoopConfig, String host)
The node is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startNameNodes(String hadoopConfig)
The nodes are configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startNameNode(String hadoopConfig, String host)
The node is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startNameNode(HadoopDescription hdd, HadoopDescription.NodeDescription nd)
public static void stopNameNodes(String hadoopConfig)
HadoopPrms.names.public static void stopNameNode(String hadoopConfig, String host)
HadoopPrms.names.public static void startDataNodes(String hadoopConfig)
The nodes are configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startDataNode(String hadoopConfig, String host)
The node is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startDataNode(HadoopDescription hdd, HadoopDescription.NodeDescription nd)
public static void stopDataNodes(String hadoopConfig)
HadoopPrms.names.public static void stopDataNode(String hadoopConfig, String host)
HadoopPrms.names.public static void startResourceManager(String hadoopConfig)
The manager is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startResourceManager(String hadoopConfig, String host)
The manager is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startResourceManager(HadoopDescription hdd, HadoopDescription.NodeDescription nd)
public static void stopResourceManager(String hadoopConfig)
HadoopPrms.names.public static void stopResourceManager(String hadoopConfig, String host)
HadoopPrms.names.public static void startNodeManagers(String hadoopConfig)
The managers are configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startNodeManager(String hadoopConfig, String host)
The node is configured using the HadoopDescription
corresponding to the cluster configuration from HadoopPrms.names.
public static void startNodeManager(HadoopDescription hdd, HadoopDescription.NodeDescription nd)
public static void stopNodeManagers(String hadoopConfig)
HadoopPrms.names.public static void stopNodeManager(String hadoopConfig, String host)
HadoopPrms.names.public static void startHadoopProcesses(List<HadoopInfo> hadoops)
RebootMgr API. It is up to
the test to use this method in a thread-safe and timely fashion.public static void startNameNodes(List<HadoopInfo> hadoops)
RebootMgr API. It is up to
the test to use this method in a thread-safe and timely fashion.public static void startDataNodes(List<HadoopInfo> hadoops)
RebootMgr API. It is up to
the test to use this method in a thread-safe and timely fashion.public static void startResourceManagers(List<HadoopInfo> hadoops)
RebootMgr API. It is up to
the test to use this method in a thread-safe and timely fashion.public static void startNodeManagers(List<HadoopInfo> hadoops)
RebootMgr API. It is up to
the test to use this method in a thread-safe and timely fashion.public static void startHadoopProcess(HadoopDescription hdd, HadoopDescription.NodeDescription nd)
RebootMgr API. It is up to
the test to use this method in a thread-safe and timely fashion.public static void runHadoopCommand(String hadoopConfig, String command, String outfn)
HadoopPrms.names. Writes the output to the specified file name.public static void runHadoopCommand(HadoopDescription hdd, String command, String outfn)
HadoopPrms.names. Writes the output to the specified file name.public static void executeHadoopCommand(String host, String hadoopConfig, String command, String outfn)
HadoopPrms.names. Writes the output to the specified file name.public static void executeHadoopCommand(String host, HadoopDescription hdd, String command, String outfn)
HadoopPrms.names. Writes the output to the specified file name.public static void runYarnCommand(String hadoopConfig, String command, String outfn)
HadoopPrms.names. Writes the output to the specified file name.public static HadoopDescription getHadoopDescription(String hadoopConfig)
HadoopDescription for the given cluster configuration.public static void executeKinitCommand(String host, String command, int maxWaitSec)
public static void executeKdestroyCommand(String host, int maxWaitSec)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.