apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From timothyfar...@apache.org
Subject [1/2] incubator-apex-malhar git commit: APEXMALHAR-2054 Made App Data Pi Demo use an embedded Query operator
Date Fri, 15 Apr 2016 00:48:08 GMT
Repository: incubator-apex-malhar
Updated Branches:
  refs/heads/master 9b8f62901 -> f1d70673d


APEXMALHAR-2054 Made App Data Pi Demo use an embedded Query operator


Project: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/commit/1f8e71f9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/tree/1f8e71f9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/diff/1f8e71f9

Branch: refs/heads/master
Commit: 1f8e71f92e5b61df015a4e49684c75a59cea7365
Parents: 9b8f629
Author: David Yan <david@datatorrent.com>
Authored: Thu Apr 14 17:25:54 2016 -0700
Committer: David Yan <david@datatorrent.com>
Committed: Thu Apr 14 17:25:54 2016 -0700

----------------------------------------------------------------------
 .../java/com/datatorrent/demos/pi/ApplicationAppData.java | 10 +++++-----
 demos/pi/src/main/resources/META-INF/properties.xml       |  4 ++++
 2 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/1f8e71f9/demos/pi/src/main/java/com/datatorrent/demos/pi/ApplicationAppData.java
----------------------------------------------------------------------
diff --git a/demos/pi/src/main/java/com/datatorrent/demos/pi/ApplicationAppData.java b/demos/pi/src/main/java/com/datatorrent/demos/pi/ApplicationAppData.java
index 4866015..57c5249 100644
--- a/demos/pi/src/main/java/com/datatorrent/demos/pi/ApplicationAppData.java
+++ b/demos/pi/src/main/java/com/datatorrent/demos/pi/ApplicationAppData.java
@@ -108,19 +108,20 @@ public class ApplicationAppData implements StreamingApplication
 
     URI uri = URI.create("ws://" + gatewayAddress + "/pubsub");
 
-    AppDataSnapshotServerMap snapshotServer
-      = dag.addOperator("Snapshot Server", new AppDataSnapshotServerMap());
+    AppDataSnapshotServerMap snapshotServer = dag.addOperator("SnapshotServer", new AppDataSnapshotServerMap());
 
     String snapshotServerJSON = SchemaUtils.jarResourceFileToString(SNAPSHOT_SCHEMA);
 
     snapshotServer.setSnapshotSchemaJSON(snapshotServerJSON);
 
-    PubSubWebSocketAppDataQuery wsQuery = dag.addOperator("Query", new PubSubWebSocketAppDataQuery());
+    PubSubWebSocketAppDataQuery wsQuery = new PubSubWebSocketAppDataQuery();
+    wsQuery.enableEmbeddedMode();
+    snapshotServer.setEmbeddableQueryInfoProvider(wsQuery);
+
     PubSubWebSocketAppDataResult wsResult = dag.addOperator("QueryResult", new PubSubWebSocketAppDataResult());
 
     wsQuery.setUri(uri);
     wsResult.setUri(uri);
-    Operator.OutputPort<String> queryPort = wsQuery.outputPort;
     Operator.InputPort<String> queryResultPort = wsResult.input;
 
     NamedValueList<Object> adaptor = dag.addOperator("adaptor", new NamedValueList<Object>());
@@ -128,7 +129,6 @@ public class ApplicationAppData implements StreamingApplication
 
     dag.addStream("PiValues", calc.output, adaptor.inPort, console.input).setLocality(locality);;
     dag.addStream("NamedPiValues", adaptor.outPort, snapshotServer.input);
-    dag.addStream("Query", queryPort, snapshotServer.query);
     dag.addStream("Result", snapshotServer.queryResult, queryResultPort);
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-apex-malhar/blob/1f8e71f9/demos/pi/src/main/resources/META-INF/properties.xml
----------------------------------------------------------------------
diff --git a/demos/pi/src/main/resources/META-INF/properties.xml b/demos/pi/src/main/resources/META-INF/properties.xml
index b8277b0..96d097d 100644
--- a/demos/pi/src/main/resources/META-INF/properties.xml
+++ b/demos/pi/src/main/resources/META-INF/properties.xml
@@ -81,6 +81,10 @@
     <name>dt.application.PiDemoAppData.operator.QueryResult.topic</name>
     <value>PiDemoQueryResult</value>
   </property>
+  <property>
+    <name>dt.application.PiDemoAppData.operator.SnapshotServer.embeddableQueryInfoProvider.topic</name>
+    <value>PiDemoQuery</value>
+  </property>
 
   <!-- PiLibraryDemo -->
   <property>


Mime
View raw message