Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-246

Add a method to get file length for Seekable, FSDataInputStream and libhdfs

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When open any seekable file, it should be able to get the length of the file via Seekable interface, since the seek method should be able to detect seeking beyond the end of file. Such interface can benefit distributed file systems by saving a network round-trip of FileSystem.getFileStatus(Path).getLen() for any open file.
      In libhdfs, such interface should also be exposed to make native program taking advantage of this change.
      I have the changes locally for all FSInputStream concrete classes. The change can be considered trivial, since some of the FSInputStream classes already have a method named getFileLength(), or a member field named size/length/end.

      1. HADOOP-5143-2.patch
        10 kB
        Qi Liu
      2. HADOOP-5143.patch
        10 kB
        Qi Liu
      3. hadoop.patch
        11 kB
        Qi Liu

        Issue Links

          Activity

          Qi Liu created issue -
          Qi Liu made changes -
          Field Original Value New Value
          Attachment hadoop.patch [ 12399178 ]
          Qi Liu made changes -
          Attachment HADOOP-5143.patch [ 12405465 ]
          Qi Liu made changes -
          Attachment HADOOP-5143-2.patch [ 12406834 ]
          Owen O'Malley made changes -
          Project Hadoop Common [ 12310240 ] HDFS [ 12310942 ]
          Key HADOOP-5143 HDFS-246
          Affects Version/s 0.18.2 [ 12313424 ]
          Component/s fs [ 12310689 ]
          Component/s dfs [ 12310710 ]
          Component/s libhdfs [ 12311345 ]
          Tsz Wo Nicholas Sze made changes -
          Link This issue relates to HDFS-814 [ HDFS-814 ]
          Tsz Wo Nicholas Sze made changes -
          Link This issue relates to HDFS-691 [ HDFS-691 ]
          Hairong Kuang made changes -
          Assignee Qi Liu [ visualage ]
          Hairong Kuang made changes -
          Fix Version/s 0.22.0 [ 12314241 ]
          Nigel Daley made changes -
          Fix Version/s 0.22.0 [ 12314241 ]

            People

            • Assignee:
              Qi Liu
              Reporter:
              Qi Liu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:

                Development