Package org.apache.hadoop.hdfs.web.resources

Examples of org.apache.hadoop.hdfs.web.resources.LengthParam


      final long offset, final long length) throws IOException {
    statistics.incrementReadOps(1);

    final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS;
    final Map<?, ?> m = run(op, p, new OffsetParam(offset),
        new LengthParam(length));
    return DFSUtil.locatedBlocks2Locations(JsonUtil.toLocatedBlocks(m));
  }
View Full Code Here


      final long offset, final long length) throws IOException {
    statistics.incrementReadOps(1);

    final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS;
    final Map<?, ?> m = run(op, p, new OffsetParam(offset),
        new LengthParam(length));
    return DFSUtil.locatedBlocks2Locations(JsonUtil.toLocatedBlocks(m));
  }
View Full Code Here

      IOUtils.closeStream(testFileOut);
    }

    // Open the file, but request length longer than actual file length by 1.
    HttpOpParam.Op op = GetOpParam.Op.OPEN;
    URL url = webhdfs.toUrl(op, testFile, new LengthParam(Long.valueOf(
      content.length() + 1)));
    HttpURLConnection conn = null;
    InputStream is = null;
    try {
      conn = (HttpURLConnection)url.openConnection();
View Full Code Here

    }

    // Open the file, but request offset starting at 1 and length equal to file
    // length.  Considering the offset, this is longer than the actual content.
    HttpOpParam.Op op = GetOpParam.Op.OPEN;
    URL url = webhdfs.toUrl(op, testFile, new LengthParam(Long.valueOf(
      content.length())), new OffsetParam(1L));
    HttpURLConnection conn = null;
    InputStream is = null;
    try {
      conn = (HttpURLConnection)url.openConnection();
View Full Code Here

      final long offset, final long length) throws IOException {
    statistics.incrementReadOps(1);

    final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS;
    final Map<?, ?> m = run(op, p, new OffsetParam(offset),
        new LengthParam(length));
    return DFSUtil.locatedBlocks2Locations(JsonUtil.toLocatedBlocks(m));
  }
View Full Code Here

      final long offset, final long length) throws IOException {
    statistics.incrementReadOps(1);

    final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS;
    final Map<?, ?> m = run(op, p, new OffsetParam(offset),
        new LengthParam(length));
    return DFSUtil.locatedBlocks2Locations(JsonUtil.toLocatedBlocks(m));
  }
View Full Code Here

    statistics.incrementReadOps(1);

    final Path p = status.getPath();
    final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS;
    final Map<?, ?> m = run(op, p, new OffsetParam(offset),
        new LengthParam(length));
    return DFSUtil.locatedBlocks2Locations(JsonUtil.toLocatedBlocks(m));
  }
View Full Code Here

      IOUtils.closeStream(testFileOut);
    }

    // Open the file, but request length longer than actual file length by 1.
    HttpOpParam.Op op = GetOpParam.Op.OPEN;
    URL url = webhdfs.toUrl(op, testFile, new LengthParam(Long.valueOf(
      content.length() + 1)));
    HttpURLConnection conn = null;
    InputStream is = null;
    try {
      conn = (HttpURLConnection)url.openConnection();
View Full Code Here

    }

    // Open the file, but request offset starting at 1 and length equal to file
    // length.  Considering the offset, this is longer than the actual content.
    HttpOpParam.Op op = GetOpParam.Op.OPEN;
    URL url = webhdfs.toUrl(op, testFile, new LengthParam(Long.valueOf(
      content.length())), new OffsetParam(1L));
    HttpURLConnection conn = null;
    InputStream is = null;
    try {
      conn = (HttpURLConnection)url.openConnection();
View Full Code Here

      final long offset, final long length) throws IOException {
    statistics.incrementReadOps(1);

    final HttpOpParam.Op op = GetOpParam.Op.GET_BLOCK_LOCATIONS;
    final Map<?, ?> m = run(op, p, new OffsetParam(offset),
        new LengthParam(length));
    return DFSUtil.locatedBlocks2Locations(JsonUtil.toLocatedBlocks(m));
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.web.resources.LengthParam

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.