org.apache.hadoop.yarn.api.ApplicationClientProtocol.renewDelegationToken()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中org.apache.hadoop.yarn.api.ApplicationClientProtocol.renewDelegationToken()方法的一些代码示例,展示了ApplicationClientProtocol.renewDelegationToken()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ApplicationClientProtocol.renewDelegationToken()方法的具体详情如下:
包路径:org.apache.hadoop.yarn.api.ApplicationClientProtocol
类名称:ApplicationClientProtocol
方法名:renewDelegationToken

ApplicationClientProtocol.renewDelegationToken介绍

暂无

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-router

@Override
public RenewDelegationTokenResponse renewDelegationToken(
  RenewDelegationTokenRequest request) throws YarnException, IOException {
 return clientRMProxy.renewDelegationToken(request);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@Override
public RenewDelegationTokenResponseProto renewDelegationToken(
  RpcController controller, RenewDelegationTokenRequestProto proto)
  throws ServiceException {
 RenewDelegationTokenRequestPBImpl request =
   new RenewDelegationTokenRequestPBImpl(proto);
  try {
   RenewDelegationTokenResponse response = real.renewDelegationToken(request);
   return ((RenewDelegationTokenResponsePBImpl)response).getProto();
  } catch (YarnException e) {
   throw new ServiceException(e);
  } catch (IOException e) {
   throw new ServiceException(e);
  }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@Override
public RenewDelegationTokenResponseProto renewDelegationToken(
  RpcController controller, RenewDelegationTokenRequestProto proto)
  throws ServiceException {
 RenewDelegationTokenRequestPBImpl request =
   new RenewDelegationTokenRequestPBImpl(proto);
  try {
   RenewDelegationTokenResponse response = real.renewDelegationToken(request);
   return ((RenewDelegationTokenResponsePBImpl)response).getProto();
  } catch (YarnException e) {
   throw new ServiceException(e);
  } catch (IOException e) {
   throw new ServiceException(e);
  }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

@Override
public RenewDelegationTokenResponseProto renewDelegationToken(
  RpcController controller, RenewDelegationTokenRequestProto proto)
  throws ServiceException {
 RenewDelegationTokenRequestPBImpl request =
   new RenewDelegationTokenRequestPBImpl(proto);
  try {
   RenewDelegationTokenResponse response = real.renewDelegationToken(request);
   return ((RenewDelegationTokenResponsePBImpl)response).getProto();
  } catch (YarnException e) {
   throw new ServiceException(e);
  } catch (IOException e) {
   throw new ServiceException(e);
  }
}

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Override
 public Long run() throws YarnException, IOException {
  RenewDelegationTokenRequest request = Records
    .newRecord(RenewDelegationTokenRequest.class);
  request.setDelegationToken(dToken);
  return clientRMService.renewDelegationToken(request)
    .getNextExpirationTime();
 }
});

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-common

@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token, Configuration conf) throws IOException,
  InterruptedException {
 final ApplicationClientProtocol rmClient = getRmClient(token, conf);
 if (rmClient != null) {
  try {
   RenewDelegationTokenRequest request =
     Records.newRecord(RenewDelegationTokenRequest.class);
   request.setDelegationToken(convertToProtoToken(token));
   return rmClient.renewDelegationToken(request).getNextExpirationTime();
  } catch (YarnException e) {
   throw new IOException(e);
  } finally {
   RPC.stopProxy(rmClient);
  }
 } else {
  return localSecretManager.renewToken(
    (Token<RMDelegationTokenIdentifier>)token, getRenewer(token));
 }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Override
 public Long run() throws YarnException, IOException {
  RenewDelegationTokenRequest request = Records
    .newRecord(RenewDelegationTokenRequest.class);
  request.setDelegationToken(dToken);
  return clientRMService.renewDelegationToken(request)
    .getNextExpirationTime();
 }
});

代码示例来源:origin: org.apache.hadoop/hadoop-yarn-common

@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token, Configuration conf) throws IOException,
  InterruptedException {
 final ApplicationClientProtocol rmClient = getRmClient(token, conf);
 if (rmClient != null) {
  try {
   RenewDelegationTokenRequest request =
     Records.newRecord(RenewDelegationTokenRequest.class);
   request.setDelegationToken(convertToProtoToken(token));
   return rmClient.renewDelegationToken(request).getNextExpirationTime();
  } catch (YarnException e) {
   throw new IOException(e);
  } finally {
   RPC.stopProxy(rmClient);
  }
 } else {
  return localSecretManager.renewToken(
    (Token<RMDelegationTokenIdentifier>)token, getRenewer(token));
 }
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-yarn-common

@SuppressWarnings("unchecked")
@Override
public long renew(Token<?> token, Configuration conf) throws IOException,
  InterruptedException {
 final ApplicationClientProtocol rmClient = getRmClient(token, conf);
 if (rmClient != null) {
  try {
   RenewDelegationTokenRequest request =
     Records.newRecord(RenewDelegationTokenRequest.class);
   request.setDelegationToken(convertToProtoToken(token));
   return rmClient.renewDelegationToken(request).getNextExpirationTime();
  } catch (YarnException e) {
   throw new IOException(e);
  } finally {
   RPC.stopProxy(rmClient);
  }
 } else {
  return localSecretManager.renewToken(
    (Token<RMDelegationTokenIdentifier>)token, getRenewer(token));
 }
}

相关文章

微信公众号

最新文章

更多

ApplicationClientProtocol类方法