Package org.apache.hadoop.yarn.server.nodemanager.api

Examples of org.apache.hadoop.yarn.server.nodemanager.api.LocalizationProtocol


 
 
  private void testPbServerFactory() {
    InetSocketAddress addr = new InetSocketAddress(0);
    Configuration conf = new Configuration();
    LocalizationProtocol instance = new LocalizationProtocolTestImpl();
    Server server = null;
    try {
      server =
        RpcServerFactoryPBImpl.get().getServer(
            LocalizationProtocol.class, instance, addr, conf, null, 1);
View Full Code Here


 
  private void testPbClientFactory() {
    InetSocketAddress addr = new InetSocketAddress(0);
    System.err.println(addr.getHostName() + addr.getPort());
    Configuration conf = new Configuration();
    LocalizationProtocol instance = new LocalizationProtocolTestImpl();
    Server server = null;
    try {
      server =
        RpcServerFactoryPBImpl.get().getServer(
            LocalizationProtocol.class, instance, addr, conf, null, 1);
      server.start();
      System.err.println(server.getListenerAddress());
      System.err.println(NetUtils.getConnectAddress(server));

      try {
        LocalizationProtocol client = (LocalizationProtocol)
          RpcClientFactoryPBImpl.get().getClient(
              LocalizationProtocol.class, 1,
              NetUtils.getConnectAddress(server), conf);
        Assert.assertNotNull(client);
      } catch (YarnRuntimeException e) {
View Full Code Here

            String.format(ContainerLocalizer.TOKEN_FILE_NAME_FMT, cId)));
    doReturn(new FSDataInputStream(new FakeFSDataInputStream(appTokens))
        ).when(spylfs).open(tokenPath);

    // mock heartbeat responses from NM
    LocalizationProtocol nmProxy = mock(LocalizationProtocol.class);
    LocalResource rsrcA = getMockRsrc(r, LocalResourceVisibility.PRIVATE);
    LocalResource rsrcB = getMockRsrc(r, LocalResourceVisibility.PRIVATE);
    LocalResource rsrcC = getMockRsrc(r, LocalResourceVisibility.APPLICATION);
    LocalResource rsrcD = getMockRsrc(r, LocalResourceVisibility.PRIVATE);
    when(nmProxy.heartbeat(isA(LocalizerStatus.class)))
      .thenReturn(new MockLocalizerHeartbeatResponse(LocalizerAction.LIVE,
            Collections.singletonList(rsrcA)))
      .thenReturn(new MockLocalizerHeartbeatResponse(LocalizerAction.LIVE,
            Collections.singletonList(rsrcB)))
      .thenReturn(new MockLocalizerHeartbeatResponse(LocalizerAction.LIVE,
View Full Code Here

    }
    // create localizer context
    UserGroupInformation remoteUser =
      UserGroupInformation.createRemoteUser(user);
    remoteUser.addToken(creds.getToken(LocalizerTokenIdentifier.KIND));
    final LocalizationProtocol nodeManager =
        remoteUser.doAs(new PrivilegedAction<LocalizationProtocol>() {
          @Override
          public LocalizationProtocol run() {
            return getProxy(nmAddr);
          }
View Full Code Here

    }
    // create localizer context
    UserGroupInformation remoteUser =
      UserGroupInformation.createRemoteUser(user);
    remoteUser.addToken(creds.getToken(LocalizerTokenIdentifier.KIND));
    final LocalizationProtocol nodeManager =
        remoteUser.doAs(new PrivilegedAction<LocalizationProtocol>() {
          @Override
          public LocalizationProtocol run() {
            return getProxy(nmAddr);
          }
View Full Code Here

      new LocalizerTokenSecretManager();
    LocalizerTokenIdentifier id = secretManager.createIdentifier();
    Token<LocalizerTokenIdentifier> localizerToken =
      new Token<LocalizerTokenIdentifier>(id, secretManager);
    remoteUser.addToken(localizerToken);
    final LocalizationProtocol nodeManager =
        remoteUser.doAs(new PrivilegedAction<LocalizationProtocol>() {
          @Override
          public LocalizationProtocol run() {
            return getProxy(nmAddr);
          }
View Full Code Here

            String.format(ContainerLocalizer.TOKEN_FILE_NAME_FMT, cId)));
    doReturn(new FSDataInputStream(new FakeFSDataInputStream(appTokens))
        ).when(spylfs).open(tokenPath);

    // mock heartbeat responses from NM
    LocalizationProtocol nmProxy = mock(LocalizationProtocol.class);
    LocalResource rsrcA = getMockRsrc(r, LocalResourceVisibility.PRIVATE);
    LocalResource rsrcB = getMockRsrc(r, LocalResourceVisibility.PRIVATE);
    LocalResource rsrcC = getMockRsrc(r, LocalResourceVisibility.APPLICATION);
    LocalResource rsrcD = getMockRsrc(r, LocalResourceVisibility.PRIVATE);
    when(nmProxy.heartbeat(isA(LocalizerStatus.class)))
      .thenReturn(new MockLocalizerHeartbeatResponse(LocalizerAction.LIVE,
            Collections.singletonList(rsrcA)))
      .thenReturn(new MockLocalizerHeartbeatResponse(LocalizerAction.LIVE,
            Collections.singletonList(rsrcB)))
      .thenReturn(new MockLocalizerHeartbeatResponse(LocalizerAction.LIVE,
View Full Code Here

      new LocalizerTokenSecretManager();
    LocalizerTokenIdentifier id = secretManager.createIdentifier();
    Token<LocalizerTokenIdentifier> localizerToken =
      new Token<LocalizerTokenIdentifier>(id, secretManager);
    remoteUser.addToken(localizerToken);
    final LocalizationProtocol nodeManager =
        remoteUser.doAs(new PrivilegedAction<LocalizationProtocol>() {
          @Override
          public LocalizationProtocol run() {
            return getProxy(nmAddr);
          }
View Full Code Here

 
 
  private void testPbServerFactory() {
    InetSocketAddress addr = new InetSocketAddress(0);
    Configuration conf = new Configuration();
    LocalizationProtocol instance = new LocalizationProtocolTestImpl();
    Server server = null;
    try {
      server =
        RpcServerFactoryPBImpl.get().getServer(
            LocalizationProtocol.class, instance, addr, conf, null, 1);
View Full Code Here

 
  private void testPbClientFactory() {
    InetSocketAddress addr = new InetSocketAddress(0);
    System.err.println(addr.getHostName() + addr.getPort());
    Configuration conf = new Configuration();
    LocalizationProtocol instance = new LocalizationProtocolTestImpl();
    Server server = null;
    try {
      server =
        RpcServerFactoryPBImpl.get().getServer(
            LocalizationProtocol.class, instance, addr, conf, null, 1);
      server.start();
      System.err.println(server.getListenerAddress());
      System.err.println(NetUtils.getConnectAddress(server));

      try {
        LocalizationProtocol client = (LocalizationProtocol)
          RpcClientFactoryPBImpl.get().getClient(
              LocalizationProtocol.class, 1,
              NetUtils.getConnectAddress(server), conf);
        Assert.assertNotNull(client);
      } catch (YarnException e) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.nodemanager.api.LocalizationProtocol

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.