Java Code Examples for org.apache.hadoop.security.token.TokenIdentifier

The following examples show how to use org.apache.hadoop.security.token.TokenIdentifier. These examples are extracted from open source projects. 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 Project: flink   Source File: Utils.java    License: Apache License 2.0 6 votes vote down vote up
public static void setTokensFor(ContainerLaunchContext amContainer, List<Path> paths, Configuration conf) throws IOException {
	Credentials credentials = new Credentials();
	// for HDFS
	TokenCache.obtainTokensForNamenodes(credentials, paths.toArray(new Path[0]), conf);
	// for HBase
	obtainTokenForHBase(credentials, conf);
	// for user
	UserGroupInformation currUsr = UserGroupInformation.getCurrentUser();

	Collection<Token<? extends TokenIdentifier>> usrTok = currUsr.getTokens();
	for (Token<? extends TokenIdentifier> token : usrTok) {
		final Text id = new Text(token.getIdentifier());
		LOG.info("Adding user token " + id + " with " + token);
		credentials.addToken(id, token);
	}
	try (DataOutputBuffer dob = new DataOutputBuffer()) {
		credentials.writeTokenStorageToStream(dob);

		if (LOG.isDebugEnabled()) {
			LOG.debug("Wrote tokens. Credentials buffer length: " + dob.getLength());
		}

		ByteBuffer securityTokens = ByteBuffer.wrap(dob.getData(), 0, dob.getLength());
		amContainer.setTokens(securityTokens);
	}
}
 
Example 2
Source Project: big-c   Source File: TestClientToAMTokens.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return ClientToAMTokenSelector.class;
    }
  };
}
 
Example 3
Source Project: hadoop   Source File: RMDelegationTokenSelector.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public Token<RMDelegationTokenIdentifier> selectToken(Text service,
    Collection<Token<? extends TokenIdentifier>> tokens) {
  if (service == null) {
    return null;
  }
  LOG.debug("Looking for a token with service " + service.toString());
  for (Token<? extends TokenIdentifier> token : tokens) {
    LOG.debug("Token kind is " + token.getKind().toString()
        + " and the token's service name is " + token.getService());
    if (RMDelegationTokenIdentifier.KIND_NAME.equals(token.getKind())
        && checkService(service, token)) {
      return (Token<RMDelegationTokenIdentifier>) token;
    }
  }
  return null;
}
 
Example 4
Source Project: attic-apex-core   Source File: LaunchContainerRunnable.java    License: Apache License 2.0 6 votes vote down vote up
public static ByteBuffer getTokens(UserGroupInformation ugi, Token<StramDelegationTokenIdentifier> delegationToken)
{
  try {
    Collection<Token<? extends TokenIdentifier>> tokens = ugi.getCredentials().getAllTokens();
    Credentials credentials = new Credentials();
    for (Token<? extends TokenIdentifier> token : tokens) {
      if (!token.getKind().equals(AMRMTokenIdentifier.KIND_NAME)) {
        credentials.addToken(token.getService(), token);
        LOG.debug("Passing container token {}", token);
      }
    }
    credentials.addToken(delegationToken.getService(), delegationToken);
    DataOutputBuffer dataOutput = new DataOutputBuffer();
    credentials.writeTokenStorageToStream(dataOutput);
    byte[] tokenBytes = dataOutput.getData();
    ByteBuffer cTokenBuf = ByteBuffer.wrap(tokenBytes);
    return cTokenBuf.duplicate();
  } catch (IOException e) {
    throw new RuntimeException("Error generating delegation token", e);
  }
}
 
