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

Tests should get the number of pending async delets via FsDatasetTestUtils

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7.1
    • 2.9.0, 3.0.0-alpha1
    • test
    • None

    Description

      A few unit tests use DataNodeTestUtils#getPendingAsyncDeletions to retrieve the number of pending async deletions. It internally calls FsDatasetTestUtil#getPendingAsyncDeletions:

      public static long getPendingAsyncDeletions(FsDatasetSpi<?> fsd) {
          return ((FsDatasetImpl)fsd).asyncDiskService.countPendingDeletions();
      }
      

      This assumes FsDatasetImpl is (the only implementation of) FsDataset. However FsDataset is pluggable and can have other implementations.

      We can abstract getting the number of async deletions in FsDatasetTestUtils.

      Attachments

        1. HDFS-9491.002.patch
          5 kB
          Tony Wu
        2. HDFS-9491.001.patch
          5 kB
          Tony Wu

        Activity

          People

            twu Tony Wu
            twu Tony Wu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: