Kerr0220 commented on code in PR #6507:
URL: https://github.com/apache/nifi/pull/6507#discussion_r994009564
##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/protocol/AbstractFlowFileServerProtocol.java:
##########
@@ -257,7 +259,13 @@ public int transferFlowFiles(final Peer peer, final
ProcessContext context, fina
session.read(flowFile, new InputStreamCallback() {
@Override
public void process(final InputStream in) throws IOException {
- final DataPacket dataPacket = new
StandardDataPacket(toSend.getAttributes(), in, toSend.getSize());
+ LinkedHashMap<String, String> attributes = new
LinkedHashMap<>();
+ String[] keySet =
toSend.getAttributes().keySet().toArray(new String[0]);
+ Arrays.sort(keySet);
+ for(String key: keySet){
+ attributes.put(key, toSend.getAttributes().get(key));
+ }
Review Comment:
Thank you for your suggestion! Your concern is reasonable which I haven't
thought about. I would make more effort to try fixing it by replacing the
initial storage of attributes from HashMap to LinkedHashMap. And you are right
that since it's a low-level change that may widely influence the entire module,
we still need to do more evaluation on whether to change it or just let it
remain the original way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]