Example 5
Source Project: hadoop   Source File: ClientToAMTokenSelector.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public Token<ClientToAMTokenIdentifier> selectToken(Text service,
    Collection<Token<? extends TokenIdentifier>> tokens) {
  if (service == null) {
    return null;
  }
  LOG.debug("Looking for a token with service " + service.toString());
  for (Token<? extends TokenIdentifier> token : tokens) {
    LOG.debug("Token kind is " + token.getKind().toString()
        + " and the token's service name is " + token.getService());
    if (ClientToAMTokenIdentifier.KIND_NAME.equals(token.getKind())
        && service.equals(token.getService())) {
      return (Token<ClientToAMTokenIdentifier>) token;
    }
  }
  return null;
}
 
Example 6
Source Project: hadoop   Source File: Server.java    License: Apache License 2.0 6 votes vote down vote up
private UserGroupInformation getAuthorizedUgi(String authorizedId)
    throws InvalidToken, AccessControlException {
  if (authMethod == AuthMethod.TOKEN) {
    TokenIdentifier tokenId = SaslRpcServer.getIdentifier(authorizedId,
        secretManager);
    UserGroupInformation ugi = tokenId.getUser();
    if (ugi == null) {
      throw new AccessControlException(
          "Can't retrieve username from tokenIdentifier.");
    }
    ugi.addTokenIdentifier(tokenId);
    return ugi;
  } else {
    return UserGroupInformation.createRemoteUser(authorizedId, authMethod);
  }
}
 
Example 7
Source Project: stratosphere   Source File: ApplicationMaster.java    License: Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
	final String yarnClientUsername = System.getenv(Client.ENV_CLIENT_USERNAME);
	LOG.info("YARN daemon runs as '"+UserGroupInformation.getCurrentUser().getShortUserName()+"' setting"
			+ " user to execute Stratosphere ApplicationMaster/JobManager to '"+yarnClientUsername+"'");
	UserGroupInformation ugi = UserGroupInformation.createRemoteUser(yarnClientUsername);
	for(Token<? extends TokenIdentifier> toks : UserGroupInformation.getCurrentUser().getTokens()) {
		ugi.addToken(toks);
	}
	ugi.doAs(new PrivilegedAction<Object>() {
		@Override
		public Object run() {
			try {
				new ApplicationMaster().run();
			} catch (Exception e) {
				e.printStackTrace();
			}
			return null;
		}
	});
}
 
Example 8
private void cancelNameNodeToken(final Token<? extends TokenIdentifier> t,
    String userToProxy) throws HadoopSecurityManagerException {
  try {
    getProxiedUser(userToProxy).doAs(new PrivilegedExceptionAction<Void>() {
      @Override
      public Void run() throws Exception {
        cancelToken(t);
        return null;
      }

      private void cancelToken(Token<?> nt) throws IOException,
          InterruptedException {
        nt.cancel(conf);
      }
    });
  } catch (Exception e) {
    throw new HadoopSecurityManagerException("Failed to cancel token. "
        + e.getMessage() + e.getCause(), e);
  }
}
 
Example 9
Source Project: big-c   Source File: AMRMTokenSelector.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
public Token<AMRMTokenIdentifier> selectToken(Text service,
    Collection<Token<? extends TokenIdentifier>> tokens) {
  if (service == null) {
    return null;
  }
  LOG.debug("Looking for a token with service " + service.toString());
  for (Token<? extends TokenIdentifier> token : tokens) {
    LOG.debug("Token kind is " + token.getKind().toString()
        + " and the token's service name is " + token.getService());
    if (AMRMTokenIdentifier.KIND_NAME.equals(token.getKind())
        && checkService(service, token)) {
      return (Token<AMRMTokenIdentifier>) token;
    }
  }
  return null;
}
 
