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


##########
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);
+    } catch (ReflectiveOperationException e) {
+      throw new IllegalStateException("Failed to access pendingEvictionQueue 
via reflection", e);
+    }

Review Comment:
   Done



##########
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);
+    } catch (ReflectiveOperationException e) {
+      throw new IllegalStateException("Failed to access pendingEvictionQueue 
via reflection", e);
+    }
+  }
+
+  private static IOzoneManagerLock newAcquiringLock() {
+    IOzoneManagerLock acquiringLock = mock(IOzoneManagerLock.class);
+    when(acquiringLock.acquireReadLock(eq(SNAPSHOT_DB_LOCK), 
any(String[].class)))
+        .thenReturn(OMLockDetails.EMPTY_DETAILS_LOCK_ACQUIRED);
+    when(acquiringLock.releaseReadLock(eq(SNAPSHOT_DB_LOCK), 
any(String[].class)))
+        .thenReturn(OMLockDetails.EMPTY_DETAILS_LOCK_ACQUIRED);
+    when(acquiringLock.acquireResourceWriteLock(eq(SNAPSHOT_DB_LOCK)))
+        .thenReturn(OMLockDetails.EMPTY_DETAILS_LOCK_ACQUIRED);
+    when(acquiringLock.releaseResourceWriteLock(eq(SNAPSHOT_DB_LOCK)))
+        .thenReturn(OMLockDetails.EMPTY_DETAILS_LOCK_ACQUIRED);
+    when(acquiringLock.acquireWriteLock(eq(SNAPSHOT_DB_LOCK), 
any(String[].class)))
+        .thenReturn(OMLockDetails.EMPTY_DETAILS_LOCK_ACQUIRED);
+    when(acquiringLock.releaseWriteLock(eq(SNAPSHOT_DB_LOCK), 
any(String[].class)))
+        .thenReturn(OMLockDetails.EMPTY_DETAILS_LOCK_ACQUIRED);

Review Comment:
   Done



-- 
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