Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13734

Swift lists empty file as directory

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: fs/swift
    • Labels:
      None

      Description

      Reproduce steps:
      1. Create a empty file on Swift via Swift client(e.g Cyberduck)
      2. Use Hadoop Swift API to get file status. The following is the code example:

              Configuration hadoopConf = new Configuration();
              hadoopConf.addResource("swift-site.xml"); // Set Swift configurations
      
              FileSystem fs = FileSystem.get(new URI("swift://bdd-edp.bddcs/"), hadoopConf);
              FileStatus[] statuses = fs.listStatus(new Path("/mydir"));
              for(FileStatus status : statuses) {
                  System.out.println(status);
              }
      

      Result:

      SwiftFileStatus{ path=swift://bdd-edp.bddcs/mydir/emptyfile; isDirectory=true; length=0; blocksize=33554432; modification_time=1476875293230}
      

      API treated empty file as a directory. That is incorrect.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kevinxhuang Kevin Huang

              Dates

              • Created:
                Updated:

                Issue deployment