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/27 15:48:58 UTC

[1/4] incubator-nifi git commit: NIFI-250: Only run controller services and reporting tasks on the nodes/ncm according to their Availability

Repository: incubator-nifi
Updated Branches:
  refs/heads/NIFI-250 cb84829b3 -> ea17dbec6


NIFI-250: Only run controller services and reporting tasks on the nodes/ncm according to their Availability


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

Branch: refs/heads/NIFI-250
Commit: 4de0fd02678ce13d5a8b08edbc35a677560ded4d
Parents: 2df4500
Author: Mark Payne <ma...@hotmail.com>
Authored: Mon Jan 26 19:05:31 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Mon Jan 26 19:05:31 2015 -0500

----------------------------------------------------------------------
 .../cluster/manager/impl/WebClusterManager.java | 16 ++++++++
 .../apache/nifi/controller/FlowController.java  | 40 ++++++++++++++++++--
 2 files changed, 52 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4de0fd02/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
index 9d9640d..27620b5 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-cluster/src/main/java/org/apache/nifi/cluster/manager/impl/WebClusterManager.java
@@ -121,6 +121,7 @@ import org.apache.nifi.cluster.protocol.message.ProtocolMessage.MessageType;
 import org.apache.nifi.cluster.protocol.message.ReconnectionFailureMessage;
 import org.apache.nifi.cluster.protocol.message.ReconnectionRequestMessage;
 import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.Availability;
 import org.apache.nifi.controller.ControllerService;
 import org.apache.nifi.controller.Heartbeater;
 import org.apache.nifi.controller.ReportingTaskNode;
@@ -128,6 +129,7 @@ import org.apache.nifi.controller.ValidationContextFactory;
 import org.apache.nifi.controller.reporting.ClusteredReportingTaskNode;
 import org.apache.nifi.controller.reporting.ReportingTaskInstantiationException;
 import org.apache.nifi.controller.reporting.StandardReportingInitializationContext;
+import org.apache.nifi.controller.scheduling.QuartzSchedulingAgent;
 import org.apache.nifi.controller.scheduling.StandardProcessScheduler;
 import org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent;
 import org.apache.nifi.controller.service.ControllerServiceNode;
@@ -393,7 +395,11 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
             public void heartbeat() {
             }
         }, this, encryptor);
+        
+        // When we construct the scheduling agents, we can pass null for a lot of the arguments because we are only
+        // going to be scheduling Reporting Tasks. Otherwise, it would not be okay.
         processScheduler.setSchedulingAgent(SchedulingStrategy.TIMER_DRIVEN, new TimerDrivenSchedulingAgent(null, reportingTaskEngine, null, encryptor));
+        processScheduler.setSchedulingAgent(SchedulingStrategy.CRON_DRIVEN, new QuartzSchedulingAgent(null, reportingTaskEngine, null, encryptor));
         processScheduler.setMaxThreadCount(SchedulingStrategy.TIMER_DRIVEN, 10);
         processScheduler.setMaxThreadCount(SchedulingStrategy.CRON_DRIVEN, 10);
     }
@@ -1338,11 +1344,21 @@ public class WebClusterManager implements HttpClusterManager, ProtocolHandler, C
 
     @Override
     public void enableControllerService(final ControllerServiceNode serviceNode) {
+    	if ( serviceNode.getAvailability() == Availability.NODE_ONLY ) {
+    		serviceNode.setDisabled(false);	// update disabled flag to stay in sync across cluster
+        	return;
+        }
+    	
         controllerServiceProvider.enableControllerService(serviceNode);
     }
     
     @Override
     public void disableControllerService(final ControllerServiceNode serviceNode) {
+    	if ( serviceNode.getAvailability() == Availability.NODE_ONLY ) {
+    		serviceNode.setDisabled(true);	// update disabled flag to stay in sync across cluster
+        	return;
+        }
+    	
         controllerServiceProvider.disableControllerService(serviceNode);
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/4de0fd02/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 47e26c0..a215938 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
@@ -2518,16 +2518,30 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
     }
 
     public void startReportingTask(final ReportingTaskNode reportingTaskNode) {
+    	if ( reportingTaskNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+    		reportingTaskNode.setScheduledState(ScheduledState.RUNNING); // updated scheduled state to keep state in sync across cluster
+        	return;
+        }
+    	
         if (isTerminated()) {
             throw new IllegalStateException("Cannot start reporting task " + reportingTaskNode + " because the controller is terminated");
         }
 
+        if ( reportingTaskNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+        	return;
+        }
+
         reportingTaskNode.verifyCanStart();
-        
-        processScheduler.schedule(reportingTaskNode);
+       	processScheduler.schedule(reportingTaskNode);
     }
 
