Java 类org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier 实例源码

项目:hadoop-oss    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hadoop    文件:TestProtocolRecords.java   
@Test
public void testNodeHeartBeatResponse() throws IOException {
  NodeHeartbeatResponse record =
      Records.newRecord(NodeHeartbeatResponse.class);
  Map<ApplicationId, ByteBuffer> appCredentials =
      new HashMap<ApplicationId, ByteBuffer>();
  Credentials app1Cred = new Credentials();

  Token<DelegationTokenIdentifier> token1 =
      new Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  app1Cred.addToken(new Text("token1"), token1);
  Token<DelegationTokenIdentifier> token2 =
      new Token<DelegationTokenIdentifier>();
  token2.setKind(new Text("kind2"));
  app1Cred.addToken(new Text("token2"), token2);

  DataOutputBuffer dob = new DataOutputBuffer();
  app1Cred.writeTokenStorageToStream(dob);
  ByteBuffer byteBuffer1 = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
  appCredentials.put(ApplicationId.newInstance(1234, 1), byteBuffer1);
  record.setSystemCredentialsForApps(appCredentials);

  NodeHeartbeatResponse proto =
      new NodeHeartbeatResponsePBImpl(
        ((NodeHeartbeatResponsePBImpl) record).getProto());
  Assert.assertEquals(appCredentials, proto.getSystemCredentialsForApps());
}
项目:hadoop    文件:TestNodeStatusUpdater.java   
public MyResourceTracker4(Context context) {
  // create app Credentials
  org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token1 =
      new org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  expectedCredentials.addToken(new Text("token1"), token1);
  this.context = context;
}
项目:hadoop    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestProtocolRecords.java   
@Test
public void testNodeHeartBeatResponse() throws IOException {
  NodeHeartbeatResponse record =
      Records.newRecord(NodeHeartbeatResponse.class);
  Map<ApplicationId, ByteBuffer> appCredentials =
      new HashMap<ApplicationId, ByteBuffer>();
  Credentials app1Cred = new Credentials();

  Token<DelegationTokenIdentifier> token1 =
      new Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  app1Cred.addToken(new Text("token1"), token1);
  Token<DelegationTokenIdentifier> token2 =
      new Token<DelegationTokenIdentifier>();
  token2.setKind(new Text("kind2"));
  app1Cred.addToken(new Text("token2"), token2);

  DataOutputBuffer dob = new DataOutputBuffer();
  app1Cred.writeTokenStorageToStream(dob);
  ByteBuffer byteBuffer1 = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
  appCredentials.put(ApplicationId.newInstance(1234, 1), byteBuffer1);
  record.setSystemCredentialsForApps(appCredentials);

  NodeHeartbeatResponse proto =
      new NodeHeartbeatResponsePBImpl(
        ((NodeHeartbeatResponsePBImpl) record).getProto());
  Assert.assertEquals(appCredentials, proto.getSystemCredentialsForApps());
}
项目:aliyun-oss-hadoop-fs    文件:TestNodeStatusUpdater.java   
public MyResourceTracker4(Context context) {
  // create app Credentials
  org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token1 =
      new org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  expectedCredentials.addToken(new Text("token1"), token1);
  this.context = context;
}
项目:aliyun-oss-hadoop-fs    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:big-c    文件:TestProtocolRecords.java   
@Test
public void testNodeHeartBeatResponse() throws IOException {
  NodeHeartbeatResponse record =
      Records.newRecord(NodeHeartbeatResponse.class);
  Map<ApplicationId, ByteBuffer> appCredentials =
      new HashMap<ApplicationId, ByteBuffer>();
  Credentials app1Cred = new Credentials();

  Token<DelegationTokenIdentifier> token1 =
      new Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  app1Cred.addToken(new Text("token1"), token1);
  Token<DelegationTokenIdentifier> token2 =
      new Token<DelegationTokenIdentifier>();
  token2.setKind(new Text("kind2"));
  app1Cred.addToken(new Text("token2"), token2);

  DataOutputBuffer dob = new DataOutputBuffer();
  app1Cred.writeTokenStorageToStream(dob);
  ByteBuffer byteBuffer1 = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
  appCredentials.put(ApplicationId.newInstance(1234, 1), byteBuffer1);
  record.setSystemCredentialsForApps(appCredentials);

  NodeHeartbeatResponse proto =
      new NodeHeartbeatResponsePBImpl(
        ((NodeHeartbeatResponsePBImpl) record).getProto());
  Assert.assertEquals(appCredentials, proto.getSystemCredentialsForApps());
}
项目:big-c    文件:TestNodeStatusUpdater.java   
public MyResourceTracker4(Context context) {
  // create app Credentials
  org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token1 =
      new org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  expectedCredentials.addToken(new Text("token1"), token1);
  this.context = context;
}
项目:big-c    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestProtocolRecords.java   
@Test
public void testNodeHeartBeatResponse() throws IOException {
  NodeHeartbeatResponse record =
      Records.newRecord(NodeHeartbeatResponse.class);
  Map<ApplicationId, ByteBuffer> appCredentials =
      new HashMap<ApplicationId, ByteBuffer>();
  Credentials app1Cred = new Credentials();

  Token<DelegationTokenIdentifier> token1 =
      new Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  app1Cred.addToken(new Text("token1"), token1);
  Token<DelegationTokenIdentifier> token2 =
      new Token<DelegationTokenIdentifier>();
  token2.setKind(new Text("kind2"));
  app1Cred.addToken(new Text("token2"), token2);

  DataOutputBuffer dob = new DataOutputBuffer();
  app1Cred.writeTokenStorageToStream(dob);
  ByteBuffer byteBuffer1 = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
  appCredentials.put(ApplicationId.newInstance(1234, 1), byteBuffer1);
  record.setSystemCredentialsForApps(appCredentials);

  NodeHeartbeatResponse proto =
      new NodeHeartbeatResponsePBImpl(
        ((NodeHeartbeatResponsePBImpl) record).getProto());
  Assert.assertEquals(appCredentials, proto.getSystemCredentialsForApps());
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestNodeStatusUpdater.java   
public MyResourceTracker4(Context context) {
  // create app Credentials
  org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token1 =
      new org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  expectedCredentials.addToken(new Text("token1"), token1);
  this.context = context;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hops    文件:TestProtocolRecords.java   
@Test
public void testNodeHeartBeatResponse() throws IOException {
  NodeHeartbeatResponse record =
      Records.newRecord(NodeHeartbeatResponse.class);
  Map<ApplicationId, ByteBuffer> appCredentials =
      new HashMap<ApplicationId, ByteBuffer>();
  Credentials app1Cred = new Credentials();

  Token<DelegationTokenIdentifier> token1 =
      new Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  app1Cred.addToken(new Text("token1"), token1);
  Token<DelegationTokenIdentifier> token2 =
      new Token<DelegationTokenIdentifier>();
  token2.setKind(new Text("kind2"));
  app1Cred.addToken(new Text("token2"), token2);

  DataOutputBuffer dob = new DataOutputBuffer();
  app1Cred.writeTokenStorageToStream(dob);
  ByteBuffer byteBuffer1 = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
  appCredentials.put(ApplicationId.newInstance(1234, 1), byteBuffer1);
  record.setSystemCredentialsForApps(appCredentials);

  NodeHeartbeatResponse proto =
      new NodeHeartbeatResponsePBImpl(
        ((NodeHeartbeatResponsePBImpl) record).getProto());
  Assert.assertEquals(appCredentials, proto.getSystemCredentialsForApps());
}
项目:hops    文件:TestNodeStatusUpdater.java   
public MyResourceTracker4(Context context) {
  // create app Credentials
  org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token1 =
      new org.apache.hadoop.security.token.Token<DelegationTokenIdentifier>();
  token1.setKind(new Text("kind1"));
  expectedCredentials.addToken(new Text("token1"), token1);
  this.context = context;
}
项目:hops    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFailWithRetry(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token, int retryCount)
    throws IOException, InterruptedException {
  try {
    tm.verifyToken(token);
  } catch (SecretManager.InvalidToken er) {
    throw er;
  }
  if (retryCount > 0) {
    Thread.sleep(RETRY_WAIT);
    verifyTokenFailWithRetry(tm, token, retryCount - 1);
  }
}
项目:hadoop-oss    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:hadoop    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:aliyun-oss-hadoop-fs    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:big-c    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}
项目:hops    文件:TestZKDelegationTokenSecretManager.java   
private void verifyTokenFail(DelegationTokenManager tm,
    Token<DelegationTokenIdentifier> token) throws IOException,
    InterruptedException {
  verifyTokenFailWithRetry(tm, token, RETRY_COUNT);
}