activemq-gitbox mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3633: ARTEMIS-3243 Improve Mirror with dual mirror
Date Tue, 29 Jun 2021 16:42:00 GMT

clebertsuconic commented on a change in pull request #3633:
URL: https://github.com/apache/activemq-artemis/pull/3633#discussion_r660790822



##########
File path: artemis-commons/src/test/java/org/apache/activemq/artemis/utils/ByteUtilTest.java
##########
@@ -39,6 +39,49 @@
 
    private static Logger log = Logger.getLogger(ByteUtilTest.class);
 
+
+   @Test
+   public void testMixIDs1() {
+      long mixedID = ByteUtil.mixByteAndLong((byte)3, -1L);  // just a note, -1 is 0Xffffff....
+      Assert.assertEquals((byte)3, ByteUtil.getFirstByte(mixedID));
+
+      long mixedIDWithMaxValue = ByteUtil.mixByteAndLong((byte)3, Long.MAX_VALUE);
+      // first byte is 03, all the rest is fff...
+      Assert.assertEquals(0x03ffffffffffffffL, mixedIDWithMaxValue);
+      // -1 and fff should return you the same value when mixing 03, I'm doing this check
just in case.
+      Assert.assertEquals(mixedIDWithMaxValue, mixedID);

Review comment:
       the other option would be to store two objects on the queue, and make a slow operation
to acks. 
   
   I don't think it's feasible here.




-- 
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: gitbox-unsubscribe@activemq.apache.org

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



Mime
View raw message