Пример #1
0
  protected ApplicationMasterProtocol createSchedulerProxy() {
    final Configuration conf = getConfig();

    try {
      return ClientRMProxy.createRMProxy(conf, ApplicationMasterProtocol.class);
    } catch (IOException e) {
      throw new YarnRuntimeException(e);
    }
  }
 @Override
 protected void serviceStart() throws Exception {
   final YarnConfiguration conf = new YarnConfiguration(getConfig());
   try {
     rmClient = ClientRMProxy.createRMProxy(conf, ApplicationMasterProtocol.class);
   } catch (IOException e) {
     throw new YarnRuntimeException(e);
   }
   super.serviceStart();
 }
 private void updateAMRMToken(Token token) throws IOException {
   org.apache.hadoop.security.token.Token<AMRMTokenIdentifier> amrmToken =
       new org.apache.hadoop.security.token.Token<AMRMTokenIdentifier>(
           token.getIdentifier().array(),
           token.getPassword().array(),
           new Text(token.getKind()),
           new Text(token.getService()));
   // Preserve the token service sent by the RM when adding the token
   // to ensure we replace the previous token setup by the RM.
   // Afterwards we can update the service address for the RPC layer.
   UserGroupInformation currentUGI = UserGroupInformation.getCurrentUser();
   currentUGI.addToken(amrmToken);
   amrmToken.setService(ClientRMProxy.getAMRMTokenService(getConfig()));
 }
Пример #4
0
 @Override
 protected void serviceStart() throws Exception {
   try {
     rmClient = ClientRMProxy.createRMProxy(getConfig(), ApplicationClientProtocol.class);
     if (historyServiceEnabled) {
       historyClient.start();
     }
     if (timelineServiceEnabled) {
       timelineClient.start();
     }
   } catch (IOException e) {
     throw new YarnRuntimeException(e);
   }
   super.serviceStart();
 }