You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ji...@apache.org on 2017/06/14 07:38:57 UTC

eagle git commit: [EAGLE-1041] Support policy processing pipeline

Repository: eagle
Updated Branches:
  refs/heads/master f7994cd2f -> a260c9efe


[EAGLE-1041] Support policy processing pipeline

https://issues.apache.org/jira/browse/EAGLE-1041

Two updates:
* if an inputStream is an intermediate stream (defined by select clause statement), then remove it from inputStream list and outputStream list
* if an inputStream is an intermediate stream, remove its PartitionSpec

Author: Zhao, Qingwen <qi...@apache.org>

Closes #947 from qingwen220/EAGLE-1041.


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

Branch: refs/heads/master
Commit: a260c9efeee7ef11fd1b756d15e264547b5f526f
Parents: f7994cd
Author: Zhao, Qingwen <qi...@apache.org>
Authored: Wed Jun 14 15:38:48 2017 +0800
Committer: zombieJ <sm...@gmail.com>
Committed: Wed Jun 14 15:38:48 2017 +0800

----------------------------------------------------------------------
 .../app/dev/public/js/ctrls/alertEditCtrl.js    | 21 ++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/eagle/blob/a260c9ef/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
----------------------------------------------------------------------
diff --git a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
index ae8cf7e..0a64a42 100644
--- a/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
+++ b/eagle-server/src/main/webapp/app/dev/public/js/ctrls/alertEditCtrl.js
@@ -191,7 +191,7 @@
 							$scope.definition = data;
 
 							// Input streams
-							$scope.policy.inputStreams = $.map(data.policyExecutionPlan.inputStreams, function (value, stream) {
+							var inputStreams = $.map(data.policyExecutionPlan.inputStreams, function (value, stream) {
 								return stream;
 							});
 
@@ -199,15 +199,28 @@
 							var outputStreams = $.map(data.policyExecutionPlan.outputStreams, function (value, stream) {
 								return stream;
 							});
+
+							// Partition
+							$scope.policy.partitionSpec = $.grep(data.policyExecutionPlan.streamPartitions, function (partition) {
+								return $.inArray(partition.streamId, outputStreams) === -1;
+							});
+
+							var tempStreams = $.grep(inputStreams, function (i) {
+								return $.inArray(i, outputStreams) > -1;
+							});
+
+							$.each(tempStreams, function (i, tempStream) {
+								inputStreams = common.array.remove(tempStream, inputStreams);
+								outputStreams = common.array.remove(tempStream, outputStreams);
+							});
+
 							$scope.policy.outputStreams = outputStreams.concat();
+							$scope.policy.inputStreams = inputStreams;
 							$scope.outputStreams = outputStreams;
 							autoDescription();
 
 							// Dedup fields
 							$scope.refreshOutputSteamFields();
-
-							// Partition
-							$scope.policy.partitionSpec = data.policyExecutionPlan.streamPartitions;
 						}
 					} else {
 						$scope.definition = {};