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 2015/01/29 17:24:24 UTC

[2/4] incubator-nifi git commit: NIFI-250: Restore appropriate reporting task id on restart

NIFI-250: Restore appropriate reporting task id on restart


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

Branch: refs/heads/NIFI-250
Commit: 52d329ca036e059f50a169b726f4c202859ed0e1
Parents: 59f5b95
Author: Mark Payne <ma...@hotmail.com>
Authored: Thu Jan 29 10:02:15 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Thu Jan 29 10:02:15 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/nifi/controller/FlowController.java | 8 +++++---
 .../org/apache/nifi/controller/StandardFlowSynchronizer.java | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/52d329ca/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
index 297810b..209a4d6 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java
@@ -2469,12 +2469,14 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
     }
     
     public ReportingTaskNode createReportingTask(final String type, final boolean firstTimeAdded) throws ReportingTaskInstantiationException {
-        if (type == null) {
+    	return createReportingTask(type, UUID.randomUUID().toString(), firstTimeAdded);
+    }
+    
+    public ReportingTaskNode createReportingTask(final String type, final String id, final boolean firstTimeAdded) throws ReportingTaskInstantiationException {
+        if (type == null || id == null) {
             throw new NullPointerException();
         }
         
-        final String id = UUID.randomUUID().toString();
-
         ReportingTask task = null;
         final ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
         try {

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/52d329ca/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSynchronizer.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSynchronizer.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSynchronizer.java
index b8ad3ad..eb54839 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSynchronizer.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSynchronizer.java
@@ -379,7 +379,7 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
     private void addReportingTask(final FlowController controller, final Element reportingTaskElement, final StringEncryptor encryptor) throws ReportingTaskInstantiationException {
     	final ReportingTaskDTO dto = FlowFromDOMFactory.getReportingTask(reportingTaskElement, encryptor);
     	
-    	final ReportingTaskNode reportingTask = controller.createReportingTask(dto.getType(), false);
+    	final ReportingTaskNode reportingTask = controller.createReportingTask(dto.getType(), dto.getId(), false);
     	reportingTask.setName(dto.getName());
     	reportingTask.setComments(dto.getComment());
     	reportingTask.setAvailability(Availability.valueOf(dto.getAvailability()));