Java 类org.apache.hadoop.security.token.delegation.TestDelegationToken.TestDelegationTokenIdentifier 实例源码

项目:hadoop-oss    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hadoop-oss    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop-oss    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hadoop    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:aliyun-oss-hadoop-fs    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:aliyun-oss-hadoop-fs    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:big-c    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:big-c    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:big-c    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop-2.6.0-cdh5.4.3    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop-2.6.0-cdh5.4.3    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop-plus    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hadoop-plus    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop-plus    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hops    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hops    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hops    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop-TCP    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hadoop-TCP    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop-TCP    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop-on-lustre    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop-on-lustre    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        public MiniProtocol run() throws IOException {
          MiniProtocol p = (MiniProtocol) RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hardfs    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hardfs    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hardfs    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop-on-lustre2    文件:TestToken.java   
public void testDecodeIdentifier() throws IOException {
  TestDelegationTokenSecretManager secretManager =
    new TestDelegationTokenSecretManager(0, 0, 0, 0);
  secretManager.startThreads();
  TestDelegationTokenIdentifier id = new TestDelegationTokenIdentifier(
      new Text("owner"), new Text("renewer"), new Text("realUser"));

  Token<TestDelegationTokenIdentifier> token =
    new Token<TestDelegationTokenIdentifier>(id, secretManager);
  TokenIdentifier idCopy = token.decodeIdentifier();

  assertNotSame(id, idCopy);
  assertEquals(id, idCopy);
}
项目:hadoop-on-lustre2    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hadoop-on-lustre2    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        @Override
        public MiniProtocol run() throws IOException {
          MiniProtocol p = RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hortonworks-extension    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hortonworks-extension    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        public MiniProtocol run() throws IOException {
          MiniProtocol p = (MiniProtocol) RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hortonworks-extension    文件:MiniRPCBenchmark.java   
@Override // MiniProtocol
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
throws IOException {
  String owner = UserGroupInformation.getCurrentUser().getUserName();
  String realUser = 
    UserGroupInformation.getCurrentUser().getRealUser() == null ? "":
    UserGroupInformation.getCurrentUser().getRealUser().getUserName();
  TestDelegationTokenIdentifier tokenId = 
    new TestDelegationTokenIdentifier(
        new Text(owner), renewer, new Text(realUser));
  return new Token<TestDelegationTokenIdentifier>(tokenId, secretManager);
}
项目:hortonworks-extension    文件:MiniRPCBenchmark.java   
void connectToServerAndGetDelegationToken(
    final Configuration conf, final InetSocketAddress addr) throws IOException {
  MiniProtocol client = null;
  try {
    UserGroupInformation current = UserGroupInformation.getCurrentUser();
    UserGroupInformation proxyUserUgi = 
      UserGroupInformation.createProxyUserForTesting(
          MINI_USER, current, GROUP_NAMES);

    try {
      client =  proxyUserUgi.doAs(new PrivilegedExceptionAction<MiniProtocol>() {
        public MiniProtocol run() throws IOException {
          MiniProtocol p = (MiniProtocol) RPC.getProxy(MiniProtocol.class,
              MiniProtocol.versionID, addr, conf);
          Token<TestDelegationTokenIdentifier> token;
          token = p.getDelegationToken(new Text(RENEWER));
          currentUgi = UserGroupInformation.createUserForTesting(MINI_USER, 
              GROUP_NAMES);
          SecurityUtil.setTokenService(token, addr);
          currentUgi.addToken(token);
          return p;
        }
      });
    } catch (InterruptedException e) {
      Assert.fail(Arrays.toString(e.getStackTrace()));
    }
  } finally {
    RPC.stopProxy(client);
  }
}
项目:hadoop-oss    文件:MiniRPCBenchmark.java   
/**
 * Get a Delegation Token.
 */
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
    throws IOException;
项目:hadoop    文件:MiniRPCBenchmark.java   
/**
 * Get a Delegation Token.
 */
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
    throws IOException;
项目:aliyun-oss-hadoop-fs    文件:MiniRPCBenchmark.java   
/**
 * Get a Delegation Token.
 */
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
    throws IOException;
项目:big-c    文件:MiniRPCBenchmark.java   
/**
 * Get a Delegation Token.
 */
public Token<TestDelegationTokenIdentifier> getDelegationToken(Text renewer) 
    throws IOException;