use of org.apache.hadoop.mapred.LocalJobRunner in project hadoop by apache.
the class TestClientProtocolProviderImpls method testClusterWithLocalClientProvider.
@Test
public void testClusterWithLocalClientProvider() throws Exception {
Configuration conf = new Configuration();
conf.set(MRConfig.FRAMEWORK_NAME, "local");
Cluster cluster = new Cluster(conf);
assertTrue(cluster.getClient() instanceof LocalJobRunner);
cluster.close();
}
use of org.apache.hadoop.mapred.LocalJobRunner in project hadoop by apache.
the class TestYarnClientProtocolProvider method testClusterWithYarnClientProtocolProvider.
@Test
public void testClusterWithYarnClientProtocolProvider() throws Exception {
Configuration conf = new Configuration(false);
Cluster cluster = null;
try {
cluster = new Cluster(conf);
} catch (Exception e) {
throw new Exception("Failed to initialize a local runner w/o a cluster framework key", e);
}
try {
assertTrue("client is not a LocalJobRunner", cluster.getClient() instanceof LocalJobRunner);
} finally {
if (cluster != null) {
cluster.close();
}
}
try {
conf = new Configuration();
conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
cluster = new Cluster(conf);
ClientProtocol client = cluster.getClient();
assertTrue("client is a YARNRunner", client instanceof YARNRunner);
} catch (IOException e) {
} finally {
if (cluster != null) {
cluster.close();
}
}
}
Aggregations