org.apache.hadoop.mapreduce.v2.api.protocolrecords.CancelDelegationTokenResponse Java Examples

The following examples show how to use org.apache.hadoop.mapreduce.v2.api.protocolrecords.CancelDelegationTokenResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HistoryClientService.java    From hadoop with Apache License 2.0 6 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
    if (!isAllowedDelegationTokenOp()) {
      throw new IOException(
          "Delegation Token can be cancelled only with kerberos authentication");
    }

    org.apache.hadoop.yarn.api.records.Token protoToken = request.getDelegationToken();
    Token<MRDelegationTokenIdentifier> token =
        new Token<MRDelegationTokenIdentifier>(
            protoToken.getIdentifier().array(), protoToken.getPassword()
                .array(), new Text(protoToken.getKind()), new Text(
                protoToken.getService()));

    String user = UserGroupInformation.getCurrentUser().getUserName();
    jhsDTSecretManager.cancelToken(token, user);
    return Records.newRecord(CancelDelegationTokenResponse.class);
}
 
Example #2
Source File: HistoryClientService.java    From big-c with Apache License 2.0 6 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
    if (!isAllowedDelegationTokenOp()) {
      throw new IOException(
          "Delegation Token can be cancelled only with kerberos authentication");
    }

    org.apache.hadoop.yarn.api.records.Token protoToken = request.getDelegationToken();
    Token<MRDelegationTokenIdentifier> token =
        new Token<MRDelegationTokenIdentifier>(
            protoToken.getIdentifier().array(), protoToken.getPassword()
                .array(), new Text(protoToken.getKind()), new Text(
                protoToken.getService()));

    String user = UserGroupInformation.getCurrentUser().getUserName();
    jhsDTSecretManager.cancelToken(token, user);
    return Records.newRecord(CancelDelegationTokenResponse.class);
}
 
Example #3
Source File: MRClientProtocolPBServiceImpl.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public CancelDelegationTokenResponseProto cancelDelegationToken(
    RpcController controller, CancelDelegationTokenRequestProto proto)
    throws ServiceException {
  CancelDelegationTokenRequestPBImpl request =
      new CancelDelegationTokenRequestPBImpl(proto);
    try {
      CancelDelegationTokenResponse response = real.cancelDelegationToken(request);
      return ((CancelDelegationTokenResponsePBImpl)response).getProto();
    } catch (IOException e) {
      throw new ServiceException(e);
    }
}
 
Example #4
Source File: MRClientProtocolPBClientImpl.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  CancelDelegationTokenRequestProto requestProto =
      ((CancelDelegationTokenRequestPBImpl) request).getProto();
  try {
    return new CancelDelegationTokenResponsePBImpl(
        proxy.cancelDelegationToken(null, requestProto));

  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
 
Example #5
Source File: MRClientProtocolPBServiceImpl.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public CancelDelegationTokenResponseProto cancelDelegationToken(
    RpcController controller, CancelDelegationTokenRequestProto proto)
    throws ServiceException {
  CancelDelegationTokenRequestPBImpl request =
      new CancelDelegationTokenRequestPBImpl(proto);
    try {
      CancelDelegationTokenResponse response = real.cancelDelegationToken(request);
      return ((CancelDelegationTokenResponsePBImpl)response).getProto();
    } catch (IOException e) {
      throw new ServiceException(e);
    }
}
 
Example #6
Source File: MRClientProtocolPBClientImpl.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  CancelDelegationTokenRequestProto requestProto =
      ((CancelDelegationTokenRequestPBImpl) request).getProto();
  try {
    return new CancelDelegationTokenResponsePBImpl(
        proxy.cancelDelegationToken(null, requestProto));

  } catch (ServiceException e) {
    throw unwrapAndThrowException(e);
  }
}
 
Example #7
Source File: MRClientService.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  throw new IOException("MR AM not authorized to cancel delegation" +
      " token");
}
 
Example #8
Source File: NotRunningJob.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  /* Should not be invoked by anyone. */
  throw new NotImplementedException();
}
 
Example #9
Source File: TestRPCFactories.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  return null;
}
 
Example #10
Source File: MRClientService.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  throw new IOException("MR AM not authorized to cancel delegation" +
      " token");
}
 
Example #11
Source File: NotRunningJob.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  /* Should not be invoked by anyone. */
  throw new NotImplementedException();
}
 
Example #12
Source File: TestRPCFactories.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  return null;
}
 
Example #13
Source File: NotRunningJob.java    From incubator-tez with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  /* Should not be invoked by anyone. */
  throw new NotImplementedException();
}
 
Example #14
Source File: NotRunningJob.java    From tez with Apache License 2.0 4 votes vote down vote up
@Override
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException {
  /* Should not be invoked by anyone. */
  throw new NotImplementedException();
}
 
Example #15
Source File: MRClientProtocol.java    From hadoop with Apache License 2.0 2 votes vote down vote up
/**
 * Cancel an existing delegation token.
 * 
 * @param request the delegation token to be cancelled.
 * @return an empty response.
 * @throws IOException
 */
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException;
 
Example #16
Source File: MRClientProtocol.java    From big-c with Apache License 2.0 2 votes vote down vote up
/**
 * Cancel an existing delegation token.
 * 
 * @param request the delegation token to be cancelled.
 * @return an empty response.
 * @throws IOException
 */
public CancelDelegationTokenResponse cancelDelegationToken(
    CancelDelegationTokenRequest request) throws IOException;