+    
     public void stopReportingTask(final ReportingTaskNode reportingTaskNode) {
+    	if ( reportingTaskNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+    		reportingTaskNode.setScheduledState(ScheduledState.STOPPED); // updated scheduled state to keep state in sync across cluster
+        	return;
+        }
+    	
         if (isTerminated()) {
             return;
         }
@@ -2646,25 +2660,43 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
     }
     
     public void enableReportingTask(final ReportingTaskNode reportingTaskNode) {
+    	if ( reportingTaskNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+    		reportingTaskNode.setScheduledState(ScheduledState.STOPPED); // updated scheduled state to keep state in sync across cluster
+        	return;
+        }
+    	
         reportingTaskNode.verifyCanEnable();
-        
         processScheduler.enableReportingTask(reportingTaskNode);
     }
     
     public void disableReportingTask(final ReportingTaskNode reportingTaskNode) {
+    	if ( reportingTaskNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+    		reportingTaskNode.setScheduledState(ScheduledState.DISABLED); // updated scheduled state to keep state in sync across cluster
+        	return;
+        }
+    	
         reportingTaskNode.verifyCanDisable();
-        
         processScheduler.disableReportingTask(reportingTaskNode);
     }
     
     @Override
     public void enableControllerService(final ControllerServiceNode serviceNode) {
+        if ( serviceNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+        	serviceNode.setDisabled(false);	// set the disabled flag so that we can keep in sync with cluster
+        	return;
+        }
+
         serviceNode.verifyCanEnable();
         controllerServiceProvider.enableControllerService(serviceNode);
     }
     
     @Override
     public void disableControllerService(final ControllerServiceNode serviceNode) {
+    	if ( serviceNode.getAvailability() == Availability.CLUSTER_MANAGER_ONLY ) {
+        	serviceNode.setDisabled(true);	// set the disabled flag so that we can keep in sync with cluster
+        	return;
+        }
+    	
         serviceNode.verifyCanDisable();
         controllerServiceProvider.disableControllerService(serviceNode);
     }


[2/4] incubator-nifi git commit: Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250

Posted by ma...@apache.org.
Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250


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

Branch: refs/heads/NIFI-250
Commit: 24b4f1cf1109af53d6fd94d81fe81141e7dd0423
Parents: 4de0fd0 cb84829
Author: Mark Payne <ma...@hotmail.com>
Authored: Tue Jan 27 08:36:57 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Tue Jan 27 08:36:57 2015 -0500

----------------------------------------------------------------------
 .../org/apache/nifi/web/api/dto/ControllerServiceDTO.java | 10 +++++-----
 .../org/apache/nifi/controller/FlowFromDOMFactory.java    |  2 +-
 .../apache/nifi/controller/StandardFlowSynchronizer.java  |  2 +-
 .../org/apache/nifi/fingerprint/FingerprintFactory.java   |  2 +-
 .../apache/nifi/web/api/ControllerServiceResource.java    |  1 +
 .../main/java/org/apache/nifi/web/api/dto/DtoFactory.java |  2 ++
 6 files changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------



[4/4] incubator-nifi git commit: NIFI-250: Renamed 'getComment' and 'setComment' in ControllerServiceNode and ReportingTaskNode to 'getComments' and 'setComments' to be more consistent with how naming throughout the rest of the app

Posted by ma...@apache.org.
NIFI-250: Renamed 'getComment' and 'setComment' in ControllerServiceNode and ReportingTaskNode to 'getComments' and 'setComments' to be more consistent with how naming throughout the rest of the app


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