Example 10
@Override
public UserGroupInformation getAuthorizedUgi(String authzId,
  SecretManager<TokenIdentifier> secretManager) throws IOException {
  UserGroupInformation authorizedUgi;
  byte[] encodedId = SaslUtil.decodeIdentifier(authzId);
  PasswordAuthTokenIdentifier tokenId = new PasswordAuthTokenIdentifier();
  try {
    tokenId.readFields(new DataInputStream(new ByteArrayInputStream(encodedId)));
  } catch (IOException e) {
    throw new IOException("Can't de-serialize PasswordAuthTokenIdentifier", e);
  }
  authorizedUgi = tokenId.getUser();
  if (authorizedUgi == null) {
    throw new AccessDeniedException("Can't retrieve username from tokenIdentifier.");
  }
  authorizedUgi.addTokenIdentifier(tokenId);
  authorizedUgi.setAuthenticationMethod(getSaslAuthMethod().getAuthMethod());
  return authorizedUgi;
}
 
Example 11
Source Project: hadoop   Source File: TestClientToAMTokens.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return ClientToAMTokenSelector.class;
    }
  };
}
 
Example 12
Source Project: tez   Source File: TestTezClientUtils.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testSessionCredentialsMergedBeforeAmConfigCredentials() throws Exception {
  TezConfiguration conf = new TezConfiguration();
  Text tokenType = new Text("TEST_TOKEN_TYPE");
  Text tokenKind = new Text("TEST_TOKEN_KIND");
  Text tokenService = new Text("TEST_TOKEN_SERVICE");

  Credentials amConfigCredentials = new Credentials();
  amConfigCredentials.addToken(tokenType,
      new Token<>("id1".getBytes(), null, tokenKind, tokenService));

  Credentials sessionCredentials = new Credentials();
  Token<TokenIdentifier> sessionToken =
      new Token<>("id2".getBytes(), null, tokenKind, tokenService);
  sessionCredentials.addToken(tokenType, sessionToken);

  AMConfiguration amConfig = new AMConfiguration(conf, null, amConfigCredentials);

  Credentials amLaunchCredentials =
      TezClientUtils.prepareAmLaunchCredentials(amConfig, sessionCredentials, conf, null);

  // if there is another token in am conf creds of the same token type,
  // session token should be applied while creating ContainerLaunchContext
  Assert.assertEquals(sessionToken, amLaunchCredentials.getToken(tokenType));
}
 
Example 13
Source Project: big-c   Source File: LocalizerSecurityInfo.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(LocalizationProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      LOG.debug("Using localizerTokenSecurityInfo");
      return LocalizerTokenSelector.class;
    }
  };
}
 
Example 14
Source Project: big-c   Source File: TestTokenAspect.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testInitWithUGIToken() throws IOException, URISyntaxException {
  Configuration conf = new Configuration();
  DummyFs fs = spy(new DummyFs());
  doReturn(null).when(fs).getDelegationToken(anyString());

  Token<TokenIdentifier> token = new Token<TokenIdentifier>(new byte[0],
      new byte[0], DummyFs.TOKEN_KIND, new Text("127.0.0.1:1234"));
  fs.ugi.addToken(token);
  fs.ugi.addToken(new Token<TokenIdentifier>(new byte[0], new byte[0],
      new Text("Other token"), new Text("127.0.0.1:8021")));
  assertEquals("wrong tokens in user", 2, fs.ugi.getTokens().size());

  fs.emulateSecurityEnabled = true;
  fs.initialize(new URI("dummyfs://127.0.0.1:1234"), conf);
  fs.tokenAspect.ensureTokenInitialized();

  // Select a token from ugi (not from the remote host), store it but don't
  // renew it
  verify(fs).setDelegationToken(token);
  verify(fs, never()).getDelegationToken(anyString());
  assertNull(Whitebox.getInternalState(fs.tokenAspect, "dtRenewer"));
  assertNull(Whitebox.getInternalState(fs.tokenAspect, "action"));
}
 
