You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2019/02/13 14:14:37 UTC
[nifi] branch master updated: NIFI-6017 - ArrayIndexOutOfBounds
Load Balancer CorrelationAttributePartitioner
This is an automated email from the ASF dual-hosted git repository.
markap14 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new da8c8a1 NIFI-6017 - ArrayIndexOutOfBounds Load Balancer CorrelationAttributePartitioner
da8c8a1 is described below
commit da8c8a14a13e0f52ba6bdeaa34afdf3bf259d6b7
Author: Dorian Bugeja <do...@cerberus.io>
AuthorDate: Tue Feb 12 22:22:43 2019 +0100
NIFI-6017 - ArrayIndexOutOfBounds Load Balancer CorrelationAttributePartitioner
Signed-off-by: Mark Payne <ma...@hotmail.com>
---
.../queue/clustered/partition/CorrelationAttributePartitioner.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
index 12560d4..7529098 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/clustered/partition/CorrelationAttributePartitioner.java
@@ -36,7 +36,7 @@ public class CorrelationAttributePartitioner implements FlowFilePartitioner {
// implementation, but it's not clear at this point.
final int index;
if (partitions.length < 3) {
- index = hash % partitions.length;
+ index = Math.floorMod(hash, partitions.length);
} else {
index = Hashing.consistentHash(hash, partitions.length);
}