Gerrrr commented on a change in pull request #1232:
URL: https://github.com/apache/cassandra/pull/1232#discussion_r720711120



##########
File path: test/unit/org/apache/cassandra/hints/HintsStoreTest.java
##########
@@ -137,6 +138,26 @@ public void testConcurrentDeleteExpiredHints() throws 
Exception {
         assertFalse("All hints files should be deleted", store.hasFiles());
     }
 
+    @Test
+    public void testPendingHintsInfo() throws Exception
+    {
+        HintsStore store = HintsCatalog.load(directory, 
ImmutableMap.of()).get(hostId);
+        assertEquals(new PendingHintsInfo(store.hostId, 0, Long.MAX_VALUE, 
Long.MIN_VALUE),

Review comment:
       I like your idea better! Let's use `null` instead of a dummy object - 
6f5f1e22cb23237bb07e76a5e38b20d9965dcf00.

##########
File path: test/unit/org/apache/cassandra/hints/HintsStoreTest.java
##########
@@ -137,6 +138,26 @@ public void testConcurrentDeleteExpiredHints() throws 
Exception {
         assertFalse("All hints files should be deleted", store.hasFiles());
     }
 
+    @Test
+    public void testPendingHintsInfo() throws Exception
+    {
+        HintsStore store = HintsCatalog.load(directory, 
ImmutableMap.of()).get(hostId);
+        assertEquals(new PendingHintsInfo(store.hostId, 0, Long.MAX_VALUE, 
Long.MIN_VALUE),
+                     store.getPendingHintsInfo());
+
+        final long t1 = System.currentTimeMillis();
+        writeHints(directory, new HintsDescriptor(hostId, t1), 100, t1);
+        store = HintsCatalog.load(directory, ImmutableMap.of()).get(hostId);
+        assertEquals(new PendingHintsInfo(store.hostId, 1, t1, t1),
+                     store.getPendingHintsInfo());
+        final long t2 = t1 + 1;
+        writeHints(directory, new HintsDescriptor(hostId, t2), 100, t2);
+        store = HintsCatalog.load(directory, ImmutableMap.of()).get(hostId);
+        assertEquals(new PendingHintsInfo(store.hostId, 2, t1, t2),
+                     store.getPendingHintsInfo());
+

Review comment:
       Fixed in 6f5f1e22cb23237bb07e76a5e38b20d9965dcf00.




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