mirror of https://github.com/apache/nifi.git
NIFI-10744 Changed HashSet to LinkedHashSet in SegmentContent for deterministic handling
This closes #6700 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
4725ca36ba
commit
2d70bfb380
|
@ -20,6 +20,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -170,7 +171,7 @@ public class SegmentContent extends AbstractProcessor {
|
||||||
segmentAttributes.put(FRAGMENT_ID, segmentId);
|
segmentAttributes.put(FRAGMENT_ID, segmentId);
|
||||||
segmentAttributes.put(FRAGMENT_COUNT, String.valueOf(totalSegments));
|
segmentAttributes.put(FRAGMENT_COUNT, String.valueOf(totalSegments));
|
||||||
|
|
||||||
final Set<FlowFile> segmentSet = new HashSet<>();
|
final Set<FlowFile> segmentSet = new LinkedHashSet<>();
|
||||||
for (int i = 1; i <= totalSegments; i++) {
|
for (int i = 1; i <= totalSegments; i++) {
|
||||||
final long segmentOffset = segmentSize * (i - 1);
|
final long segmentOffset = segmentSize * (i - 1);
|
||||||
FlowFile segment = session.clone(flowFile, segmentOffset, Math.min(segmentSize, flowFile.getSize() - segmentOffset));
|
FlowFile segment = session.clone(flowFile, segmentOffset, Math.min(segmentSize, flowFile.getSize() - segmentOffset));
|
||||||
|
|
Loading…
Reference in New Issue