You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by tk...@apache.org on 2015/11/22 02:22:56 UTC

[1/2] nifi git commit: NIFI-1086: Changed behavior on retrieval with no input file to RETRIEVE events, removed @TriggerWhenEmpty

Repository: nifi
Updated Branches:
  refs/heads/master f1f67f639 -> 1580edb55


NIFI-1086: Changed behavior on retrieval with no input file to RETRIEVE events, removed @TriggerWhenEmpty

Reviewed by Tony Kurc (tkurc@apache.org)


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

Branch: refs/heads/master
Commit: cdd2c4f22cf9d309aff6ea2fa57f9557bc243006
Parents: f1f67f6
Author: Joseph Percivall <jo...@yahoo.com>
Authored: Sat Nov 21 16:04:13 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sat Nov 21 19:20:33 2015 -0500

----------------------------------------------------------------------
 .../nifi/processors/standard/InvokeHTTP.java     | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/cdd2c4f2/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
index 2a9760d..6d38bce 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
@@ -67,7 +67,6 @@ import org.apache.nifi.annotation.behavior.DynamicProperty;
 import org.apache.nifi.annotation.behavior.InputRequirement;
 import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
 import org.apache.nifi.annotation.behavior.SupportsBatching;
-import org.apache.nifi.annotation.behavior.TriggerWhenEmpty;
 import org.apache.nifi.annotation.behavior.WritesAttribute;
 import org.apache.nifi.annotation.behavior.WritesAttributes;
 import org.apache.nifi.annotation.documentation.CapabilityDescription;
@@ -96,7 +95,6 @@ import org.joda.time.format.DateTimeFormatter;
 @SupportsBatching
 @Tags({"http", "https", "rest", "client"})
 @InputRequirement(Requirement.INPUT_ALLOWED)
-@TriggerWhenEmpty
 @CapabilityDescription("An HTTP client processor which converts FlowFile attributes to HTTP headers, with configurable HTTP method, url, etc.")
 @WritesAttributes({
     @WritesAttribute(attribute = "invokehttp.status.code", description = "The status code that is returned"),
@@ -610,7 +608,11 @@ public final class InvokeHTTP extends AbstractProcessor {
 
                         // emit provenance event
                         final long millis = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNanos);
-                        session.getProvenanceReporter().fetch(responseFlowFile, url.toExternalForm(), millis);
+                        if(requestFlowFile != null) {
+                            session.getProvenanceReporter().fetch(responseFlowFile, url.toExternalForm(), millis);
+                        } else {
+                            session.getProvenanceReporter().receive(responseFlowFile, url.toExternalForm(), millis);
+                        }
                     }
                 }
 
@@ -775,13 +777,9 @@ public final class InvokeHTTP extends AbstractProcessor {
 
 
     private void route(FlowFile request, FlowFile response, ProcessSession session, ProcessContext context, int statusCode){
-        // check if we should penalize the request
-        if (!isSuccess(statusCode)) {
-            if (request == null) {
-                context.yield();
-            } else {
-                request = session.penalize(request);
-            }
+        // check if we should yield the processor
+        if (!isSuccess(statusCode) && request == null) {
+            context.yield();
         }
 
         // If the property to output the response flowfile regardless of status code is set then transfer it
@@ -805,6 +803,7 @@ public final class InvokeHTTP extends AbstractProcessor {
             // 5xx -> RETRY
         } else if (statusCode / 100 == 5) {
             if (request != null) {
+                request = session.penalize(request);
                 session.transfer(request, REL_RETRY);
             }
 


[2/2] nifi git commit: NIFI-1196 Correcting treatment of FETCH events as a continuation of a lineage trail and not the start of a new one.

Posted by tk...@apache.org.
NIFI-1196 Correcting treatment of FETCH events as a continuation of a lineage trail and not the start of a new one.

Reviewed by Tony Kurc (tkurc@apache.org)


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

Branch: refs/heads/master
Commit: 1580edb558e96dc49a40b50e8f5fd7e31e61371d
Parents: cdd2c4f
Author: Aldrin Piri <al...@apache.org>
Authored: Sat Nov 21 17:59:34 2015 -0500
Committer: Tony Kurc <tr...@gmail.com>
Committed: Sat Nov 21 20:21:36 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/nifi/provenance/StandardLineageResult.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/1580edb5/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
index cf16fc0..02c089d 100644
--- a/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
+++ b/nifi-commons/nifi-data-provenance-utils/src/main/java/org/apache/nifi/provenance/StandardLineageResult.java
@@ -259,6 +259,7 @@ public class StandardLineageResult implements ComputeLineageResult {
                 case FORK:
                 case JOIN:
                 case REPLAY:
+                case FETCH:
                 case CLONE: {
                     // For events that create FlowFile nodes, we need to create the FlowFile Nodes and associated Edges, as appropriate
                     for (final String childUuid : record.getChildUuids()) {
@@ -288,7 +289,6 @@ public class StandardLineageResult implements ComputeLineageResult {
                 }
                 break;
                 case RECEIVE:
-                case FETCH:
                 case CREATE: {
                     // for a receive event, we want to create a FlowFile Node that represents the FlowFile received
                     // and create an edge from the Receive Event to the FlowFile Node