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

getFileInfo of libhdfs call NameNode#getFileStatus twice

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • libhdfs
    • 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

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

              Dates

                Created:
                Updated: