Add Another Signature to Send Messages to CC
The existing interface to send messages from NC
to CC expects a byte[]. The new method takes
a Serializable and serialize it.
Change-Id: I0ec4e0898c341723f29af32043cec8c042377ed9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/727
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <hubailmor@gmail.com>
diff --git a/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksTaskContext.java b/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksTaskContext.java
index 3076a32..58adccb 100644
--- a/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksTaskContext.java
+++ b/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/IHyracksTaskContext.java
@@ -18,6 +18,7 @@
*/
package org.apache.hyracks.api.context;
+import java.io.Serializable;
import java.util.concurrent.ExecutorService;
import org.apache.hyracks.api.dataflow.TaskAttemptId;
@@ -45,4 +46,6 @@
public void setSharedObject(Object sharedObject);
public Object getSharedObject();
+
+ public void sendApplicationMessageToCC(Serializable message, DeploymentId deploymentId) throws Exception;
}
diff --git a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Task.java b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Task.java
index 7855945..134154c 100644
--- a/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Task.java
+++ b/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/Task.java
@@ -18,6 +18,7 @@
*/
package org.apache.hyracks.control.nc;
+import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
@@ -51,6 +52,7 @@
import org.apache.hyracks.api.job.profiling.counters.ICounterContext;
import org.apache.hyracks.api.partitions.PartitionId;
import org.apache.hyracks.api.resources.IDeallocatable;
+import org.apache.hyracks.api.util.JavaSerializationUtils;
import org.apache.hyracks.control.common.job.PartitionState;
import org.apache.hyracks.control.common.job.profiling.counters.Counter;
import org.apache.hyracks.control.common.job.profiling.om.PartitionProfile;
@@ -387,6 +389,11 @@
}
@Override
+ public void sendApplicationMessageToCC(Serializable message, DeploymentId deploymentId) throws Exception {
+ this.ncs.sendApplicationMessageToCC(JavaSerializationUtils.serialize(message), deploymentId);
+ }
+
+ @Override
public void setSharedObject(Object sharedObject) {
this.sharedObject = sharedObject;
}
diff --git a/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestTaskContext.java b/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestTaskContext.java
index f796812..ee2bff5 100644
--- a/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestTaskContext.java
+++ b/hyracks/hyracks-test-support/src/main/java/org/apache/hyracks/test/support/TestTaskContext.java
@@ -18,6 +18,7 @@
*/
package org.apache.hyracks.test.support;
+import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.HashMap;
import java.util.Map;
@@ -138,6 +139,10 @@
}
@Override
+ public void sendApplicationMessageToCC(Serializable message, DeploymentId deploymentId) throws Exception {
+ }
+
+ @Override
public ExecutorService getExecutorService() {
return null;
}