Branch: refs/heads/NIFI-250
Commit: ea17dbec6e1b4384c91fab9e54e30b29c6190c8d
Parents: f14a34f
Author: Mark Payne <ma...@hotmail.com>
Authored: Tue Jan 27 09:48:45 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Tue Jan 27 09:48:45 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/nifi/controller/ReportingTaskNode.java  | 4 ++--
 .../apache/nifi/controller/service/ControllerServiceNode.java    | 4 ++--
 .../java/org/apache/nifi/controller/StandardFlowSerializer.java  | 4 ++--
 .../org/apache/nifi/controller/StandardFlowSynchronizer.java     | 4 ++--
 .../nifi/controller/reporting/AbstractReportingTaskNode.java     | 4 ++--
 .../nifi/controller/service/StandardControllerServiceNode.java   | 4 ++--
 .../src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java    | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java
index cf81352..c4960a9 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ReportingTaskNode.java
@@ -68,9 +68,9 @@ public interface ReportingTaskNode extends ConfiguredComponent {
     
     void setScheduledState(ScheduledState state);
     
-    String getComment();
+    String getComments();
     
-    void setComment(String comment);
+    void setComments(String comment);
     
     void verifyCanStart();
     void verifyCanStop();

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java
index 32b9d9e..bf6b888 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/service/ControllerServiceNode.java
@@ -40,8 +40,8 @@ public interface ControllerServiceNode extends ConfiguredComponent {
 
     void removeReference(ConfiguredComponent referringComponent);
     
-    void setComment(String comment);
-    String getComment();
+    void setComments(String comment);
+    String getComments();
     
     void verifyCanEnable();
     void verifyCanDisable();

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSerializer.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSerializer.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSerializer.java
index 218813a..1f483ed 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSerializer.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardFlowSerializer.java
@@ -410,7 +410,7 @@ public class StandardFlowSerializer implements FlowSerializer {
     	final Element serviceElement = element.getOwnerDocument().createElement("controllerService");
     	addTextElement(serviceElement, "id", serviceNode.getIdentifier());
     	addTextElement(serviceElement, "name", serviceNode.getName());
-    	addTextElement(serviceElement, "comment", serviceNode.getComment());
+    	addTextElement(serviceElement, "comment", serviceNode.getComments());
     	addTextElement(serviceElement, "class", serviceNode.getControllerServiceImplementation().getClass().getCanonicalName());
         addTextElement(serviceElement, "enabled", String.valueOf(!serviceNode.isDisabled()));
         addTextElement(serviceElement, "availability", serviceNode.getAvailability().toString());
@@ -424,7 +424,7 @@ public class StandardFlowSerializer implements FlowSerializer {
     	final Element taskElement = element.getOwnerDocument().createElement("reportingTask");
     	addTextElement(taskElement, "id", taskNode.getIdentifier());
     	addTextElement(taskElement, "name", taskNode.getName());
-    	addTextElement(taskElement, "comment", taskNode.getComment());
+    	addTextElement(taskElement, "comment", taskNode.getComments());
     	addTextElement(taskElement, "class", taskNode.getReportingTask().getClass().getCanonicalName());
         addTextElement(taskElement, "schedulingPeriod", taskNode.getSchedulingPeriod());
         addTextElement(taskElement, "scheduledState", taskNode.getScheduledState().name());

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/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 887363e..560c884 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
@@ -348,7 +348,7 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
     	final ControllerServiceNode node = controller.createControllerService(dto.getType(), false);
     	node.setName(dto.getName());
     	node.setAvailability(Availability.valueOf(dto.getAvailability()));
-    	node.setComment(dto.getComments());
+    	node.setComments(dto.getComments());
     	node.setDisabled(dto.getEnabled() != Boolean.TRUE);
     	node.setAnnotationData(dto.getAnnotationData());
     	
@@ -377,7 +377,7 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
     	
     	final ReportingTaskNode reportingTask = controller.createReportingTask(dto.getType(), false);
     	reportingTask.setName(dto.getName());
-    	reportingTask.setComment(dto.getComment());
+    	reportingTask.setComments(dto.getComment());
     	reportingTask.setAvailability(Availability.valueOf(dto.getAvailability()));
     	reportingTask.setScheduldingPeriod(dto.getSchedulingPeriod());
     	reportingTask.setScheduledState(ScheduledState.valueOf(dto.getScheduledState()));

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java
index 014fe55..8a131d0 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/reporting/AbstractReportingTaskNode.java
@@ -160,12 +160,12 @@ public abstract class AbstractReportingTaskNode extends AbstractConfiguredCompon
     }
     
     @Override
-    public String getComment() {
+    public String getComments() {
 		return comment;
 	}
 
     @Override
-	public void setComment(final String comment) {
+	public void setComments(final String comment) {
 		this.comment = comment;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
index f5776ce..dd06f40 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/service/StandardControllerServiceNode.java
@@ -196,7 +196,7 @@ public class StandardControllerServiceNode extends AbstractConfiguredComponent i
     }
     
     @Override
-    public String getComment() {
+    public String getComments() {
     	readLock.lock();
     	try {
     		return comment;
@@ -206,7 +206,7 @@ public class StandardControllerServiceNode extends AbstractConfiguredComponent i
     }
     
     @Override
-    public void setComment(final String comment) {
+    public void setComments(final String comment) {
     	writeLock.lock();
     	try {
     		this.comment = comment;

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea17dbec/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index 16ba1cd..132797d 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -845,7 +845,7 @@ public final class DtoFactory {
         dto.setType(controllerServiceNode.getControllerServiceImplementation().getClass().getName());
         dto.setAvailability(controllerServiceNode.getAvailability().name());
         dto.setEnabled(!controllerServiceNode.isDisabled());
-        dto.setComments(controllerServiceNode.getComment());
+        dto.setComments(controllerServiceNode.getComments());
         
         // sort a copy of the properties
         final Map<PropertyDescriptor, String> sortedProperties = new TreeMap<>(new Comparator<PropertyDescriptor>() {


[3/4] incubator-nifi git commit: NIFI-250: Updated flow.xml schema to take reporting tasks and controller services into account; removed schemas for reporting tasks and controller services.

Posted by ma...@apache.org.
NIFI-250: Updated flow.xml schema to take reporting tasks and controller services into account; removed schemas for reporting tasks and controller services.


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

Branch: refs/heads/NIFI-250
Commit: f14a34f6686621501ddcc68efbcc64f001c96ab8
Parents: 24b4f1c
Author: Mark Payne <ma...@hotmail.com>
Authored: Tue Jan 27 09:22:40 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Tue Jan 27 09:22:40 2015 -0500

----------------------------------------------------------------------
 .../ControllerServiceConfiguration.xsd          | 61 --------------
 .../src/main/resources/FlowConfiguration.xsd    | 59 +++++++++++--
 .../resources/ReportingTaskConfiguration.xsd    | 87 --------------------
 3 files changed, 54 insertions(+), 153 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f14a34f6/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ControllerServiceConfiguration.xsd
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ControllerServiceConfiguration.xsd b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ControllerServiceConfiguration.xsd
deleted file mode 100644
index d3efed1..0000000
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ControllerServiceConfiguration.xsd
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-      http://www.apache.org/licenses/LICENSE-2.0
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
-    <xs:element name="services" type="ControllerServices"/>
-
-    <xs:complexType name="ControllerServices">
-        <xs:sequence>
-
-            <!-- Each "processor" defines the actual dataflow work horses that make dataflow happen-->
-            <xs:element name="service" type="ControllerServiceType" minOccurs="0" maxOccurs="unbounded"/>
-
-        </xs:sequence>
-    </xs:complexType>
-
-    <!-- the Controller Task "id" is a key that should be valid within each flowController-->
-    <xs:complexType name="ControllerServiceType">
-        <xs:sequence>
-
-            <!-- The "id" is a name used to uniquely identify the Controller Task. -->
-            <xs:element name="identifier" type="NonEmptyStringType"/>
-
-            <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1" />
-
-            <!-- "class" is the actual Java class that performs the type of controller task desired-->
-            <xs:element name="class" type="NonEmptyStringType"/>
-
-            <!-- "optionalTaskProperty" are properties that may exist and offer further information about a task.
-            For instance, information about where a specific task should send information. -->
-            <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
-        </xs:sequence>
-    </xs:complexType>
-
-    <!-- Name/Value properties-->
-    <xs:complexType name="PropertyType">
-        <xs:simpleContent>
-            <xs:extension base="xs:string">
-                <xs:attribute name="name" type="xs:string"></xs:attribute>
-            </xs:extension>
-        </xs:simpleContent>
-    </xs:complexType>
-
-
-    <xs:simpleType name="NonEmptyStringType">
-        <xs:restriction base="xs:string">
-            <xs:minLength value="1"/>
-        </xs:restriction>
-    </xs:simpleType>
-</xs:schema>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f14a34f6/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/FlowConfiguration.xsd
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/FlowConfiguration.xsd b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/FlowConfiguration.xsd
index 1e6c25c..e2f146f 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/FlowConfiguration.xsd
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/FlowConfiguration.xsd
@@ -28,6 +28,10 @@
 
             <!-- Groupings of Processors/Ports -->
             <xs:element name="rootGroup" type="RootProcessGroupType" />
+            
+            <xs:element name="controllerServices" type="ControllerServicesType" minOccurs="0" maxOccurs="1" />
+            
+            <xs:element name="reportingTasks" type="ReportingTasksType" minOccurs="0" maxOccurs="1" />
         </xs:sequence>
     </xs:complexType>
 	
@@ -58,11 +62,6 @@
             IFF schedulingStrategy is EVENT_DRIVEN -->
             <xs:element name="maxConcurrentTasks" type="xs:nonNegativeInteger"/>
 
-            <!-- "schedulingPeriodSeconds" is the maximum number of seconds that should elapse
-            between successive executions of each task for this configured processor.  If a
-            task takes longer than the period specified then the next execution of this
-            task will take place immediately after termination of the previous run and as soon
-            as their is an available thread.-->
             <xs:element name="schedulingPeriod" type="NonEmptyStringType"/>
             
             <xs:element name="penalizationPeriod" type="TimePeriod" />
@@ -332,4 +331,54 @@
             <xs:enumeration value="CRON_DRIVEN"></xs:enumeration>
         </xs:restriction>
     </xs:simpleType>
+    
+    <xs:complexType name="ControllerServicesType">
+    	<xs:sequence>
+    		<xs:element name="controllerService" type="ControllerServiceType" minOccurs="0" maxOccurs="unbounded" />
+    	</xs:sequence>
+    </xs:complexType>
+    
+    <xs:complexType name="ControllerServiceType">
+    	<xs:sequence>
+    		<xs:element name="id" type="NonEmptyStringType" />
+    		<xs:element name="name" type="NonEmptyStringType" />
+    		<xs:element name="comment" type="xs:string" />
+    		<xs:element name="class" type="NonEmptyStringType" />
+    		<xs:element name="enabled" type="xs:boolean" />
+    		<xs:element name="availability" type="Availability" />
+    		
+            <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="annotationData" type="xs:string" minOccurs="0" maxOccurs="1" />
+    	</xs:sequence>
+    </xs:complexType>
+    
+    <xs:simpleType name="Availability">
+    	<xs:restriction base="xs:string">
+    		<xs:enumeration value="CLUSTER_MANAGER_ONLY"></xs:enumeration>
+    		<xs:enumeration value="NODE_ONLY"></xs:enumeration>
+    		<xs:enumeration value="BOTH"></xs:enumeration>
+    	</xs:restriction>
+    </xs:simpleType>
+    
+    <xs:complexType name="ReportingTasksType">
+    	<xs:sequence>
+    		<xs:element name="reportingTask" type="ReportingTaskType" minOccurs="0" maxOccurs="unbounded" />
+    	</xs:sequence>
+    </xs:complexType>
+    
+    <xs:complexType name="ReportingTaskType">
+    	<xs:sequence>
+    		<xs:element name="id" type="NonEmptyStringType" />
+    		<xs:element name="name" type="NonEmptyStringType" />
+    		<xs:element name="comment" type="xs:string" />
+    		<xs:element name="class" type="NonEmptyStringType" />
+            <xs:element name="schedulingPeriod" type="NonEmptyStringType"/>
+            <xs:element name="schedulingState" type="ScheduledState" />
+            <xs:element name="schedulingStrategy" type="SchedulingStrategy" />
+            <xs:element name="availability" type="Availability" />
+    		
+            <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="annotationData" type="xs:string" minOccurs="0" maxOccurs="1" />
+    	</xs:sequence>
+    </xs:complexType>
 </xs:schema>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/f14a34f6/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ReportingTaskConfiguration.xsd
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ReportingTaskConfiguration.xsd b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ReportingTaskConfiguration.xsd
deleted file mode 100644
index dcf1090..0000000
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/ReportingTaskConfiguration.xsd
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-      http://www.apache.org/licenses/LICENSE-2.0
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
-    <xs:element name="tasks" type="ReportingTasks"/>
-
-    <xs:complexType name="ReportingTasks">
-        <xs:sequence>
-
-            <!-- properties that may exist and offer further information about all tasks.
-            For instance, possibly the system that is sending the information. -->
-            <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded"/>
-
-            <!-- Each "processor" defines the actual dataflow work horses that make dataflow happen-->
-            <xs:element name="task" type="ReportingTaskType" minOccurs="0" maxOccurs="unbounded"/>
-
-        </xs:sequence>
-    </xs:complexType>
-
-    <!-- the Controller Task "id" is a key that should be valid within each flowController-->
-    <xs:complexType name="ReportingTaskType">
-        <xs:sequence>
-
-            <!-- The "id" is a name used to uniquely identify the Controller Task. -->
-            <xs:element name="id" type="NonEmptyStringType"/>
-
-            <!-- The "name" is a nicely displayable description of the Controller Task's duty-->
-            <xs:element name="name" type="NonEmptyStringType"/>
-
-            <!-- "class" is the actual Java class that performs the type of controller task desired-->
-            <xs:element name="class" type="NonEmptyStringType"/>
-
-            <!-- 
-                "schedulingPeriod" is the amount of time that should elapse between successive 
-                executions of this task. The timer starts as soon as an execution finishes
-            -->
-            <xs:element name="schedulingPeriod" type="NonEmptyStringType"/>
-            
-            <xs:element name="schedulingStrategy" type="SchedulingStrategyType" minOccurs="0" default="TIMER_DRIVEN" />
-
-            <!-- "optionalTaskProperty" are properties that may exist and offer further information about a task.
-            For instance, information about where a specific task should send information. -->
-            <xs:element name="property" type="PropertyType" minOccurs="0" maxOccurs="unbounded" />
-        </xs:sequence>
-    </xs:complexType>
-
-    <!-- Name/Value properties-->
-    <xs:complexType name="PropertyType">
-        <xs:simpleContent>
-            <xs:extension base="xs:string">
-                <xs:attribute name="name" type="xs:string"></xs:attribute>
-            </xs:extension>
-        </xs:simpleContent>
-    </xs:complexType>
-
-    <xs:simpleType name="SchedulingStrategyType">
-        <xs:restriction base="xs:string">
-            <xs:enumeration value="TIMER_DRIVEN"></xs:enumeration>
-            <xs:enumeration value="CRON_DRIVEN"></xs:enumeration>
-        </xs:restriction>
-    </xs:simpleType>
-
-    <xs:simpleType name="NonEmptyStringType">
-        <xs:restriction base="xs:string">
-            <xs:minLength value="1"/>
-        </xs:restriction>
-    </xs:simpleType>
-    
-    <xs:simpleType name="TimePeriod">
-        <xs:restriction base="xs:string">
-            <xs:pattern value="\d+\s*(ns|nano|nanos|nanoseconds|ms|milli|millis|milliseconds|s|sec|secs|seconds|m|min|mins|minutes|h|hr|hrs|hours|d|day|days)"></xs:pattern>
-        </xs:restriction>
-    </xs:simpleType>
-    
-</xs:schema>