Example 15
Source Project: hadoop   Source File: TestBinaryTokenFile.java    License: Apache License 2.0 6 votes vote down vote up
private static void createBinaryTokenFile(Configuration conf) {
  // Fetch delegation tokens and store in binary token file.
  try {
    Credentials cred1 = new Credentials();
    Credentials cred2 = new Credentials();
    TokenCache.obtainTokensForNamenodesInternal(cred1, new Path[] { p1 },
        conf);
    for (Token<? extends TokenIdentifier> t : cred1.getAllTokens()) {
      cred2.addToken(new Text(DELEGATION_TOKEN_KEY), t);
    }
    DataOutputStream os = new DataOutputStream(new FileOutputStream(
        binaryTokenFileName.toString()));
    try {
      cred2.writeTokenStorageToStream(os);
    } finally {
      os.close();
    }
  } catch (IOException e) {
    Assert.fail("Exception " + e);
  }
}
 
Example 16
Source Project: hadoop   Source File: ClientHSSecurityInfo.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  if (!protocol
      .equals(HSClientProtocolPB.class)) {
    return null;
  }
  return new TokenInfo() {

    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }

    @Override
    public Class<? extends TokenSelector<? extends TokenIdentifier>>
        value() {
      return ClientHSTokenSelector.class;
    }
  };  }
 
Example 17
Source Project: tez   Source File: TestTokenCache.java    License: Apache License 2.0 6 votes vote down vote up
private MockFileSystem createFileSystemForServiceName(final String service)
    throws IOException {
  MockFileSystem mockFs = new MockFileSystem();
  when(mockFs.getCanonicalServiceName()).thenReturn(service);
  when(mockFs.getDelegationToken(any(String.class))).thenAnswer(
      new Answer<Token<?>>() {
        int unique = 0;
        @Override
        public Token<?> answer(InvocationOnMock invocation) throws Throwable {
          Token<?> token = new Token<TokenIdentifier>();
          token.setService(new Text(service));
          // use unique value so when we restore from token storage, we can
          // tell if it's really the same token
          token.setKind(new Text("token" + unique++));
          return token;
        }
      });
  return mockFs;
}
 
Example 18
Source Project: hadoop   Source File: TestUserGroupInformation.java    License: Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("unchecked") // from Mockito mocks
@Test (timeout = 30000)
public <T extends TokenIdentifier> void testGetCreds() throws Exception {
  UserGroupInformation ugi = 
      UserGroupInformation.createRemoteUser("someone"); 
  
  Text service = new Text("service");
  Token<T> t1 = mock(Token.class);
  when(t1.getService()).thenReturn(service);
  Token<T> t2 = mock(Token.class);
  when(t2.getService()).thenReturn(new Text("service2"));
  Token<T> t3 = mock(Token.class);
  when(t3.getService()).thenReturn(service);
  
  // add token to ugi
  ugi.addToken(t1);
  ugi.addToken(t2);
  checkTokens(ugi, t1, t2);

  Credentials creds = ugi.getCredentials();
  creds.addToken(t3.getService(), t3);
  assertSame(t3, creds.getToken(service));
  // check that ugi wasn't modified
  checkTokens(ugi, t1, t2);
}
 
Example 19
Source Project: hadoop   Source File: TestTokenAspect.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void testInitWithUGIToken() throws IOException, URISyntaxException {
  Configuration conf = new Configuration();
  DummyFs fs = spy(new DummyFs());
  doReturn(null).when(fs).getDelegationToken(anyString());

  Token<TokenIdentifier> token = new Token<TokenIdentifier>(new byte[0],
      new byte[0], DummyFs.TOKEN_KIND, new Text("127.0.0.1:1234"));
  fs.ugi.addToken(token);
  fs.ugi.addToken(new Token<TokenIdentifier>(new byte[0], new byte[0],
      new Text("Other token"), new Text("127.0.0.1:8021")));
  assertEquals("wrong tokens in user", 2, fs.ugi.getTokens().size());

  fs.emulateSecurityEnabled = true;
  fs.initialize(new URI("dummyfs://127.0.0.1:1234"), conf);
  fs.tokenAspect.ensureTokenInitialized();

  // Select a token from ugi (not from the remote host), store it but don't
  // renew it
  verify(fs).setDelegationToken(token);
  verify(fs, never()).getDelegationToken(anyString());
  assertNull(Whitebox.getInternalState(fs.tokenAspect, "dtRenewer"));
  assertNull(Whitebox.getInternalState(fs.tokenAspect, "action"));
}
 
