Java 类org.apache.hadoop.hdfs.web.resources.RenewerParam 实例源码

项目:hadoop-plus    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hadoop-TCP    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hadoop-on-lustre    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, URISyntaxException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hardfs    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hadoop-on-lustre2    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hortonworks-extension    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, URISyntaxException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hortonworks-extension    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request for the root. */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, URISyntaxException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op,
      offset, length, renewer, bufferSize);
}
项目:hadoop-plus    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(
    final String renewer) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m); 
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hops    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(
    final String renewer) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token =
      JsonUtil.toDelegationToken(m);
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hops    文件:NamenodeWebHdfsMethods.java   
/**
 * Handle HTTP GET request for the root.
 */
@GET
@Path("/")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response getRoot(
    @Context
    final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME)
    @DefaultValue(DelegationParam.DEFAULT)
    final DelegationParam delegation,
    @QueryParam(UserParam.NAME)
    @DefaultValue(UserParam.DEFAULT)
    final UserParam username,
    @QueryParam(DoAsParam.NAME)
    @DefaultValue(DoAsParam.DEFAULT)
    final DoAsParam doAsUser,
    @QueryParam(GetOpParam.NAME)
    @DefaultValue(GetOpParam.DEFAULT)
    final GetOpParam op,
    @QueryParam(OffsetParam.NAME)
    @DefaultValue(OffsetParam.DEFAULT)
    final OffsetParam offset,
    @QueryParam(LengthParam.NAME)
    @DefaultValue(LengthParam.DEFAULT)
    final LengthParam length,
    @QueryParam(RenewerParam.NAME)
    @DefaultValue(RenewerParam.DEFAULT)
    final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME)
    @DefaultValue(BufferSizeParam.DEFAULT)
    final BufferSizeParam bufferSize,
    @QueryParam(FsActionParam.NAME)
    @DefaultValue(FsActionParam.DEFAULT)
    final FsActionParam fsAction)
    throws IOException, InterruptedException {
  return get(ugi, delegation, username, doAsUser, ROOT, op, offset, length,
      renewer, bufferSize, fsAction);
}
项目:hadoop-TCP    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(
    final String renewer) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m); 
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hadoop-on-lustre    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(final String renewer
    ) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m); 
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hardfs    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(
    final String renewer) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m); 
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hadoop-on-lustre2    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(
    final String renewer) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m);
  token.setService(tokenServiceName);
  return token;
}
项目:hortonworks-extension    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(final String renewer
    ) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m); 
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hortonworks-extension    文件:WebHdfsFileSystem.java   
@Override
public Token<DelegationTokenIdentifier> getDelegationToken(final String renewer
    ) throws IOException {
  final HttpOpParam.Op op = GetOpParam.Op.GETDELEGATIONTOKEN;
  final Map<?, ?> m = run(op, null, new RenewerParam(renewer));
  final Token<DelegationTokenIdentifier> token = JsonUtil.toDelegationToken(m); 
  SecurityUtil.setTokenService(token, nnAddr);
  return token;
}
项目:hadoop-plus    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request. */
@GET
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response get(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op,
      offset, length, renewer, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return get(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, offset, length, renewer, bufferSize);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
项目:hops    文件:NamenodeWebHdfsMethods.java   
/**
 * Handle HTTP GET request.
 */
@GET
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response get(
    @Context
    final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME)
    @DefaultValue(DelegationParam.DEFAULT)
    final DelegationParam delegation,
    @QueryParam(UserParam.NAME)
    @DefaultValue(UserParam.DEFAULT)
    final UserParam username,
    @QueryParam(DoAsParam.NAME)
    @DefaultValue(DoAsParam.DEFAULT)
    final DoAsParam doAsUser,
    @PathParam(UriFsPathParam.NAME)
    final UriFsPathParam path,
    @QueryParam(GetOpParam.NAME)
    @DefaultValue(GetOpParam.DEFAULT)
    final GetOpParam op,
    @QueryParam(OffsetParam.NAME)
    @DefaultValue(OffsetParam.DEFAULT)
    final OffsetParam offset,
    @QueryParam(LengthParam.NAME)
    @DefaultValue(LengthParam.DEFAULT)
    final LengthParam length,
    @QueryParam(RenewerParam.NAME)
    @DefaultValue(RenewerParam.DEFAULT)
    final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME)
    @DefaultValue(BufferSizeParam.DEFAULT)
    final BufferSizeParam bufferSize,
    @QueryParam(FsActionParam.NAME)
    @DefaultValue(FsActionParam.DEFAULT)
    final FsActionParam fsAction)
    throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op, offset, length, renewer,
      bufferSize, fsAction);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return get(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, offset, length, renewer,
            bufferSize, fsAction);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
项目:hadoop-TCP    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request. */
@GET
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response get(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op,
      offset, length, renewer, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return get(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, offset, length, renewer, bufferSize);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
项目:hardfs    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request. */
@GET
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response get(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op,
      offset, length, renewer, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return get(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, offset, length, renewer, bufferSize);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
项目:hadoop-on-lustre2    文件:NamenodeWebHdfsMethods.java   
/** Handle HTTP GET request. */
@GET
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response get(
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(UserParam.NAME) @DefaultValue(UserParam.DEFAULT)
        final UserParam username,
    @QueryParam(DoAsParam.NAME) @DefaultValue(DoAsParam.DEFAULT)
        final DoAsParam doAsUser,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(GetOpParam.NAME) @DefaultValue(GetOpParam.DEFAULT)
        final GetOpParam op,
    @QueryParam(OffsetParam.NAME) @DefaultValue(OffsetParam.DEFAULT)
        final OffsetParam offset,
    @QueryParam(LengthParam.NAME) @DefaultValue(LengthParam.DEFAULT)
        final LengthParam length,
    @QueryParam(RenewerParam.NAME) @DefaultValue(RenewerParam.DEFAULT)
        final RenewerParam renewer,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op,
      offset, length, renewer, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return get(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, offset, length, renewer, bufferSize);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}