/** * Cancel a Delegation Token. * @param nnAddr the NameNode's address * @param tok the token to cancel * @throws IOException * @throws AuthenticationException */ static public void cancelDelegationToken(URLConnectionFactory factory, URI nnAddr, Token<DelegationTokenIdentifier> tok) throws IOException, AuthenticationException { StringBuilder buf = new StringBuilder(nnAddr.toString()) .append(CancelDelegationTokenServlet.PATH_SPEC).append("?") .append(CancelDelegationTokenServlet.TOKEN).append("=") .append(tok.encodeToUrlString()); HttpURLConnection conn = run(factory, new URL(buf.toString())); conn.disconnect(); }
/** * Cancel a Delegation Token. * @param nnAddr the NameNode's address * @param tok the token to cancel * @throws IOException * @throws AuthenticationException */ static public void cancelDelegationToken(URLConnectionFactory factory, URI nnAddr, Token<DelegationTokenIdentifier> tok) throws IOException, AuthenticationException { StringBuilder buf = new StringBuilder(nnAddr.toString()) .append(CancelDelegationTokenServlet.PATH_SPEC).append("?") .append(CancelDelegationTokenServlet.TOKEN).append("=") .append(tok.encodeToUrlString()); HttpURLConnection conn = run(factory, new URL(buf.toString())); conn.disconnect(); }
BufferedReader in = null; try { connection = run(factory, new URL(buf.toString())); in = new BufferedReader(new InputStreamReader( connection.getInputStream(), Charsets.UTF_8));
BufferedReader in = null; try { connection = run(factory, new URL(buf.toString())); in = new BufferedReader(new InputStreamReader( connection.getInputStream(), Charsets.UTF_8));
conn = run(factory, new URL(buf.toString())); InputStream in = conn.getInputStream(); Credentials ts = new Credentials();
conn = run(factory, new URL(buf.toString())); InputStream in = conn.getInputStream(); Credentials ts = new Credentials();