Package org.apache.hadoop.util

Examples of org.apache.hadoop.util.HostsFileReader


    // on startup, and can delete any files that we're done with
    this.conf = conf;
    JobConf jobConf = new JobConf(conf);

    // Read the hosts/exclude files to restrict access to the jobtracker.
    this.hostsReader = new HostsFileReader(conf.get("mapred.hosts", ""),
                                           conf.get("mapred.hosts.exclude", ""));
                                          
    // Set ports, start RPC servers, etc.
    InetSocketAddress addr = getAddress(conf);
    this.localMachine = addr.getHostName();
View Full Code Here


    // Same with 'localDir' except it's always on the local disk.
    jobConf.deleteLocalFiles(SUBDIR);

    // Read the hosts/exclude files to restrict access to the jobtracker.
    this.hostsReader = new HostsFileReader(conf.get("mapred.hosts", ""),
                                           conf.get("mapred.hosts.exclude", ""));
                                          
    // Set ports, start RPC servers, etc.
    InetSocketAddress addr = getAddress(conf);
    this.localMachine = addr.getHostName();
View Full Code Here

    JobConf jobConf = new JobConf(conf);

    initializeTaskMemoryRelatedConfig();

    // Read the hosts/exclude files to restrict access to the jobtracker.
    this.hostsReader = new HostsFileReader(conf.get("mapred.hosts", ""),
                                           conf.get("mapred.hosts.exclude", ""));

    Configuration queuesConf = new Configuration(this.conf);
    queueManager = new QueueManager(queuesConf);
View Full Code Here

    TTMover mover = new TTMoverTestStub(TEST_ROOT_DIR.toString());
    mover.setConf(conf);

    mover.addHostToFile(hosts.getAbsolutePath(), "host3.host.com");
    HostsFileReader reader =
            new HostsFileReader(hosts.getAbsolutePath(), hosts.getAbsolutePath());
    System.out.println(reader.getHosts().toString());
    assertEquals(3, reader.getHosts().size());

    mover.removeHostFromFile(hosts.getAbsolutePath(), "host1.host.com");

    reader.refresh();
    assertEquals(2, reader.getHosts().size());

    mover.restoreFile(hosts.getAbsolutePath());

    reader.refresh();
    assertEquals(2, reader.getHosts().size());

    assertTrue(reader.getHosts().contains("host1.host.com"));
    assertFalse(reader.getHosts().contains("host3.host.com"));
  }
View Full Code Here

    TTMoverTestStub mover = new TTMoverTestStub(TEST_ROOT_DIR.toString());
    mover.setConf(conf);
    mover.run(new String[]{"-remove", "host1"});

    HostsFileReader reader =
            new HostsFileReader(hostsInclude.getAbsolutePath(),
            hostsExclude.getAbsolutePath());
    assertTrue(reader.getExcludedHosts().contains("host1"));

    assertTrue(reader.getHosts().contains("host2"));
    assertFalse(reader.getHosts().contains("host1"));
  }
View Full Code Here

    writer = new FileWriter(hostsExclude);
    writer.write("host3\n");
    writer.close();

    HostsFileReader reader =
            new HostsFileReader(hostsInclude.getAbsolutePath(),
            hostsExclude.getAbsolutePath());

    assertEquals(2, reader.getHosts().size());
   
    TTMoverTestStub mover = new TTMoverTestStub(TEST_ROOT_DIR.toString());
    mover.setConf(conf);
    mover.run(new String[]{"-add", "host3"});

    reader.refresh();
    assertFalse(reader.getExcludedHosts().contains("host3"));

    assertTrue(reader.getHosts().contains("host3"));
   
  }
View Full Code Here

  public static class NodeManagerTestable extends NodeManager {
    public NodeManagerTestable(
        ClusterManager clusterManager, CoronaConf conf) throws IOException {
      super(clusterManager,
        new HostsFileReader(conf.getHostsFile(), conf.getExcludesFile()));
    }
View Full Code Here

    JobConf jobConf = new JobConf(conf);

    initializeTaskMemoryRelatedConfig();

    // Read the hosts/exclude files to restrict access to the jobtracker.
    this.hostsReader = new HostsFileReader(conf.get("mapred.hosts", ""),
                                           conf.get("mapred.hosts.exclude", ""));

    Configuration queuesConf = new Configuration(this.conf);
    queueManager = new QueueManager(queuesConf);
View Full Code Here

    overreplthread.start();
    raidEncodingTaskThread.start();
   

    this.hostsReader =
      new HostsFileReader(
        conf.get(FSConstants.DFS_HOSTS, ""),
        conf.get("dfs.hosts.exclude", ""),
        !conf.getBoolean("dfs.hosts.ignoremissing", false));

    this.dnthread = new Daemon(new DecommissionManager(this).new Monitor(
View Full Code Here

   * @throws IOException
   */
  public ClusterManager(CoronaConf conf, boolean recoverFromDisk)
    throws IOException {
    this.conf = conf;
    HostsFileReader hostsReader =
      new HostsFileReader(conf.getHostsFile(), conf.getExcludesFile());
    initLegalTypes();
    metrics = new ClusterManagerMetrics(getTypes());

    if (recoverFromDisk) {
      recoverClusterManagerFromDisk(hostsReader);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.util.HostsFileReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.