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

Tests should get the number of pending async delets via FsDatasetTestUtils

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.9.0, 3.0.0-alpha1
    • Component/s: test
    • Labels:
      None
    • Target Version/s:

      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.001.patch
          5 kB
          Tony Wu
        2. HDFS-9491.002.patch
          5 kB
          Tony Wu

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: