Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13984

getFileInfo of libhdfs call NameNode#getFileStatus twice

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: libhdfs
    • Labels:
      None

      Description

      getFileInfo in hdfs.c calls FileSystem#exists first, then calls FileSystem#getFileStatus.

      FileSystem#exists also call FileSystem#getFileStatus, just as follows:

        public boolean exists(Path f) throws IOException {
          try {
            return getFileStatus(f) != null;
          } catch (FileNotFoundException e) {
            return false;
          }
        }
      

      and finally this leads to call NameNodeRpcServer#getFileInfo twice.
      Actually we can implement by calling once.

        Attachments

        1. HDFS-13984.003.patch
          2 kB
          Jiandan Yang
        2. HDFS-13984.002.patch
          2 kB
          Jiandan Yang
        3. HDFS-13984.001.patch
          2 kB
          Jiandan Yang

          Issue Links

            Activity

              People

              • Assignee:
                yangjiandan Jiandan Yang
                Reporter:
                yangjiandan Jiandan Yang
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: