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

StreamFile.doGet(..) uses an additional RPC to get file length

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • datanode
    • None

    Description

      //StreamFile.doGet(..)
          long fileLen = dfs.getFileInfo(filename).getLen();
          FSInputStream in = dfs.open(filename);
      

      In the codes above, t is unnecessary to call getFileInfo(..), which is an additional RPC to namenode. The file length can be obtained from the input stream after open(..).

      Attachments

        Issue Links

          Activity

            People

              szetszwo Tsz-wo Sze
              szetszwo Tsz-wo Sze
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: