List of usage examples for org.apache.hadoop.yarn.conf YarnConfiguration setInt
public void setInt(String name, int value)
name
property to an int
. From source file:org.testifyproject.resource.yarn.MiniYarnResource.java
License:Apache License
@Override public YarnConfiguration configure(TestContext testContext, LocalResource localResource, PropertiesReader configReader) { String testName = testContext.getName(); String logDirectory = fileSystemUtil.createPath("target", "yarn", testName); YarnConfiguration configuration = new YarnConfiguration(); configuration.set(YarnConfiguration.YARN_APP_CONTAINER_LOG_DIR, logDirectory); configuration.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 64); configuration.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class); return configuration; }
From source file:probos.TestEndToEnd.java
License:Open Source License
@Before public void setupCluster() throws Exception { System.setProperty("probos.home", System.getProperty("user.dir")); (probosJobDir = new File(System.getProperty("user.dir"), "probos")).mkdir(); String name = "mycluster"; int noOfNodeManagers = 1; int numLocalDirs = 1; int numLogDirs = 1; YarnConfiguration conf = new YarnConfiguration(); conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 64); conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class); miniCluster = new MiniYARNCluster(name, noOfNodeManagers, numLocalDirs, numLogDirs); miniCluster.init(conf);/*from w ww . java2 s . c om*/ miniCluster.start(); //once the cluster is created, you can get its configuration //with the binding details to the cluster added from the minicluster YarnConfiguration appConf = new YarnConfiguration(miniCluster.getConfig()); cs = new ControllerServer(appConf); cs.startAndWait(); Thread.sleep(1000); new pbsnodes().run(new String[0]); }
From source file:probos.TestProblem.java
License:Open Source License
@Before public void setupCluster() throws Exception { String name = "mycluster"; int noOfNodeManagers = 1; int numLocalDirs = 1; int numLogDirs = 1; YarnConfiguration conf = new YarnConfiguration(); conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 64); conf.setClass(YarnConfiguration.RM_SCHEDULER, FifoScheduler.class, ResourceScheduler.class); miniCluster = new MiniYARNCluster(name, noOfNodeManagers, numLocalDirs, numLogDirs); miniCluster.init(conf);/* w w w.j a v a 2 s. c om*/ miniCluster.start(); //once the cluster is created, you can get its configuration //with the binding details to the cluster added from the minicluster yConf = new YarnConfiguration(miniCluster.getConfig()); }