private ByteString getTokenBytes(final String appId) throws IOException, ServiceException { assert clientInstance != null; if (client == null) { client = new LlapManagementProtocolClientImpl(conf, clientInstance.getHost(), clientInstance.getManagementPort(), retryPolicy, socketFactory); } GetTokenRequestProto.Builder req = GetTokenRequestProto.newBuilder(); if (!StringUtils.isBlank(appId)) { req.setAppId(appId); } return client.getDelegationToken(null, req.build()).getToken(); }
private ByteString getTokenBytes(final String appId) throws IOException, ServiceException { assert clientInstance != null; if (client == null) { client = new LlapManagementProtocolClientImpl(conf, clientInstance.getHost(), clientInstance.getManagementPort(), retryPolicy, socketFactory); } GetTokenRequestProto.Builder req = GetTokenRequestProto.newBuilder(); if (!StringUtils.isBlank(appId)) { req.setAppId(appId); } return client.getDelegationToken(null, req.build()).getToken(); }