Example usage for org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair FairSchedulerConfiguration ALLOCATION_FILE

List of usage examples for org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair FairSchedulerConfiguration ALLOCATION_FILE

Introduction

In this page you can find the example usage for org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair FairSchedulerConfiguration ALLOCATION_FILE.

Prototype

String ALLOCATION_FILE

To view the source code for org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair FairSchedulerConfiguration ALLOCATION_FILE.

Click Source Link

Usage

From source file:com.cloudera.impala.util.RequestPoolService.java

License:Apache License

/**
 * Creates a RequestPoolService instance with a configuration containing the specified
 * fair-scheduler.xml and llama-site.xml.
 *
 * @param fsAllocationPath path to the fair scheduler allocation file.
 * @param llamaSitePath path to the Llama configuration file.
 *//*from   w w  w.  j a  v a2  s  .  c o  m*/
public RequestPoolService(final String fsAllocationPath, final String llamaSitePath) {
    Preconditions.checkNotNull(fsAllocationPath);
    running_ = new AtomicBoolean(false);
    allocationConf_ = new AtomicReference<AllocationConfiguration>();
    URL fsAllocationURL = getURL(fsAllocationPath);
    if (fsAllocationURL == null) {
        throw new IllegalArgumentException("Unable to find allocation configuration file: " + fsAllocationPath);
    }
    Configuration allocConf = new Configuration(false);
    allocConf.set(FairSchedulerConfiguration.ALLOCATION_FILE, fsAllocationURL.getPath());
    allocLoader_ = new AllocationFileLoaderService();
    allocLoader_.init(allocConf);

    if (!Strings.isNullOrEmpty(llamaSitePath)) {
        llamaConfUrl_ = getURL(llamaSitePath);
        if (llamaConfUrl_ == null) {
            throw new IllegalArgumentException("Unable to find Llama configuration file: " + llamaSitePath);
        }
        llamaConf_ = new Configuration(false);
        llamaConf_.addResource(llamaConfUrl_);
        llamaConfWatcher_ = new FileWatchService(new File(llamaConfUrl_.getPath()), new LlamaConfWatcher());
    } else {
        llamaConfWatcher_ = null;
        llamaConfUrl_ = null;
    }
}

From source file:org.apache.hive.jdbc.TestSchedulerQueue.java

License:Apache License

/**
 * Verify:/*  w  w  w  .  j  a v a2  s .  c o m*/
 *  Test is running with MR2 and queue mapping are set correctly for primary group rule.
 * @throws Exception
 */
@Test
public void testFairSchedulerPrimaryQueueMapping() throws Exception {
    miniHS2.setConfProperty(FairSchedulerConfiguration.ALLOCATION_FILE, "fair-scheduler-test.xml");
    HiveTestSimpleGroupMapping.primaryTag = "-test";
    hs2Conn = DriverManager.getConnection(miniHS2.getJdbcURL(), "user2", "bar");
    verifyProperty("mapreduce.job.queuename", "root.user2" + HiveTestSimpleGroupMapping.primaryTag);
}

From source file:org.apache.hive.jdbc.TestSchedulerQueue.java

License:Apache License

/**
 * Verify:/*  w ww .j  a  v  a 2  s.  c om*/
 *  Test is running with MR2 and queue mapping are set correctly for primary group rule.
 * @throws Exception
 */
@Test
public void testFairSchedulerSecondaryQueueMapping() throws Exception {
    miniHS2.setConfProperty(FairSchedulerConfiguration.ALLOCATION_FILE, "fair-scheduler-test.xml");
    hs2Conn = DriverManager.getConnection(miniHS2.getJdbcURL(), "user3", "bar");
    verifyProperty("mapreduce.job.queuename", "root.user3-group");
}