smengcl commented on code in PR #9869:
URL: https://github.com/apache/ozone/pull/9869#discussion_r2903232312


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotCache.java:
##########
@@ -511,4 +515,147 @@ void testSnapshotOperationsNotBlockedDuringCompaction() 
throws IOException, Inte
     verify(store1, times(1)).compactTable("table2");
     verify(store1, times(0)).compactTable("keyTable");
   }
+
+  @SuppressWarnings("unchecked")
+  private static Set<UUID> getPendingEvictionQueue(SnapshotCache cache) {
+    try {
+      Field f = SnapshotCache.class.getDeclaredField("pendingEvictionQueue");
+      f.setAccessible(true);
+      return (Set<UUID>) f.get(cache);

Review Comment:
   Using reflection to access private field in SnapshotCache is unstable. Why 
not just expose it via a `getPendingEvictionQueue()` method in SnapshotCache 
that has `@VisibleForTesting` annotation?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to