315157973 edited a comment on pull request #9440:
URL: https://github.com/apache/pulsar/pull/9440#issuecomment-803400988


   > in order to implement hashCode you could add a static utility method that 
receives all of the relevant fields:
   public static int computeMessageIdHashCode(long ledgerId, long entryId, long 
partitionIndex, long batchIndex)
   
   `batchIndex` is an attribute that only BatchMessageId has, and it doesn't 
seem appropriate to put it in the top MessageId.
   
   I don’t know much about the historical reasons, why is there such a 
parameter as `NO_BATCH` in BatchMessageIdImpl
   
   There is a special treatment for NO_BATCH in equals. When batchIndex=-1 
(NO_BATCH), only ledgerId, entryId and partitionIndex need to be equal.
   
   Can the HashCode also be specially processed? When batchIndex=-1, batchIndex 
is not allowed to participate in the calculation of hashcode
   
   @eolivelli 


-- 
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:
us...@infra.apache.org


Reply via email to