Package org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer

Examples of org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest


      for (Entry<String, LocalResource> rsrc : localResources.entrySet()) {
        if (counter >= failRsrcCount) {
          break;
        }
        ++counter;
        LocalResourceRequest req = new LocalResourceRequest(rsrc.getValue());
        Exception e = new Exception("Fake localization error");
        c.handle(new ContainerResourceFailedEvent(c.getContainerID(),
                 req, e));
      }
      drainDispatcherEvents();    
View Full Code Here


    long basetime = r.nextLong() >>> 2;
    org.apache.hadoop.yarn.api.records.LocalResource yA = getYarnResource(
        new Path("http://yak.org:80/foobar"), -1, basetime, FILE, PUBLIC);
    org.apache.hadoop.yarn.api.records.LocalResource yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), -1, basetime, FILE, PUBLIC);
    final LocalResourceRequest a = new LocalResourceRequest(yA);
    LocalResourceRequest b = new LocalResourceRequest(yA);
    checkEqual(a, b);
    b = new LocalResourceRequest(yB);
    checkEqual(a, b);

    // ignore visibility
    yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), -1, basetime, FILE, PRIVATE);
    b = new LocalResourceRequest(yB);
    checkEqual(a, b);

    // ignore size
    yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), 0, basetime, FILE, PRIVATE);
    b = new LocalResourceRequest(yB);
    checkEqual(a, b);

    // note path
    yB = getYarnResource(
        new Path("hdfs://dingo.org:80/foobar"), 0, basetime, ARCHIVE, PUBLIC);
    b = new LocalResourceRequest(yB);
    checkNotEqual(a, b);

    // note type
    yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), 0, basetime, ARCHIVE, PUBLIC);
    b = new LocalResourceRequest(yB);
    checkNotEqual(a, b);

    // note timestamp
    yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), 0, basetime + 1, FILE, PUBLIC);
    b = new LocalResourceRequest(yB);
    checkNotEqual(a, b);
  }
View Full Code Here

    r.setSeed(seed);
    System.out.println("SEED: " + seed);
    long basetime = r.nextLong() >>> 2;
    org.apache.hadoop.yarn.api.records.LocalResource yA = getYarnResource(
        new Path("http://yak.org:80/foobar"), -1, basetime, FILE, PUBLIC);
    final LocalResourceRequest a = new LocalResourceRequest(yA);

    // Path primary
    org.apache.hadoop.yarn.api.records.LocalResource yB = getYarnResource(
        new Path("http://yak.org:80/foobaz"), -1, basetime, FILE, PUBLIC);
    LocalResourceRequest b = new LocalResourceRequest(yB);
    assertTrue(0 > a.compareTo(b));

    // timestamp secondary
    yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), -1, basetime + 1, FILE, PUBLIC);
    b = new LocalResourceRequest(yB);
    assertTrue(0 > a.compareTo(b));

    // type tertiary
    yB = getYarnResource(
        new Path("http://yak.org:80/foobar"), -1, basetime, ARCHIVE, PUBLIC);
    b = new LocalResourceRequest(yB);
    assertTrue(0 != a.compareTo(b)); // don't care about order, just ne
  }
View Full Code Here

    ResourcesReleasedMatcher(Map<String, LocalResource> allResources,
        EnumSet<LocalResourceVisibility> vis) throws URISyntaxException {
      for (Entry<String, LocalResource> e : allResources.entrySet()) {
        if (vis.contains(e.getValue().getVisibility())) {
          resources.add(new LocalResourceRequest(e.getValue()));
        }
      }
    }
View Full Code Here

    ResourcesRequestedMatcher(Map<String, LocalResource> allResources,
        EnumSet<LocalResourceVisibility> vis) throws URISyntaxException {
      for (Entry<String, LocalResource> e : allResources.entrySet()) {
        if (vis.contains(e.getValue().getVisibility())) {
          resources.add(new LocalResourceRequest(e.getValue()));
        }
      }
    }
View Full Code Here

          continue;
        }
        if (checkLocalizingState) {
          assertEquals(ContainerState.LOCALIZING, c.getContainerState());
        }
        LocalResourceRequest req = new LocalResourceRequest(rsrc.getValue());
        Path p = new Path(cache, rsrc.getKey());
        localPaths.put(p, Arrays.asList(rsrc.getKey()));
        // rsrc copied to p
        c.handle(new ContainerResourceLocalizedEvent(c.getContainerID(),
                 req, p));
View Full Code Here

    }
   
    public void failLocalizeSpecificResource(String rsrcKey)
        throws URISyntaxException {
      LocalResource rsrc = localResources.get(rsrcKey);
      LocalResourceRequest req = new LocalResourceRequest(rsrc);
      Exception e = new Exception("Fake localization error");
      c.handle(new ContainerResourceFailedEvent(c.getContainerID(), req, e));
      drainDispatcherEvents();
    }
View Full Code Here

      for (Entry<String, LocalResource> rsrc : localResources.entrySet()) {
        if (counter >= failRsrcCount) {
          break;
        }
        ++counter;
        LocalResourceRequest req = new LocalResourceRequest(rsrc.getValue());
        Exception e = new Exception("Fake localization error");
        c.handle(new ContainerResourceFailedEvent(c.getContainerID(),
                 req, e));
      }
      drainDispatcherEvents();    
View Full Code Here

    ResourcesReleasedMatcher(Map<String, LocalResource> allResources,
        EnumSet<LocalResourceVisibility> vis) throws URISyntaxException {
      for (Entry<String, LocalResource> e : allResources.entrySet()) {
        if (vis.contains(e.getValue().getVisibility())) {
          resources.add(new LocalResourceRequest(e.getValue()));
        }
      }
    }
View Full Code Here

    ResourcesRequestedMatcher(Map<String, LocalResource> allResources,
        EnumSet<LocalResourceVisibility> vis) throws URISyntaxException {
      for (Entry<String, LocalResource> e : allResources.entrySet()) {
        if (vis.contains(e.getValue().getVisibility())) {
          resources.add(new LocalResourceRequest(e.getValue()));
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.nodemanager.containermanager.localizer.LocalResourceRequest

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.