rayman7718 commented on a change in pull request #1580:
URL: https://github.com/apache/samza/pull/1580#discussion_r797232872



##########
File path: 
samza-api/src/main/java/org/apache/samza/system/IncomingMessageEnvelope.java
##########
@@ -111,6 +111,13 @@ public SystemStreamPartition getSystemStreamPartition() {
     return systemStreamPartition;
   }
 
+  // used for elasticity to determine which elastic task should handle this 
envelope
+  public SystemStreamPartition getSystemStreamPartition(int elasticityFactor) {
+    Object envelopeKeyorOffset = key != null ? key : offset;
+    int keyBucket = Math.abs(envelopeKeyorOffset.hashCode() % 
elasticityFactor);

Review comment:
       10 % 3 is 1 
   -10 % 3 is 2, 
   so need to instead use Math.abs(envelopeKeyorOffset.hashCode()) % 
elasticityFactor ?




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


Reply via email to