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:
sopan98 2022-11-21 23:30:31 -05:00 committed by exceptionfactory
parent 4725ca36ba
commit 2d70bfb380
No known key found for this signature in database
GPG Key ID: 29B6A52D2AAE8DBA
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -170,7 +171,7 @@ public class SegmentContent extends AbstractProcessor {
segmentAttributes.put(FRAGMENT_ID, segmentId);
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++) {
final long segmentOffset = segmentSize * (i - 1);
FlowFile segment = session.clone(flowFile, segmentOffset, Math.min(segmentSize, flowFile.getSize() - segmentOffset));