You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "jonmeredith (via GitHub)" <gi...@apache.org> on 2023/03/02 17:58:16 UTC

[GitHub] [cassandra] jonmeredith commented on a diff in pull request #2107: Fix testReload in CompactionStrategyManagerBoundaryReloadTest

jonmeredith commented on code in PR #2107:
URL: https://github.com/apache/cassandra/pull/2107#discussion_r1123513964


##########
test/unit/org/apache/cassandra/db/compaction/CompactionStrategyManagerBoundaryReloadTest.java:
##########
@@ -67,11 +68,10 @@ public void testReload() throws UnknownHostException
         List<List<AbstractCompactionStrategy>> strategies = cfs.getCompactionStrategyManager().getStrategies();
         DiskBoundaries db = cfs.getDiskBoundaries();
         TokenMetadata tmd = StorageService.instance.getTokenMetadata();
-        byte[] tk1 = new byte[1], tk2 = new byte[1];
-        tk1[0] = 2;
-        tk2[0] = 1;
-        tmd.updateNormalToken(new ByteOrderedPartitioner.BytesToken(tk1), InetAddressAndPort.getByName("127.0.0.1"));
-        tmd.updateNormalToken(new ByteOrderedPartitioner.BytesToken(tk2), InetAddressAndPort.getByName("127.0.0.2"));
+        Token tk1 = new Murmur3Partitioner.LongToken(0);
+        Token tk2 = new Murmur3Partitioner.LongToken(Long.MAX_VALUE - 1);
+        tmd.updateNormalToken(tk1, InetAddressAndPort.getByName("127.0.0.1"));
+        tmd.updateNormalToken(tk2, InetAddressAndPort.getByName("127.0.0.2"));

Review Comment:
   ```suggestion
           tmd.updateNormalToken(tmd.partitioner.getMinimumToken(),
                                 InetAddressAndPort.getByName("127.0.0.1"));
           tmd.updateNormalToken(tmd.partitioner.getMaximumToken(),
                                 InetAddressAndPort.getByName("127.0.0.2"));```



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org