Tabnine Logo
JspHelper.getNNServiceAddress
Code IndexAdd Tabnine to your IDE (free)

How to use
getNNServiceAddress
method
in
org.apache.hadoop.hdfs.server.common.JspHelper

Best Java code snippets using org.apache.hadoop.hdfs.server.common.JspHelper.getNNServiceAddress (Showing top 3 results out of 315)

origin: org.apache.hadoop/hadoop-hdfs

private static UserGroupInformation getTokenUGI(ServletContext context,
                        HttpServletRequest request,
                        String tokenString,
                        Configuration conf)
                          throws IOException {
 final Token<DelegationTokenIdentifier> token =
   new Token<DelegationTokenIdentifier>();
 token.decodeFromUrlString(tokenString);
 InetSocketAddress serviceAddress = getNNServiceAddress(context, request);
 if (serviceAddress != null) {
  SecurityUtil.setTokenService(token, serviceAddress);
  token.setKind(DelegationTokenIdentifier.HDFS_DELEGATION_KIND);
 }
 ByteArrayInputStream buf =
   new ByteArrayInputStream(token.getIdentifier());
 DataInputStream in = new DataInputStream(buf);
 DelegationTokenIdentifier id = new DelegationTokenIdentifier();
 id.readFields(in);
 if (context != null) {
  final NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
  if (nn != null) {
   // Verify the token.
   nn.getNamesystem().verifyToken(id, token.getPassword());
  }
 }
 UserGroupInformation ugi = id.getUser();
 ugi.addToken(token);
 return ugi;
}
origin: ch.cern.hadoop/hadoop-hdfs

private static UserGroupInformation getTokenUGI(ServletContext context,
                        HttpServletRequest request,
                        String tokenString,
                        Configuration conf)
                          throws IOException {
 final Token<DelegationTokenIdentifier> token =
   new Token<DelegationTokenIdentifier>();
 token.decodeFromUrlString(tokenString);
 InetSocketAddress serviceAddress = getNNServiceAddress(context, request);
 if (serviceAddress != null) {
  SecurityUtil.setTokenService(token, serviceAddress);
  token.setKind(DelegationTokenIdentifier.HDFS_DELEGATION_KIND);
 }
 ByteArrayInputStream buf =
   new ByteArrayInputStream(token.getIdentifier());
 DataInputStream in = new DataInputStream(buf);
 DelegationTokenIdentifier id = new DelegationTokenIdentifier();
 id.readFields(in);
 if (context != null) {
  final NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
  if (nn != null) {
   // Verify the token.
   nn.getNamesystem().verifyToken(id, token.getPassword());
  }
 }
 UserGroupInformation ugi = id.getUser();
 ugi.addToken(token);
 return ugi;
}
origin: io.prestosql.hadoop/hadoop-apache

private static UserGroupInformation getTokenUGI(ServletContext context,
                        HttpServletRequest request,
                        String tokenString,
                        Configuration conf)
                          throws IOException {
 final Token<DelegationTokenIdentifier> token =
   new Token<DelegationTokenIdentifier>();
 token.decodeFromUrlString(tokenString);
 InetSocketAddress serviceAddress = getNNServiceAddress(context, request);
 if (serviceAddress != null) {
  SecurityUtil.setTokenService(token, serviceAddress);
  token.setKind(DelegationTokenIdentifier.HDFS_DELEGATION_KIND);
 }
 ByteArrayInputStream buf =
   new ByteArrayInputStream(token.getIdentifier());
 DataInputStream in = new DataInputStream(buf);
 DelegationTokenIdentifier id = new DelegationTokenIdentifier();
 id.readFields(in);
 if (context != null) {
  final NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
  if (nn != null) {
   // Verify the token.
   nn.getNamesystem().verifyToken(id, token.getPassword());
  }
 }
 UserGroupInformation ugi = id.getUser();
 ugi.addToken(token);
 return ugi;
}
org.apache.hadoop.hdfs.server.commonJspHelpergetNNServiceAddress

Popular methods of JspHelper

  • getUGI
    Same as getUGI(null, request, conf).
  • getRemoteAddr
  • checkUsername
    Expected user name should be a short name.
  • getDefaultWebUserName
  • getDelegationTokenUrlParam
    Returns the url parameter for the given token string.
  • getTokenUGI
  • getUrlParam
    Returns the url parameter for the given string, prefixed with '?' if firstParam is true, prefixed wi
  • getUsernameFromQuery
  • bestNode
  • validatePath
    Validate filename.

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now