Example 20
Source Project: hadoop   Source File: TestBlockToken.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public GetReplicaVisibleLengthResponseProto answer(
    InvocationOnMock invocation) throws IOException {
  Object args[] = invocation.getArguments();
  assertEquals(2, args.length);
  GetReplicaVisibleLengthRequestProto req = 
      (GetReplicaVisibleLengthRequestProto) args[1];
  Set<TokenIdentifier> tokenIds = UserGroupInformation.getCurrentUser()
      .getTokenIdentifiers();
  assertEquals("Only one BlockTokenIdentifier expected", 1, tokenIds.size());
  long result = 0;
  for (TokenIdentifier tokenId : tokenIds) {
    BlockTokenIdentifier id = (BlockTokenIdentifier) tokenId;
    LOG.info("Got: " + id.toString());
    assertTrue("Received BlockTokenIdentifier is wrong", ident.equals(id));
    sm.checkAccess(id, null, PBHelper.convert(req.getBlock()),
        BlockTokenSecretManager.AccessMode.WRITE);
    result = id.getBlockId();
  }
  return GetReplicaVisibleLengthResponseProto.newBuilder()
      .setLength(result).build();
}
 
Example 21
Source Project: hadoop   Source File: Server.java    License: Apache License 2.0 5 votes vote down vote up
protected Server(String bindAddress, int port,
    Class<? extends Writable> rpcRequestClass, int handlerCount,
    int numReaders, int queueSizePerHandler, Configuration conf,
    String serverName, SecretManager<? extends TokenIdentifier> secretManager)
  throws IOException {
  this(bindAddress, port, rpcRequestClass, handlerCount, numReaders, 
      queueSizePerHandler, conf, serverName, secretManager, null);
}
 
Example 22
Source Project: hadoop-ozone   Source File: OzoneDelegationTokenSelector.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Token<OzoneTokenIdentifier> selectToken(Text service,
    Collection<Token<? extends TokenIdentifier>> tokens) {
  if (LOG.isTraceEnabled()) {
    LOG.trace("Getting token for service {}", service);
  }
  Token token = getSelectedTokens(service, tokens);
  if (LOG.isDebugEnabled()) {
    LOG.debug("Got tokens: {} for service {}", token, service);
  }
  return token;
}
 
Example 23
Source Project: big-c   Source File: WebHdfsFileSystem.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <T extends TokenIdentifier> void setDelegationToken(
    final Token<T> token) {
  synchronized (this) {
    delegationToken = token;
  }
}
 
Example 24
Source Project: hadoop   Source File: TestSaslRPC.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public TokenInfo getTokenInfo(Class<?> protocol, Configuration conf) {
  return new TokenInfo() {
    @Override
    public Class<? extends TokenSelector<? extends 
        TokenIdentifier>> value() {
      return TestTokenSelector.class;
    }
    @Override
    public Class<? extends Annotation> annotationType() {
      return null;
    }
  };
}
 
Example 25
Source Project: Flink-CEPplus   Source File: HadoopUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Indicates whether the current user has an HDFS delegation token.
 */
public static boolean hasHDFSDelegationToken() throws Exception {
	UserGroupInformation loginUser = UserGroupInformation.getCurrentUser();
	Collection<Token<? extends TokenIdentifier>> usrTok = loginUser.getTokens();
	for (Token<? extends TokenIdentifier> token : usrTok) {
		if (token.getKind().equals(HDFS_DELEGATION_TOKEN_KIND)) {
			return true;
		}
	}
	return false;
}
 
