You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2016/07/29 19:29:21 UTC

nifi git commit: NIFI-2245: - If a single response exists using it, instead of attempting to merge anything.

Repository: nifi
Updated Branches:
  refs/heads/master 0c8fc25ba -> a6d259ee0


NIFI-2245:
- If a single response exists using it, instead of attempting to merge anything.

This closes #743.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/a6d259ee
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/a6d259ee
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/a6d259ee

Branch: refs/heads/master
Commit: a6d259ee01a72b6b7e1cd2a8e0813adb5114e418
Parents: 0c8fc25
Author: Matt Gilman <ma...@gmail.com>
Authored: Fri Jul 29 09:33:55 2016 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Jul 29 15:29:06 2016 -0400

----------------------------------------------------------------------
 .../cluster/coordination/http/StandardHttpResponseMerger.java    | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/a6d259ee/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/StandardHttpResponseMerger.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/StandardHttpResponseMerger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/StandardHttpResponseMerger.java
index ad9f33f..f5e7d98 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/StandardHttpResponseMerger.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/StandardHttpResponseMerger.java
@@ -117,6 +117,10 @@ public class StandardHttpResponseMerger implements HttpResponseMerger {
 
     @Override
     public NodeResponse mergeResponses(final URI uri, final String httpMethod, final Set<NodeResponse> nodeResponses) {
+        if (nodeResponses.size() == 1) {
+            return nodeResponses.iterator().next();
+        }
+
         final boolean hasSuccess = hasSuccessfulResponse(nodeResponses);
         if (!hasSuccess) {
             // If we have a response that is a 3xx, 4xx, or 5xx, then we want to choose that.