Examples of NMTokenCache


Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    void run() {
        log.info("Starting ApplicationMaster...");

        if (nmTokenCache == null) {
            nmTokenCache = new NMTokenCache();
        }

        if (rpc == null) {
            rpc = new AppMasterRpc(cfg, nmTokenCache);
            rpc.start();
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    try {
      // start am rm client
      amClient = AMRMClient.<ContainerRequest>createAMRMClient();

      //setting an instance NMTokenCache
      amClient.setNMTokenCache(new NMTokenCache());
      //asserting we are not using the singleton instance cache
      Assert.assertNotSame(NMTokenCache.getSingleton(),
          amClient.getNMTokenCache());

      amClient.init(conf);
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    UserGroupInformation.setLoginUser(UserGroupInformation
      .createRemoteUser(UserGroupInformation.getCurrentUser().getUserName()));
    UserGroupInformation.getCurrentUser().addToken(appAttempt.getAMRMToken());

    //creating an instance NMTokenCase
    nmTokenCache = new NMTokenCache();
   
    // start am rm client
    rmClient =
        (AMRMClientImpl<ContainerRequest>) AMRMClient
          .<ContainerRequest> createAMRMClient();
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    // void org.apache.hadoop.yarn.client.api.NMTokenCache.setNMToken(String, Token)

    // vanilla
    // static void org.apache.hadoop.yarn.client.api.NMTokenCache.setNMToken(String, Token)

    NMTokenCache cache1 = NMTokenCacheCompat.getNMTokenCache();
    NMTokenCache cache2 = NMTokenCacheCompat.getNMTokenCache();
    cache1.setNMToken("nodeAddr1", new TestToken("kind1"));
    cache2.setNMToken("nodeAddr2", new TestToken("kind2"));

    assertThat(cache1.getNMToken("nodeAddr1").getKind(), is("kind1"));
    assertThat(cache2.getNMToken("nodeAddr1").getKind(), is("kind1"));
    assertThat(cache1.getNMToken("nodeAddr2").getKind(), is("kind2"));
    assertThat(cache2.getNMToken("nodeAddr2").getKind(), is("kind2"));

    assertThat(cache1, sameInstance(cache2));
    assertThat(NMTokenCacheCompat.getNMTokenCache(), sameInstance(NMTokenCacheCompat.getNMTokenCache()));
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

              log.debug("Creating NMTokenCache using NMTokenCache.getSingleton()");
            }
            nmTokenCache = (NMTokenCache) ReflectionUtils.invokeMethod(singletonMethod, null);
          } else {
            log.debug("Creating NMTokenCache using constructor, further access via instance static methods.");
            nmTokenCache = new NMTokenCache();
          }
        }
      }
    }
    return nmTokenCache;
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

  @SuppressWarnings("static-access")
  protected void populateNmTokenCache(AllocateResponse allocateResponse) {
    // In some distros NMTokenCache don't have static methods
    // so it's ok to suppress warnings for it, and anyway
    // we need to stay compatible
    NMTokenCache tokenCache = NMTokenCacheCompat.getNMTokenCache();
    for (NMToken token : allocateResponse.getNMTokens()) {
      String nodeId = token.getNodeId().toString();
      if (log.isDebugEnabled()) {
        log.info("Token from allocateResponse token=" + token);
        if (NMTokenCacheCompat.containsToken(tokenCache, nodeId)) {
          log.debug("Replacing token for : " + nodeId);
        } else {
          log.debug("Received new token for : " + nodeId);
        }
      }
      tokenCache.setNMToken(nodeId, token.getToken());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    UserGroupInformation.setLoginUser(UserGroupInformation
      .createRemoteUser(UserGroupInformation.getCurrentUser().getUserName()));
    UserGroupInformation.getCurrentUser().addToken(appAttempt.getAMRMToken());

    //creating an instance NMTokenCase
    nmTokenCache = new NMTokenCache();
   
    // start am rm client
    rmClient =
        (AMRMClientImpl<ContainerRequest>) AMRMClient
          .<ContainerRequest> createAMRMClient();
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    UserGroupInformation.setLoginUser(UserGroupInformation
      .createRemoteUser(UserGroupInformation.getCurrentUser().getUserName()));
    UserGroupInformation.getCurrentUser().addToken(appAttempt.getAMRMToken());

    //creating an instance NMTokenCase
    nmTokenCache = new NMTokenCache();
   
    // start am rm client
    rmClient =
        (AMRMClientImpl<ContainerRequest>) AMRMClient
          .<ContainerRequest> createAMRMClient();
View Full Code Here

Examples of org.apache.hadoop.yarn.client.api.NMTokenCache

    try {
      // start am rm client
      amClient = AMRMClient.<ContainerRequest>createAMRMClient();

      //setting an instance NMTokenCache
      amClient.setNMTokenCache(new NMTokenCache());
      //asserting we are not using the singleton instance cache
      Assert.assertNotSame(NMTokenCache.getSingleton(),
          amClient.getNMTokenCache());

      amClient.init(conf);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.