Example 26
Source Project: Flink-CEPplus   Source File: YarnTestBase.java    License: Apache License 2.0 5 votes vote down vote up
public static boolean verifyTokenKindInContainerCredentials(final Collection<String> tokens, final String containerId)
	throws IOException {
	File cwd = new File("target/" + YARN_CONFIGURATION.get(TEST_CLUSTER_NAME_KEY));
	if (!cwd.exists() || !cwd.isDirectory()) {
		return false;
	}

	File containerTokens = findFile(cwd.getAbsolutePath(), new FilenameFilter() {
		@Override
		public boolean accept(File dir, String name) {
			return name.equals(containerId + ".tokens");
		}
	});

	if (containerTokens != null) {
		LOG.info("Verifying tokens in {}", containerTokens.getAbsolutePath());

		Credentials tmCredentials = Credentials.readTokenStorageFile(containerTokens, new Configuration());

		Collection<Token<? extends TokenIdentifier>> userTokens = tmCredentials.getAllTokens();
		Set<String> tokenKinds = new HashSet<>(4);
		for (Token<? extends TokenIdentifier> token : userTokens) {
			tokenKinds.add(token.getKind().toString());
		}

		return tokenKinds.containsAll(tokens);
	} else {
		LOG.warn("Unable to find credential file for container {}", containerId);
		return false;
	}
}
 
Example 27
Source Project: big-c   Source File: ProtobufRpcEngine.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public RPC.Server getServer(Class<?> protocol, Object protocolImpl,
    String bindAddress, int port, int numHandlers, int numReaders,
    int queueSizePerHandler, boolean verbose, Configuration conf,
    SecretManager<? extends TokenIdentifier> secretManager,
    String portRangeConfig)
    throws IOException {
  return new Server(protocol, protocolImpl, conf, bindAddress, port,
      numHandlers, numReaders, queueSizePerHandler, verbose, secretManager,
      portRangeConfig);
}
 
Example 28
Source Project: hbase   Source File: AbstractHBaseSaslRpcClient.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Create a HBaseSaslRpcClient for an authentication method
 * @param conf configuration object
 * @param provider the authentication provider
 * @param token token to use if needed by the authentication method
 * @param serverAddr the address of the hbase service
 * @param securityInfo the security details for the remote hbase service
 * @param fallbackAllowed does the client allow fallback to simple authentication
 * @param rpcProtection the protection level ("authentication", "integrity" or "privacy")
 * @throws IOException
 */
protected AbstractHBaseSaslRpcClient(Configuration conf,
    SaslClientAuthenticationProvider provider, Token<? extends TokenIdentifier> token,
    InetAddress serverAddr, SecurityInfo securityInfo, boolean fallbackAllowed,
    String rpcProtection) throws IOException {
  this.fallbackAllowed = fallbackAllowed;
  saslProps = SaslUtil.initSaslProperties(rpcProtection);

  saslClient = provider.createClient(
      conf, serverAddr, securityInfo, token, fallbackAllowed, saslProps);
  if (saslClient == null) {
    throw new IOException("Authentication provider " + provider.getClass()
        + " returned a null SaslClient");
  }
}
 
Example 29
Source Project: ratis   Source File: ProtobufRpcEngineShaded.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public RPC.Server getServer(Class<?> protocol, Object protocolImpl,
    String bindAddress, int port, int numHandlers, int numReaders,
    int queueSizePerHandler, boolean verbose, Configuration conf,
    SecretManager<? extends TokenIdentifier> secretManager,
    String portRangeConfig)
    throws IOException {
  return new Server(protocol, protocolImpl, conf, bindAddress, port,
      numHandlers, numReaders, queueSizePerHandler, verbose, secretManager,
      portRangeConfig);
}
 
Example 30
Source Project: big-c   Source File: AMRMTokenSelector.java    License: Apache License 2.0 5 votes vote down vote up
private boolean checkService(Text service,
    Token<? extends TokenIdentifier> token) {
  if (service == null || token.getService() == null) {
    return false;
  }
  return token.getService().toString().contains(service.toString());
}