@SuppressWarnings("unchecked") @Override public long renew(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); return client.renewDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } }
@SuppressWarnings("unchecked") @Override public long renew(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); return client.renewDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } }
@SuppressWarnings("unchecked") @Override public long renew(Token<?> token, Configuration conf) throws IOException, InterruptedException { TimelineClient client = TimelineClient.createTimelineClient(); try { client.init(conf); client.start(); return client.renewDelegationToken( (Token<TimelineDelegationTokenIdentifier>) token); } catch (YarnException e) { throw new IOException(e); } finally { client.stop(); } }
long renewTime1 = httpUserClient.renewDelegationToken(token); Thread.sleep(100); token.setService(new Text()); long renewTime2 = httpUserClient.renewDelegationToken(token); Assert.assertTrue(renewTime1 < renewTime2); httpUserClient.renewDelegationToken(token); Assert.fail(); } catch (Exception e) { renewTime1 = httpUserClient.renewDelegationToken(tokenToRenew); renewTime2 = httpUserClient.renewDelegationToken(tokenToRenew); Assert.assertTrue(renewTime1 < renewTime2); httpUserClient.renewDelegationToken(tokenToRenew); Assert.fail(); } catch (Exception e) {