[ 
https://issues.apache.org/jira/browse/ARTEMIS-3243?focusedWorklogId=610053&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-610053
 ]

ASF GitHub Bot logged work on ARTEMIS-3243:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jun/21 07:13
            Start Date: 14/Jun/21 07:13
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on a change in pull request #3545:
URL: https://github.com/apache/activemq-artemis/pull/3545#discussion_r649980472



##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java
##########
@@ -233,6 +233,21 @@ public static void longToBytes(long x, byte[] output, int 
offset) {
       output[offset + 7] = (byte)(x);
    }
 
+   /** the byte ID goes to the first byte, everything else stays where they 
are. */
+   public static long mixByteAndLong(byte id, long longID) {

Review comment:
       I'm not talking about if it belongs to a server, but whether this method 
overwrites any data in the high order bits of the ID when munging the two 
values together.

##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ByteUtil.java
##########
@@ -205,23 +205,49 @@ public static int bytesToInt(byte[] b) {
             | ((int) b[0] & 0xff) << 24;
    }
 
+   public static long bytesToLong(byte[] b) {
+      return ((long) b[7] & 0xff)
+         | ((long) b[6] & 0xff) << 8
+         | ((long) b[5] & 0xff) << 16
+         | ((long) b[4] & 0xff) << 24
+         | ((long) b[3] & 0xff) << 32
+         | ((long) b[2] & 0xff) << 40
+         | ((long) b[1] & 0xff) << 48
+         | ((long) b[0] & 0xff) << 56;
+   }
+
    public static byte[] longToBytes(long value) {
       byte[] output = new byte[8];
       longToBytes(value, output, 0);
       return output;
    }
 
    public static void longToBytes(long x, byte[] output, int offset) {
-      output[offset] = (byte)(x >> 56);
-      output[offset + 1] = (byte)(x >> 48);
-      output[offset + 2] = (byte)(x >> 40);
-      output[offset + 3] = (byte)(x >> 32);
-      output[offset + 4] = (byte)(x >> 24);
-      output[offset + 5] = (byte)(x >> 16);
-      output[offset + 6] = (byte)(x >>  8);
+      output[offset] = (byte)(x >>> 56);
+      output[offset + 1] = (byte)(x >>> 48);
+      output[offset + 2] = (byte)(x >>> 40);
+      output[offset + 3] = (byte)(x >>> 32);
+      output[offset + 4] = (byte)(x >>> 24);
+      output[offset + 5] = (byte)(x >>> 16);
+      output[offset + 6] = (byte)(x >>>  8);

Review comment:
       I still don't see that the way it is used leaves room for a difference, 
it never seems to store the value or access the bits that the shifting makes a 
difference to.
   
   Regardless, if you found a defect, add a test for it when you resolve it, 
makes it clearer what is being fixed and can save discussions like this.

##########
File path: 
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/connect/AMQPBrokerConnection.java
##########
@@ -490,12 +495,18 @@ private void connectSender(Queue queue,
             Source source = new Source();
             source.setAddress(queue.getAddress().toString());
             sender.setSource(source);
+            HashMap<Symbol, Object> mapProperties = new HashMap<>(1);

Review comment:
       Try debugging it. Unless its changed, it will resize itself again 
immediately during/after insertion due to exceeding the load-factor.




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

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 610053)
    Time Spent: 1h 10m  (was: 1h)

> Enhance AMQP Mirror support with dual mirror
> --------------------------------------------
>
>                 Key: ARTEMIS-3243
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3243
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.17.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.18.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> at the current Mirror version, we can only mirror into a single direction.
> With this enhancement the two (or more brokers) would be connected to each 
> other, each one having its own ID, and each one would send updates to the 
> other broker.
> The outcome is that if you just transferred producers and consumers from one 
> broker into the other, the fallback would be automatic and simple. No need to 
> disable and enable mirror options.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to