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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: