XMLWordPrintableJSON

Details

    • Reviewed

    Description

      listFiles implementation gets the RemoteIterator created in InternalViewFSDirFs as the root is an InternalViewFSDir.  

      If there is a fallback and a file exist at root level, it would have collected when collecting locatedStatuses. 

      When its iterating over to that fallbacks file from  RemoteIterator (which was returned from InternalViewFSDirFs ), iterator's next will will call getFileBlockLocations if it's a file.

      @Override
      public LocatedFileStatus next() throws IOException {
       System.out.println(this);
       if (!hasNext()) {
       throw new NoSuchElementException("No more entries in " + f);
       }
       FileStatus result = stats[i++];
       // for files, use getBlockLocations(FileStatus, int, int) to avoid
       // calling getFileStatus(Path) to load the FileStatus again
       BlockLocation[] locs = result.isFile() ?
       getFileBlockLocations(result, 0, result.getLen()) :
       null;
       return new LocatedFileStatus(result, locs);
      }

       

      this getFileBlockLocations will be made on InternalViewFSDirFs, as that Iterator created originally from that fs. 

      InternalViewFSDirFs#getFileBlockLocations does not handle fallback cases. It's always expecting "/", this means it always assuming the dir.
      But with the fallback and returning Iterator from InternalViewFSDirFs, will create problems.

      Probably we need to handle fallback case in getFileBlockLocations as well.( Fallback only should be the reason for call coming to InternalViewFSDirFs with other than "/")

       

      Attachments

        Issue Links

          Activity

            People

              umamaheswararao Uma Maheswara Rao G
              umamaheswararao Uma Maheswara Rao G
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m