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

Use Path instead of String in the TestHdfsAdmin.verifyOpenFiles()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 3.3.0
    • None
    • None

    Description

      closedFiles is a set of Path, therefor closedFiles.contains(String) doesn't make sense.

      lines 252-261:

        private void verifyOpenFiles(HashSet<Path> closedFiles,
            HashMap<Path, FSDataOutputStream> openFileMap) throws IOException {
          HdfsAdmin hdfsAdmin = new HdfsAdmin(FileSystem.getDefaultUri(conf), conf);
          HashSet<Path> openFiles = new HashSet<>(openFileMap.keySet());
          RemoteIterator<OpenFileEntry> openFilesRemoteItr =
              hdfsAdmin.listOpenFiles();
          while (openFilesRemoteItr.hasNext()) {
            String filePath = openFilesRemoteItr.next().getFilePath();
            assertFalse(filePath + " should not be listed under open files!",
                closedFiles.contains(filePath));
      

      Attachments

        1. HDFS-12315.patch
          1 kB
          Oleg Danilov

        Activity

          People

            olegd Oleg Danilov
            olegd Oleg Danilov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: