当前位置: 首页>>代码示例>>Java>>正文


Java PostOpParam.DEFAULT属性代码示例

本文整理汇总了Java中org.apache.hadoop.hdfs.web.resources.PostOpParam.DEFAULT属性的典型用法代码示例。如果您正苦于以下问题:Java PostOpParam.DEFAULT属性的具体用法?Java PostOpParam.DEFAULT怎么用?Java PostOpParam.DEFAULT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hdfs.web.resources.PostOpParam的用法示例。


在下文中一共展示了PostOpParam.DEFAULT属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postRoot

/** Handle HTTP POST request for the root for the root. */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(
    final InputStream in,
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(NamenodeAddressParam.NAME)
    @DefaultValue(NamenodeAddressParam.DEFAULT)
        final NamenodeAddressParam namenode,
    @QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return post(in, ugi, delegation, namenode, ROOT, op, bufferSize);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:20,代码来源:DatanodeWebHdfsMethods.java

示例2: postRoot

/** Handle HTTP POST request for the root. */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(
    @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(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(ConcatSourcesParam.NAME) @DefaultValue(ConcatSourcesParam.DEFAULT)
        final ConcatSourcesParam concatSrcs,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return post(ugi, delegation, username, doAsUser, ROOT, op, concatSrcs, bufferSize);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:22,代码来源:NamenodeWebHdfsMethods.java

示例3: postRoot

/** Handle HTTP POST request for the root for the root. */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(
    final InputStream in,
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(NamenodeRpcAddressParam.NAME)
    @DefaultValue(NamenodeRpcAddressParam.DEFAULT)
        final NamenodeRpcAddressParam namenodeRpcAddress,
    @QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return post(in, ugi, delegation, namenodeRpcAddress, ROOT, op, bufferSize);
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:20,代码来源:DatanodeWebHdfsMethods.java

示例4: postRoot

/**
 * Handle HTTP POST request for the root for the root.
 */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(final InputStream in,
    @Context
    final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME)
    @DefaultValue(DelegationParam.DEFAULT)
    final DelegationParam delegation,
    @QueryParam(NamenodeRpcAddressParam.NAME)
    @DefaultValue(NamenodeRpcAddressParam.DEFAULT)
    final NamenodeRpcAddressParam namenodeRpcAddress,
    @QueryParam(PostOpParam.NAME)
    @DefaultValue(PostOpParam.DEFAULT)
    final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME)
    @DefaultValue(BufferSizeParam.DEFAULT)
    final BufferSizeParam bufferSize)
    throws IOException, InterruptedException {
  return post(in, ugi, delegation, namenodeRpcAddress, ROOT, op, bufferSize);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:25,代码来源:DatanodeWebHdfsMethods.java

示例5: postRoot

/** Handle HTTP POST request for the root. */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(
    @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(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return post(ugi, delegation, username, doAsUser, ROOT, op, bufferSize);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:20,代码来源:NamenodeWebHdfsMethods.java

示例6: postRoot

/** Handle HTTP POST request for the root for the root. */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(
    final InputStream in,
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {
  return post(in, ugi, delegation, ROOT, op, bufferSize);
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:17,代码来源:DatanodeWebHdfsMethods.java

示例7: post

/** Handle HTTP POST request. */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(
    final InputStream in,
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(NamenodeAddressParam.NAME)
    @DefaultValue(NamenodeAddressParam.DEFAULT)
        final NamenodeAddressParam namenode,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  final String nnId = namenode.getValue();
  init(ugi, delegation, nnId, path, op, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException {
      return post(in, nnId, path.getAbsolutePath(), op,
              bufferSize);
    }
  });
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:31,代码来源:DatanodeWebHdfsMethods.java

示例8: post

/** Handle HTTP POST request. */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(
    @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(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(ConcatSourcesParam.NAME) @DefaultValue(ConcatSourcesParam.DEFAULT)
        final ConcatSourcesParam concatSrcs,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op, concatSrcs, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return post(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, concatSrcs, bufferSize);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:37,代码来源:NamenodeWebHdfsMethods.java

示例9: post

/** Handle HTTP POST request. */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(
    final InputStream in,
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @QueryParam(NamenodeRpcAddressParam.NAME)
    @DefaultValue(NamenodeRpcAddressParam.DEFAULT)
        final NamenodeRpcAddressParam namenodeRpcAddress,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  final InetSocketAddress nnRpcAddr = namenodeRpcAddress.getValue();
  init(ugi, delegation, nnRpcAddr, path, op, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException {
      return post(in, ugi, delegation, nnRpcAddr, path.getAbsolutePath(), op,
          bufferSize);
    }
  });
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:31,代码来源:DatanodeWebHdfsMethods.java

示例10: postRoot

/**
 * Handle HTTP POST request for the root.
 */
@POST
@Path("/")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response postRoot(
    @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(PostOpParam.NAME)
    @DefaultValue(PostOpParam.DEFAULT)
    final PostOpParam op,
    @QueryParam(ConcatSourcesParam.NAME)
    @DefaultValue(ConcatSourcesParam.DEFAULT)
    final ConcatSourcesParam concatSrcs,
    @QueryParam(BufferSizeParam.NAME)
    @DefaultValue(BufferSizeParam.DEFAULT)
    final BufferSizeParam bufferSize)
    throws IOException, InterruptedException {
  return post(ugi, delegation, username, doAsUser, ROOT, op, concatSrcs,
      bufferSize);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:32,代码来源:NamenodeWebHdfsMethods.java

示例11: post

/**
 * Handle HTTP POST request.
 */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(final InputStream in,
    @Context
    final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME)
    @DefaultValue(DelegationParam.DEFAULT)
    final DelegationParam delegation,
    @QueryParam(NamenodeRpcAddressParam.NAME)
    @DefaultValue(NamenodeRpcAddressParam.DEFAULT)
    final NamenodeRpcAddressParam namenodeRpcAddress,
    @PathParam(UriFsPathParam.NAME)
    final UriFsPathParam path,
    @QueryParam(PostOpParam.NAME)
    @DefaultValue(PostOpParam.DEFAULT)
    final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME)
    @DefaultValue(BufferSizeParam.DEFAULT)
    final BufferSizeParam bufferSize)
    throws IOException, InterruptedException {

  final InetSocketAddress nnRpcAddr = namenodeRpcAddress.getValue();
  init(ugi, delegation, nnRpcAddr, path, op, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException {
      return post(in, ugi, delegation, nnRpcAddr, path.getAbsolutePath(), op,
          bufferSize);
    }
  });
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:37,代码来源:DatanodeWebHdfsMethods.java

示例12: post

/**
 * Handle HTTP POST request.
 */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(
    @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(PostOpParam.NAME)
    @DefaultValue(PostOpParam.DEFAULT)
    final PostOpParam op,
    @QueryParam(ConcatSourcesParam.NAME)
    @DefaultValue(ConcatSourcesParam.DEFAULT)
    final ConcatSourcesParam concatSrcs,
    @QueryParam(BufferSizeParam.NAME)
    @DefaultValue(BufferSizeParam.DEFAULT)
    final BufferSizeParam bufferSize)
    throws IOException, InterruptedException {

  init(ugi, delegation, username, doAsUser, path, op, concatSrcs, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {
        return post(ugi, delegation, username, doAsUser,
            path.getAbsolutePath(), op, concatSrcs, bufferSize);
      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:47,代码来源:NamenodeWebHdfsMethods.java

示例13: post

/** Handle HTTP POST request. */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(
    @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(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

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

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException, URISyntaxException {
      REMOTE_ADDRESS.set(request.getRemoteAddr());
      try {

  final String fullpath = path.getAbsolutePath();
  final NameNode namenode = (NameNode)context.getAttribute("name.node");

  switch(op.getValue()) {
  case APPEND:
  {
    final URI uri = redirectURI(namenode, ugi, delegation, username, doAsUser,
        fullpath, op.getValue(), -1L, -1L, bufferSize);
    return Response.temporaryRedirect(uri).type(MediaType.APPLICATION_OCTET_STREAM).build();
  }
  default:
    throw new UnsupportedOperationException(op + " is not supported");
  }

      } finally {
        REMOTE_ADDRESS.set(null);
      }
    }
  });
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:48,代码来源:NamenodeWebHdfsMethods.java

示例14: post

/** Handle HTTP POST request. */
@POST
@Path("{" + UriFsPathParam.NAME + ":.*}")
@Consumes({"*/*"})
@Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON})
public Response post(
    final InputStream in,
    @Context final UserGroupInformation ugi,
    @QueryParam(DelegationParam.NAME) @DefaultValue(DelegationParam.DEFAULT)
        final DelegationParam delegation,
    @PathParam(UriFsPathParam.NAME) final UriFsPathParam path,
    @QueryParam(PostOpParam.NAME) @DefaultValue(PostOpParam.DEFAULT)
        final PostOpParam op,
    @QueryParam(BufferSizeParam.NAME) @DefaultValue(BufferSizeParam.DEFAULT)
        final BufferSizeParam bufferSize
    ) throws IOException, InterruptedException {

  init(ugi, delegation, path, op, bufferSize);

  return ugi.doAs(new PrivilegedExceptionAction<Response>() {
    @Override
    public Response run() throws IOException {

  final String fullpath = path.getAbsolutePath();
  final DataNode datanode = (DataNode)context.getAttribute("datanode");

  switch(op.getValue()) {
  case APPEND:
  {
    final Configuration conf = new Configuration(datanode.getConf());
    final int b = bufferSize.getValue(conf);
    DFSClient dfsclient = new DFSClient(conf);
    FSDataOutputStream out = null;
    try {
      out = dfsclient.append(fullpath, b, null, null);
      IOUtils.copyBytes(in, out, b);
      out.close();
      out = null;
      dfsclient.close();
      dfsclient = null;
    } finally {
      IOUtils.cleanup(LOG, out);
      IOUtils.cleanup(LOG, dfsclient);
    }
    return Response.ok().type(MediaType.APPLICATION_OCTET_STREAM).build();
  }
  default:
    throw new UnsupportedOperationException(op + " is not supported");
  }
    }
  });
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:52,代码来源:DatanodeWebHdfsMethods.java


注:本文中的org.apache.hadoop.hdfs.web.resources.PostOpParam.DEFAULT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。