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 <[email protected]>
AuthorDate: Tue Feb 12 22:22:43 2019 +0100
NIFI-6017 - ArrayIndexOutOfBounds Load Balancer
CorrelationAttributePartitioner
Signed-off-by: Mark Payne <[email protected]>
---
.../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);
}