asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xikui Wang (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb-bad[master]: [BAD][RT] EventListener change to accommondate the new inter...
Date Thu, 22 Jun 2017 03:55:21 GMT
Xikui Wang has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1847

Change subject: [BAD][RT] EventListener change to accommondate the new interface
......................................................................

[BAD][RT] EventListener change to accommondate the new interface

Adapt the PrecompiledJobEventListener to follow the new listener
interface.

Change-Id: I121acc01f2bb56ce2bf43f6358da9158d7c7e7f7
---
M asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
M asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
M asterix-bad/src/main/java/org/apache/asterix/bad/metadata/PrecompiledJobEventListener.java
3 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-bad refs/changes/47/1847/1

diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
index 09cc3e5..6554c66 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateChannelStatement.java
@@ -323,7 +323,7 @@
                 datasets.add(MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverse, subscriptionsName.getValue()));
                 datasets.add(MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverse, resultsName.getValue()));
                 //TODO: Add datasets used by channel function
-                listener = new PrecompiledJobEventListener(entityId, PrecompiledType.CHANNEL,
datasets);
+                listener = new PrecompiledJobEventListener(appCtx, entityId, PrecompiledType.CHANNEL,
datasets);
                 activeEventHandler.registerListener(listener);
             }
 
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
index dfc3ed3..25ac27a 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/lang/statement/CreateProcedureStatement.java
@@ -252,7 +252,7 @@
             // Now we subscribe
             if (listener == null) {
                 //TODO: Add datasets used by channel function
-                listener = new PrecompiledJobEventListener(entityId, procedureJobSpec.second,
new ArrayList<>());
+                listener = new PrecompiledJobEventListener(appCtx,entityId, procedureJobSpec.second,
new ArrayList<>());
                 activeEventHandler.registerListener(listener);
             }
             setupDistributedJob(entityId, procedureJobSpec.first, hcc, listener, tempMdProvider.getResultSetId(),
hdc,
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/PrecompiledJobEventListener.java
b/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/PrecompiledJobEventListener.java
index 55547ea..8914d50 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/PrecompiledJobEventListener.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/metadata/PrecompiledJobEventListener.java
@@ -26,6 +26,7 @@
 import org.apache.asterix.active.EntityId;
 import org.apache.asterix.active.IActiveEventSubscriber;
 import org.apache.asterix.app.result.ResultReader;
+import org.apache.asterix.common.dataflow.ICcApplicationContext;
 import org.apache.asterix.common.metadata.IDataset;
 import org.apache.asterix.external.feed.management.ActiveEntityEventsListener;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -47,9 +48,9 @@
 
     private final PrecompiledType type;
 
-    public PrecompiledJobEventListener(EntityId entityId, PrecompiledType type, List<IDataset>
datasets) {
-        this.entityId = entityId;
-        this.datasets = datasets;
+    public PrecompiledJobEventListener(ICcApplicationContext appCtx, EntityId entityId, PrecompiledType
type,
+            List<IDataset> datasets) {
+        super(appCtx, entityId, datasets);
         state = ActivityState.STOPPED;
         this.type = type;
     }
@@ -99,6 +100,10 @@
         }
     }
 
+    @Override public void refreshStats(long l) throws HyracksDataException {
+        // no op
+    }
+
     private synchronized void handleJobStartEvent(ActiveEvent message) throws Exception {
         if (LOGGER.isInfoEnabled()) {
             LOGGER.info("Channel Job started for  " + entityId);
@@ -113,7 +118,7 @@
     }
 
     @Override
-    public IActiveEventSubscriber subscribe(ActivityState state) throws HyracksDataException
{
-        return null;
+    public synchronized void subscribe(IActiveEventSubscriber subscriber) throws HyracksDataException
{
+        // no op
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1847
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I121acc01f2bb56ce2bf43f6358da9158d7c7e7f7
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb-bad
Gerrit-Branch: master
Gerrit-Owner: Xikui Wang <xkkwww@gmail.com>

Mime
View raw message