[
https://issues.apache.org/jira/browse/NIFI-14959?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael W Moser updated NIFI-14959:
-----------------------------------
Description:
CorrelationAttributePartitioner.findIndex always returns 0 if partitions == 2
Ways to reproduce. Added static to findIndex
{code:java}
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
int idx = findIndex(i, 2);
if (idx != 0) {
System.out.println(i);
}
} {code}
Assuming the attribute value for "Partition by attribute" would result in an
even distribution, the node at index 0 receives roughly 2/N flowfiles, one node
receives 0 flowfiles, and the other nodes receive 1/N flowfiles.
was:
CorrelationAttributePartitioner.findIndex always returns 0 if partitions == 2
Ways to reproduce. Added static to findIndex
{code:java}
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
int idx = findIndex(i, 2);
if (idx != 0) {
System.out.println(i);
}
} {code}
> Partition by attribute load balance strategy favors 1 node with more files
> --------------------------------------------------------------------------
>
> Key: NIFI-14959
> URL: https://issues.apache.org/jira/browse/NIFI-14959
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Andreas Koch
> Assignee: Michael W Moser
> Priority: Major
>
> CorrelationAttributePartitioner.findIndex always returns 0 if partitions == 2
> Ways to reproduce. Added static to findIndex
>
> {code:java}
> for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++) {
> int idx = findIndex(i, 2);
> if (idx != 0) {
> System.out.println(i);
> }
> } {code}
> Assuming the attribute value for "Partition by attribute" would result in an
> even distribution, the node at index 0 receives roughly 2/N flowfiles, one
> node receives 0 flowfiles, and the other nodes receive 1/N flowfiles.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)