You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2018/12/04 09:05:18 UTC
[1/2] asterixdb git commit: [NO ISSUE][OTH] Fix hyracks-api
Dependences
Repository: asterixdb
Updated Branches:
refs/heads/master 51e381277 -> da7e8a16d
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/hyracks-shutdown-test/src/test/java/org/apache/hyracks/examples/shutdown/test/ClusterShutdownIT.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-shutdown-test/src/test/java/org/apache/hyracks/examples/shutdown/test/ClusterShutdownIT.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-shutdown-test/src/test/java/org/apache/hyracks/examples/shutdown/test/ClusterShutdownIT.java
index 7c85d5a..83585d1 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-shutdown-test/src/test/java/org/apache/hyracks/examples/shutdown/test/ClusterShutdownIT.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-shutdown-test/src/test/java/org/apache/hyracks/examples/shutdown/test/ClusterShutdownIT.java
@@ -20,9 +20,9 @@ package org.apache.hyracks.examples.shutdown.test;
import java.net.ServerSocket;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.ipc.exceptions.IPCException;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Rule;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/pom.xml b/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/pom.xml
index f412499..c00ffc1 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/pom.xml
@@ -62,6 +62,11 @@
<artifactId>hyracks-data-std</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/src/main/java/org/apache/hyracks/examples/text/client/WordCountMain.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/src/main/java/org/apache/hyracks/examples/text/client/WordCountMain.java b/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/src/main/java/org/apache/hyracks/examples/text/client/WordCountMain.java
index 23a6be0..2004be9 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/src/main/java/org/apache/hyracks/examples/text/client/WordCountMain.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/text-example/textclient/src/main/java/org/apache/hyracks/examples/text/client/WordCountMain.java
@@ -21,7 +21,6 @@ package org.apache.hyracks.examples.text.client;
import java.io.File;
import java.util.EnumSet;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
import org.apache.hyracks.api.dataflow.IConnectorDescriptor;
@@ -63,6 +62,7 @@ import org.apache.hyracks.dataflow.std.group.preclustered.PreclusteredGroupOpera
import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
import org.apache.hyracks.dataflow.std.sort.InMemorySortOperatorDescriptor;
import org.apache.hyracks.examples.text.WordTupleParserFactory;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/pom.xml b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/pom.xml
index e1e2006..31bcf2e 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/pom.xml
@@ -56,6 +56,11 @@
<artifactId>hyracks-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Groupby.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Groupby.java b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Groupby.java
index 80c4f88..cb9307b 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Groupby.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Groupby.java
@@ -23,7 +23,6 @@ import static org.apache.hyracks.examples.tpch.client.Common.lineitemDesc;
import static org.apache.hyracks.examples.tpch.client.Common.lineitemParserFactories;
import static org.apache.hyracks.examples.tpch.client.Common.parseFileSplits;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.dataflow.IConnectorDescriptor;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
@@ -58,6 +57,7 @@ import org.apache.hyracks.dataflow.std.group.aggregators.IntSumFieldAggregatorFa
import org.apache.hyracks.dataflow.std.group.aggregators.MultiFieldsAggregatorFactory;
import org.apache.hyracks.dataflow.std.group.external.ExternalGroupOperatorDescriptor;
import org.apache.hyracks.dataflow.std.group.sort.SortGroupByOperatorDescriptor;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Join.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Join.java b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Join.java
index c3d0df1..a0d40ee 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Join.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Join.java
@@ -25,7 +25,6 @@ import static org.apache.hyracks.examples.tpch.client.Common.parseFileSplits;
import java.util.EnumSet;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
import org.apache.hyracks.api.dataflow.IConnectorDescriptor;
@@ -65,6 +64,7 @@ import org.apache.hyracks.dataflow.std.join.InMemoryHashJoinOperatorDescriptor;
import org.apache.hyracks.dataflow.std.join.JoinComparatorFactory;
import org.apache.hyracks.dataflow.std.join.NestedLoopJoinOperatorDescriptor;
import org.apache.hyracks.dataflow.std.join.OptimizedHybridHashJoinOperatorDescriptor;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Sort.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Sort.java b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Sort.java
index 5043974..08d1031 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Sort.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/tpch-example/tpchclient/src/main/java/org/apache/hyracks/examples/tpch/client/Sort.java
@@ -19,11 +19,13 @@
package org.apache.hyracks.examples.tpch.client;
-import static org.apache.hyracks.examples.tpch.client.Common.*;
+import static org.apache.hyracks.examples.tpch.client.Common.createPartitionConstraint;
+import static org.apache.hyracks.examples.tpch.client.Common.orderParserFactories;
+import static org.apache.hyracks.examples.tpch.client.Common.ordersDesc;
+import static org.apache.hyracks.examples.tpch.client.Common.parseFileSplits;
import java.util.EnumSet;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.dataflow.IOperatorDescriptor;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
@@ -50,6 +52,7 @@ import org.apache.hyracks.dataflow.std.sort.AbstractSorterOperatorDescriptor;
import org.apache.hyracks.dataflow.std.sort.Algorithm;
import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
import org.apache.hyracks.dataflow.std.sort.TopKSorterOperatorDescriptor;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-hdfs/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-hdfs/pom.xml b/hyracks-fullstack/hyracks/hyracks-hdfs/pom.xml
index cba83e3..1a6422b 100644
--- a/hyracks-fullstack/hyracks/hyracks-hdfs/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-hdfs/pom.xml
@@ -189,6 +189,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-hdfs/src/main/java/org/apache/hyracks/hdfs/scheduler/Scheduler.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-hdfs/src/main/java/org/apache/hyracks/hdfs/scheduler/Scheduler.java b/hyracks-fullstack/hyracks/hyracks-hdfs/src/main/java/org/apache/hyracks/hdfs/scheduler/Scheduler.java
index 9633fb1..bc187f8 100644
--- a/hyracks-fullstack/hyracks/hyracks-hdfs/src/main/java/org/apache/hyracks/hdfs/scheduler/Scheduler.java
+++ b/hyracks-fullstack/hyracks/hyracks-hdfs/src/main/java/org/apache/hyracks/hdfs/scheduler/Scheduler.java
@@ -33,7 +33,6 @@ import java.util.Random;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.mapred.InputSplit;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.client.NodeControllerInfo;
import org.apache.hyracks.api.exceptions.HyracksDataException;
@@ -41,6 +40,7 @@ import org.apache.hyracks.api.exceptions.HyracksException;
import org.apache.hyracks.api.topology.ClusterTopology;
import org.apache.hyracks.hdfs.api.INcCollection;
import org.apache.hyracks.hdfs.api.INcCollectionBuilder;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/dataflow/DataflowTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/dataflow/DataflowTest.java b/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/dataflow/DataflowTest.java
index 8f96bab..c2ba188 100644
--- a/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/dataflow/DataflowTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/dataflow/DataflowTest.java
@@ -34,7 +34,6 @@ import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.InputSplit;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.TextInputFormat;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
@@ -54,6 +53,7 @@ import org.apache.hyracks.hdfs.lib.TextKeyValueParserFactory;
import org.apache.hyracks.hdfs.lib.TextTupleWriterFactory;
import org.apache.hyracks.hdfs.scheduler.Scheduler;
import org.apache.hyracks.hdfs.utils.HyracksUtils;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.test.support.TestUtils;
import org.apache.hyracks.util.file.FileUtil;
import org.junit.Assert;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/utils/HyracksUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/utils/HyracksUtils.java b/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/utils/HyracksUtils.java
index 1fddc46..17cd793 100644
--- a/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/utils/HyracksUtils.java
+++ b/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs/utils/HyracksUtils.java
@@ -21,7 +21,7 @@ package org.apache.hyracks.hdfs.utils;
import java.util.EnumSet;
-import org.apache.hyracks.api.client.HyracksConnection;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.job.JobFlag;
import org.apache.hyracks.api.job.JobId;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs2/dataflow/DataflowTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs2/dataflow/DataflowTest.java b/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs2/dataflow/DataflowTest.java
index 02c0a20..04fdc85 100644
--- a/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs2/dataflow/DataflowTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-hdfs/src/test/java/org/apache/hyracks/hdfs2/dataflow/DataflowTest.java
@@ -31,7 +31,7 @@ import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.hyracks.api.client.HyracksConnection;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-ipc/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-ipc/pom.xml b/hyracks-fullstack/hyracks/hyracks-ipc/pom.xml
index d014f3b..4db3418 100644
--- a/hyracks-fullstack/hyracks/hyracks-ipc/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-ipc/pom.xml
@@ -54,5 +54,18 @@
<artifactId>hyracks-util</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceFunctions.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceFunctions.java b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceFunctions.java
new file mode 100644
index 0000000..a61c96d
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceFunctions.java
@@ -0,0 +1,464 @@
+/*
+ * 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.
+ */
+package org.apache.hyracks.ipc.impl;
+
+import java.io.Serializable;
+import java.net.URL;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.hyracks.api.deployment.DeploymentId;
+import org.apache.hyracks.api.job.DeployedJobSpecId;
+import org.apache.hyracks.api.job.JobFlag;
+import org.apache.hyracks.api.job.JobId;
+import org.apache.hyracks.api.result.ResultDirectoryRecord;
+import org.apache.hyracks.api.result.ResultSetId;
+
+public class HyracksClientInterfaceFunctions {
+ public enum FunctionId {
+ GET_CLUSTER_CONTROLLER_INFO,
+ GET_CLUSTER_TOPOLOGY,
+ GET_JOB_STATUS,
+ GET_JOB_INFO,
+ START_JOB,
+ DEPLOY_JOB,
+ UNDEPLOY_JOB,
+ REDEPLOY_JOB,
+ CANCEL_JOB,
+ GET_RESULT_DIRECTORY_ADDRESS,
+ GET_RESULT_STATUS,
+ GET_RESULT_LOCATIONS,
+ WAIT_FOR_COMPLETION,
+ GET_NODE_CONTROLLERS_INFO,
+ CLI_DEPLOY_BINARY,
+ CLI_UNDEPLOY_BINARY,
+ CLUSTER_SHUTDOWN,
+ GET_NODE_DETAILS_JSON,
+ THREAD_DUMP
+ }
+
+ public abstract static class Function implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public abstract FunctionId getFunctionId();
+ }
+
+ public static class GetClusterControllerInfoFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_CLUSTER_CONTROLLER_INFO;
+ }
+ }
+
+ public static class GetJobStatusFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final JobId jobId;
+
+ public GetJobStatusFunction(JobId jobId) {
+ this.jobId = jobId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_JOB_STATUS;
+ }
+
+ public JobId getJobId() {
+ return jobId;
+ }
+ }
+
+ public static class GetJobInfoFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final JobId jobId;
+
+ public GetJobInfoFunction(JobId jobId) {
+ this.jobId = jobId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_JOB_INFO;
+ }
+
+ public JobId getJobId() {
+ return jobId;
+ }
+ }
+
+ public static class redeployJobSpecFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final byte[] acggfBytes;
+
+ private final DeployedJobSpecId deployedJobSpecId;
+
+ public redeployJobSpecFunction(DeployedJobSpecId deployedJobSpecId, byte[] acggfBytes) {
+ this.deployedJobSpecId = deployedJobSpecId;
+ this.acggfBytes = acggfBytes;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.REDEPLOY_JOB;
+ }
+
+ public byte[] getACGGFBytes() {
+ return acggfBytes;
+ }
+
+ public DeployedJobSpecId getDeployedJobSpecId() {
+ return deployedJobSpecId;
+ }
+ }
+
+ public static class DeployJobSpecFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final byte[] acggfBytes;
+
+ public DeployJobSpecFunction(byte[] acggfBytes) {
+ this.acggfBytes = acggfBytes;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.DEPLOY_JOB;
+ }
+
+ public byte[] getACGGFBytes() {
+ return acggfBytes;
+ }
+ }
+
+ public static class CancelJobFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final JobId jobId;
+
+ public CancelJobFunction(JobId jobId) {
+ this.jobId = jobId;
+ if (jobId == null) {
+ throw new IllegalArgumentException("jobId");
+ }
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.CANCEL_JOB;
+ }
+
+ public JobId getJobId() {
+ return jobId;
+ }
+ }
+
+ public static class UndeployJobSpecFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final DeployedJobSpecId deployedJobSpecId;
+
+ public UndeployJobSpecFunction(DeployedJobSpecId deployedJobSpecId) {
+ this.deployedJobSpecId = deployedJobSpecId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.UNDEPLOY_JOB;
+ }
+
+ public DeployedJobSpecId getDeployedJobSpecId() {
+ return deployedJobSpecId;
+ }
+ }
+
+ public static class StartJobFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final byte[] acggfBytes;
+ private final Set<JobFlag> jobFlags;
+ private final DeploymentId deploymentId;
+ private final DeployedJobSpecId deployedJobSpecId;
+ private final Map<byte[], byte[]> jobParameters;
+
+ public StartJobFunction(DeploymentId deploymentId, byte[] acggfBytes, Set<JobFlag> jobFlags,
+ DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) {
+ this.acggfBytes = acggfBytes;
+ this.jobFlags = jobFlags;
+ this.deploymentId = deploymentId;
+ this.deployedJobSpecId = deployedJobSpecId;
+ this.jobParameters = jobParameters;
+ }
+
+ public StartJobFunction(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) {
+ this(null, null, EnumSet.noneOf(JobFlag.class), deployedJobSpecId, jobParameters);
+ }
+
+ public StartJobFunction(byte[] acggfBytes, Set<JobFlag> jobFlags) {
+ this(null, acggfBytes, jobFlags, null, null);
+ }
+
+ public StartJobFunction(DeploymentId deploymentId, byte[] acggfBytes, Set<JobFlag> jobFlags) {
+ this(deploymentId, acggfBytes, jobFlags, null, null);
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.START_JOB;
+ }
+
+ public Map<byte[], byte[]> getJobParameters() {
+ return jobParameters;
+ }
+
+ public DeployedJobSpecId getDeployedJobSpecId() {
+ return deployedJobSpecId;
+ }
+
+ public byte[] getACGGFBytes() {
+ return acggfBytes;
+ }
+
+ public Set<JobFlag> getJobFlags() {
+ return jobFlags;
+ }
+
+ public DeploymentId getDeploymentId() {
+ return deploymentId;
+ }
+ }
+
+ public static class GetResultDirectoryAddressFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_RESULT_DIRECTORY_ADDRESS;
+ }
+ }
+
+ public static class GetResultStatusFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final JobId jobId;
+
+ private final ResultSetId rsId;
+
+ public GetResultStatusFunction(JobId jobId, ResultSetId rsId) {
+ this.jobId = jobId;
+ this.rsId = rsId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_RESULT_STATUS;
+ }
+
+ public JobId getJobId() {
+ return jobId;
+ }
+
+ public ResultSetId getResultSetId() {
+ return rsId;
+ }
+ }
+
+ public static class GetResultLocationsFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final JobId jobId;
+
+ private final ResultSetId rsId;
+
+ private final ResultDirectoryRecord[] knownRecords;
+
+ public GetResultLocationsFunction(JobId jobId, ResultSetId rsId, ResultDirectoryRecord[] knownRecords) {
+ this.jobId = jobId;
+ this.rsId = rsId;
+ this.knownRecords = knownRecords;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_RESULT_LOCATIONS;
+ }
+
+ public JobId getJobId() {
+ return jobId;
+ }
+
+ public ResultSetId getResultSetId() {
+ return rsId;
+ }
+
+ public ResultDirectoryRecord[] getKnownRecords() {
+ return knownRecords;
+ }
+ }
+
+ public static class WaitForCompletionFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ private final JobId jobId;
+
+ public WaitForCompletionFunction(JobId jobId) {
+ this.jobId = jobId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.WAIT_FOR_COMPLETION;
+ }
+
+ public JobId getJobId() {
+ return jobId;
+ }
+ }
+
+ public static class GetNodeControllersInfoFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_NODE_CONTROLLERS_INFO;
+ }
+ }
+
+ public static class GetClusterTopologyFunction extends Function {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_CLUSTER_TOPOLOGY;
+ }
+ }
+
+ public static class CliDeployBinaryFunction extends Function {
+ private static final long serialVersionUID = 1L;
+ private final List<URL> binaryURLs;
+ private final DeploymentId deploymentId;
+
+ public CliDeployBinaryFunction(List<URL> binaryURLs, DeploymentId deploymentId) {
+ this.binaryURLs = binaryURLs;
+ this.deploymentId = deploymentId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.CLI_DEPLOY_BINARY;
+ }
+
+ public List<URL> getBinaryURLs() {
+ return binaryURLs;
+ }
+
+ public DeploymentId getDeploymentId() {
+ return deploymentId;
+ }
+ }
+
+ public static class CliUnDeployBinaryFunction extends Function {
+ private static final long serialVersionUID = 1L;
+ private final DeploymentId deploymentId;
+
+ public CliUnDeployBinaryFunction(DeploymentId deploymentId) {
+ this.deploymentId = deploymentId;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.CLI_UNDEPLOY_BINARY;
+ }
+
+ public DeploymentId getDeploymentId() {
+ return deploymentId;
+ }
+ }
+
+ public static class ClusterShutdownFunction extends Function {
+ private static final long serialVersionUID = 1L;
+ private final boolean terminateNCService;
+
+ public ClusterShutdownFunction(boolean terminateNCService) {
+ this.terminateNCService = terminateNCService;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.CLUSTER_SHUTDOWN;
+ }
+
+ public boolean isTerminateNCService() {
+ return terminateNCService;
+ }
+ }
+
+ public static class GetNodeDetailsJSONFunction extends Function {
+ private static final long serialVersionUID = 1L;
+ private final String nodeId;
+ private final boolean includeStats;
+ private final boolean includeConfig;
+
+ public GetNodeDetailsJSONFunction(String nodeId, boolean includeStats, boolean includeConfig) {
+ this.nodeId = nodeId;
+ this.includeStats = includeStats;
+ this.includeConfig = includeConfig;
+ }
+
+ public String getNodeId() {
+ return nodeId;
+ }
+
+ public boolean isIncludeStats() {
+ return includeStats;
+ }
+
+ public boolean isIncludeConfig() {
+ return includeConfig;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.GET_NODE_DETAILS_JSON;
+ }
+ }
+
+ public static class ThreadDumpFunction extends Function {
+ private final String node;
+
+ public ThreadDumpFunction(String node) {
+ this.node = node;
+ }
+
+ @Override
+ public FunctionId getFunctionId() {
+ return FunctionId.THREAD_DUMP;
+ }
+
+ public String getNode() {
+ return node;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceRemoteProxy.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceRemoteProxy.java b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceRemoteProxy.java
new file mode 100644
index 0000000..3fac7da
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksClientInterfaceRemoteProxy.java
@@ -0,0 +1,202 @@
+/*
+ * 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.
+ */
+package org.apache.hyracks.ipc.impl;
+
+import java.net.URL;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.hyracks.api.client.IHyracksClientInterface;
+import org.apache.hyracks.api.client.NodeControllerInfo;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
+import org.apache.hyracks.api.comm.NetworkAddress;
+import org.apache.hyracks.api.deployment.DeploymentId;
+import org.apache.hyracks.api.job.DeployedJobSpecId;
+import org.apache.hyracks.api.job.JobFlag;
+import org.apache.hyracks.api.job.JobId;
+import org.apache.hyracks.api.job.JobInfo;
+import org.apache.hyracks.api.job.JobStatus;
+import org.apache.hyracks.api.topology.ClusterTopology;
+import org.apache.hyracks.ipc.api.IIPCHandle;
+import org.apache.hyracks.ipc.api.RPCInterface;
+import org.apache.hyracks.ipc.exceptions.IPCException;
+
+public class HyracksClientInterfaceRemoteProxy implements IHyracksClientInterface {
+ private static final int SHUTDOWN_CONNECTION_TIMEOUT_SECS = 30;
+
+ private final IIPCHandle ipcHandle;
+
+ private final RPCInterface rpci;
+
+ public HyracksClientInterfaceRemoteProxy(IIPCHandle ipcHandle, RPCInterface rpci) {
+ this.ipcHandle = ipcHandle;
+ this.rpci = rpci;
+ }
+
+ @Override
+ public ClusterControllerInfo getClusterControllerInfo() throws Exception {
+ HyracksClientInterfaceFunctions.GetClusterControllerInfoFunction gccif =
+ new HyracksClientInterfaceFunctions.GetClusterControllerInfoFunction();
+ return (ClusterControllerInfo) rpci.call(ipcHandle, gccif);
+ }
+
+ @Override
+ public JobStatus getJobStatus(JobId jobId) throws Exception {
+ HyracksClientInterfaceFunctions.GetJobStatusFunction gjsf =
+ new HyracksClientInterfaceFunctions.GetJobStatusFunction(jobId);
+ return (JobStatus) rpci.call(ipcHandle, gjsf);
+ }
+
+ @Override
+ public JobId startJob(byte[] acggfBytes, EnumSet<JobFlag> jobFlags) throws Exception {
+ HyracksClientInterfaceFunctions.StartJobFunction sjf =
+ new HyracksClientInterfaceFunctions.StartJobFunction(acggfBytes, jobFlags);
+ return (JobId) rpci.call(ipcHandle, sjf);
+ }
+
+ @Override
+ public void cancelJob(JobId jobId) throws Exception {
+ HyracksClientInterfaceFunctions.CancelJobFunction cjf =
+ new HyracksClientInterfaceFunctions.CancelJobFunction(jobId);
+ rpci.call(ipcHandle, cjf);
+ }
+
+ @Override
+ public JobId startJob(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) throws Exception {
+ HyracksClientInterfaceFunctions.StartJobFunction sjf =
+ new HyracksClientInterfaceFunctions.StartJobFunction(deployedJobSpecId, jobParameters);
+ return (JobId) rpci.call(ipcHandle, sjf);
+ }
+
+ @Override
+ public JobId startJob(DeploymentId deploymentId, byte[] acggfBytes, EnumSet<JobFlag> jobFlags) throws Exception {
+ HyracksClientInterfaceFunctions.StartJobFunction sjf =
+ new HyracksClientInterfaceFunctions.StartJobFunction(deploymentId, acggfBytes, jobFlags);
+ return (JobId) rpci.call(ipcHandle, sjf);
+ }
+
+ @Override
+ public DeployedJobSpecId deployJobSpec(byte[] acggfBytes) throws Exception {
+ HyracksClientInterfaceFunctions.DeployJobSpecFunction sjf =
+ new HyracksClientInterfaceFunctions.DeployJobSpecFunction(acggfBytes);
+ return (DeployedJobSpecId) rpci.call(ipcHandle, sjf);
+ }
+
+ @Override
+ public void redeployJobSpec(DeployedJobSpecId deployedJobSpecId, byte[] acggfBytes) throws Exception {
+ HyracksClientInterfaceFunctions.redeployJobSpecFunction udjsf =
+ new HyracksClientInterfaceFunctions.redeployJobSpecFunction(deployedJobSpecId, acggfBytes);
+ rpci.call(ipcHandle, udjsf);
+ }
+
+ @Override
+ public void undeployJobSpec(DeployedJobSpecId deployedJobSpecId) throws Exception {
+ HyracksClientInterfaceFunctions.UndeployJobSpecFunction sjf =
+ new HyracksClientInterfaceFunctions.UndeployJobSpecFunction(deployedJobSpecId);
+ rpci.call(ipcHandle, sjf);
+ }
+
+ @Override
+ public NetworkAddress getResultDirectoryAddress() throws Exception {
+ HyracksClientInterfaceFunctions.GetResultDirectoryAddressFunction gddsf =
+ new HyracksClientInterfaceFunctions.GetResultDirectoryAddressFunction();
+ return (NetworkAddress) rpci.call(ipcHandle, gddsf);
+ }
+
+ @Override
+ public void waitForCompletion(JobId jobId) throws Exception {
+ HyracksClientInterfaceFunctions.WaitForCompletionFunction wfcf =
+ new HyracksClientInterfaceFunctions.WaitForCompletionFunction(jobId);
+ rpci.call(ipcHandle, wfcf);
+ }
+
+ @Override
+ public Map<String, NodeControllerInfo> getNodeControllersInfo() throws Exception {
+ HyracksClientInterfaceFunctions.GetNodeControllersInfoFunction gncif =
+ new HyracksClientInterfaceFunctions.GetNodeControllersInfoFunction();
+ return (Map<String, NodeControllerInfo>) rpci.call(ipcHandle, gncif);
+ }
+
+ @Override
+ public ClusterTopology getClusterTopology() throws Exception {
+ HyracksClientInterfaceFunctions.GetClusterTopologyFunction gctf =
+ new HyracksClientInterfaceFunctions.GetClusterTopologyFunction();
+ return (ClusterTopology) rpci.call(ipcHandle, gctf);
+ }
+
+ @Override
+ public void deployBinary(List<URL> binaryURLs, DeploymentId deploymentId) throws Exception {
+ HyracksClientInterfaceFunctions.CliDeployBinaryFunction dbf =
+ new HyracksClientInterfaceFunctions.CliDeployBinaryFunction(binaryURLs, deploymentId);
+ rpci.call(ipcHandle, dbf);
+ }
+
+ @Override
+ public void unDeployBinary(DeploymentId deploymentId) throws Exception {
+ HyracksClientInterfaceFunctions.CliUnDeployBinaryFunction dbf =
+ new HyracksClientInterfaceFunctions.CliUnDeployBinaryFunction(deploymentId);
+ rpci.call(ipcHandle, dbf);
+ }
+
+ @Override
+ public JobInfo getJobInfo(JobId jobId) throws Exception {
+ HyracksClientInterfaceFunctions.GetJobInfoFunction gjsf =
+ new HyracksClientInterfaceFunctions.GetJobInfoFunction(jobId);
+ return (JobInfo) rpci.call(ipcHandle, gjsf);
+ }
+
+ @Override
+ public void stopCluster(boolean terminateNCService) throws Exception {
+ HyracksClientInterfaceFunctions.ClusterShutdownFunction csdf =
+ new HyracksClientInterfaceFunctions.ClusterShutdownFunction(terminateNCService);
+ rpci.call(ipcHandle, csdf);
+ int i = 0;
+ // give the CC some time to do final settling after it returns our request
+ while (ipcHandle.isConnected() && i++ < SHUTDOWN_CONNECTION_TIMEOUT_SECS) {
+ synchronized (this) {
+ wait(TimeUnit.SECONDS.toMillis(1));
+ }
+ }
+ if (ipcHandle.isConnected()) {
+ throw new IPCException(
+ "CC refused to release connection after " + SHUTDOWN_CONNECTION_TIMEOUT_SECS + " seconds");
+ }
+ }
+
+ @Override
+ public String getNodeDetailsJSON(String nodeId, boolean includeStats, boolean includeConfig) throws Exception {
+ HyracksClientInterfaceFunctions.GetNodeDetailsJSONFunction gjsf =
+ new HyracksClientInterfaceFunctions.GetNodeDetailsJSONFunction(nodeId, includeStats, includeConfig);
+ return (String) rpci.call(ipcHandle, gjsf);
+ }
+
+ @Override
+ public String getThreadDump(String node) throws Exception {
+ HyracksClientInterfaceFunctions.ThreadDumpFunction tdf =
+ new HyracksClientInterfaceFunctions.ThreadDumpFunction(node);
+ return (String) rpci.call(ipcHandle, tdf);
+ }
+
+ @Override
+ public boolean isConnected() {
+ return ipcHandle.isConnected();
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksConnection.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksConnection.java b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksConnection.java
new file mode 100644
index 0000000..e6c28fa
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-ipc/src/main/java/org/apache/hyracks/ipc/impl/HyracksConnection.java
@@ -0,0 +1,482 @@
+/*
+ * 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.
+ */
+package org.apache.hyracks.ipc.impl;
+
+import java.io.File;
+import java.net.InetSocketAddress;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpPut;
+import org.apache.http.entity.FileEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.hyracks.api.client.IHyracksClientConnection;
+import org.apache.hyracks.api.client.IHyracksClientInterface;
+import org.apache.hyracks.api.client.NodeControllerInfo;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
+import org.apache.hyracks.api.client.impl.JobSpecificationActivityClusterGraphGeneratorFactory;
+import org.apache.hyracks.api.comm.NetworkAddress;
+import org.apache.hyracks.api.deployment.DeploymentId;
+import org.apache.hyracks.api.exceptions.HyracksException;
+import org.apache.hyracks.api.job.DeployedJobSpecId;
+import org.apache.hyracks.api.job.IActivityClusterGraphGeneratorFactory;
+import org.apache.hyracks.api.job.JobFlag;
+import org.apache.hyracks.api.job.JobId;
+import org.apache.hyracks.api.job.JobInfo;
+import org.apache.hyracks.api.job.JobSpecification;
+import org.apache.hyracks.api.job.JobStatus;
+import org.apache.hyracks.api.topology.ClusterTopology;
+import org.apache.hyracks.api.util.InvokeUtil;
+import org.apache.hyracks.api.util.JavaSerializationUtils;
+import org.apache.hyracks.ipc.api.RPCInterface;
+import org.apache.hyracks.util.ExitUtil;
+import org.apache.hyracks.util.InterruptibleAction;
+import org.apache.logging.log4j.Level;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+/**
+ * Connection Class used by a Hyracks Client to interact with a Hyracks Cluster
+ * Controller.
+ *
+ * @author vinayakb
+ */
+public final class HyracksConnection implements IHyracksClientConnection {
+
+ private static final Logger LOGGER = LogManager.getLogger();
+
+ private final String ccHost;
+
+ private final int ccPort;
+
+ private final IPCSystem ipc;
+
+ private final IHyracksClientInterface hci;
+
+ private final ClusterControllerInfo ccInfo;
+
+ private volatile boolean running = false;
+
+ private volatile long reqId = 0L;
+
+ private final ExecutorService uninterruptibleExecutor =
+ Executors.newFixedThreadPool(2, r -> new Thread(r, "HyracksConnection Uninterrubtible thread: "));
+
+ private final BlockingQueue<UnInterruptibleRequest<?>> uninterruptibles = new ArrayBlockingQueue<>(1);
+
+ /**
+ * Constructor to create a connection to the Hyracks Cluster Controller.
+ *
+ * @param ccHost
+ * Host name (or IP Address) where the Cluster Controller can be
+ * reached.
+ * @param ccPort
+ * Port to reach the Hyracks Cluster Controller at the specified
+ * host name.
+ * @throws Exception
+ */
+ public HyracksConnection(String ccHost, int ccPort) throws Exception {
+ this.ccHost = ccHost;
+ this.ccPort = ccPort;
+ RPCInterface rpci = new RPCInterface();
+ ipc = new IPCSystem(new InetSocketAddress(0), rpci, new JavaSerializationBasedPayloadSerializerDeserializer());
+ ipc.start();
+ hci = new HyracksClientInterfaceRemoteProxy(ipc.getReconnectingHandle(new InetSocketAddress(ccHost, ccPort)),
+ rpci);
+ ccInfo = hci.getClusterControllerInfo();
+ uninterruptibleExecutor.execute(new UninterrubtileRequestHandler());
+ uninterruptibleExecutor.execute(new UninterrubtileHandlerWatcher());
+ }
+
+ @Override
+ public JobStatus getJobStatus(JobId jobId) throws Exception {
+ return hci.getJobStatus(jobId);
+ }
+
+ @Override
+ public void cancelJob(JobId jobId) throws Exception {
+ CancelJobRequest request = new CancelJobRequest(jobId);
+ uninterruptiblySubmitAndExecute(request);
+ }
+
+ @Override
+ public JobId startJob(JobSpecification jobSpec) throws Exception {
+ return startJob(jobSpec, EnumSet.noneOf(JobFlag.class));
+ }
+
+ @Override
+ public JobId startJob(JobSpecification jobSpec, EnumSet<JobFlag> jobFlags) throws Exception {
+ IActivityClusterGraphGeneratorFactory jsacggf =
+ new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
+ return startJob(jsacggf, jobFlags);
+ }
+
+ @Override
+ public void redeployJobSpec(DeployedJobSpecId deployedJobSpecId, JobSpecification jobSpec) throws Exception {
+ JobSpecificationActivityClusterGraphGeneratorFactory jsacggf =
+ new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
+ hci.redeployJobSpec(deployedJobSpecId, JavaSerializationUtils.serialize(jsacggf));
+ }
+
+ @Override
+ public DeployedJobSpecId deployJobSpec(JobSpecification jobSpec) throws Exception {
+ JobSpecificationActivityClusterGraphGeneratorFactory jsacggf =
+ new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
+ return deployJobSpec(jsacggf);
+ }
+
+ @Override
+ public void undeployJobSpec(DeployedJobSpecId deployedJobSpecId) throws Exception {
+ hci.undeployJobSpec(deployedJobSpecId);
+ }
+
+ @Override
+ public JobId startJob(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) throws Exception {
+ StartDeployedJobRequest request = new StartDeployedJobRequest(deployedJobSpecId, jobParameters);
+ return interruptiblySubmitAndExecute(request);
+ }
+
+ @Override
+ public JobId startJob(IActivityClusterGraphGeneratorFactory acggf, EnumSet<JobFlag> jobFlags) throws Exception {
+ return startJob(null, acggf, jobFlags);
+ }
+
+ public DeployedJobSpecId deployJobSpec(IActivityClusterGraphGeneratorFactory acggf) throws Exception {
+ return hci.deployJobSpec(JavaSerializationUtils.serialize(acggf));
+ }
+
+ @Override
+ public NetworkAddress getResultDirectoryAddress() throws Exception {
+ return hci.getResultDirectoryAddress();
+ }
+
+ @Override
+ public void waitForCompletion(JobId jobId) throws Exception {
+ try {
+ hci.waitForCompletion(jobId);
+ } catch (InterruptedException e) {
+ // Cancels an on-going job if the current thread gets interrupted.
+ cancelJob(jobId);
+ throw e;
+ }
+ }
+
+ @Override
+ public Map<String, NodeControllerInfo> getNodeControllerInfos() throws HyracksException {
+ try {
+ return hci.getNodeControllersInfo();
+ } catch (Exception e) {
+ throw HyracksException.create(e);
+ }
+ }
+
+ @Override
+ public ClusterTopology getClusterTopology() throws HyracksException {
+ try {
+ return hci.getClusterTopology();
+ } catch (Exception e) {
+ throw HyracksException.create(e);
+ }
+ }
+
+ @Override
+ public DeploymentId deployBinary(List<String> jars) throws Exception {
+ /** generate a deployment id */
+ DeploymentId deploymentId = new DeploymentId(UUID.randomUUID().toString());
+ List<URL> binaryURLs = new ArrayList<>();
+ if (jars != null && !jars.isEmpty()) {
+ CloseableHttpClient hc = new DefaultHttpClient();
+ try {
+ /** upload jars through a http client one-by-one to the CC server */
+ for (String jar : jars) {
+ int slashIndex = jar.lastIndexOf('/');
+ String fileName = jar.substring(slashIndex + 1);
+ String url = "http://" + ccHost + ":" + ccInfo.getWebPort() + "/applications/"
+ + deploymentId.toString() + "&" + fileName;
+ HttpPut put = new HttpPut(url);
+ put.setEntity(new FileEntity(new File(jar), "application/octet-stream"));
+ HttpResponse response = hc.execute(put);
+ response.getEntity().consumeContent();
+ if (response.getStatusLine().getStatusCode() != 200) {
+ hci.unDeployBinary(deploymentId);
+ throw new HyracksException(response.getStatusLine().toString());
+ }
+ /** add the uploaded URL address into the URLs of jars to be deployed at NCs */
+ binaryURLs.add(new URL(url));
+ }
+ } finally {
+ hc.close();
+ }
+ }
+ /** deploy the URLs to the CC and NCs */
+ hci.deployBinary(binaryURLs, deploymentId);
+ return deploymentId;
+ }
+
+ @Override
+ public void unDeployBinary(DeploymentId deploymentId) throws Exception {
+ hci.unDeployBinary(deploymentId);
+ }
+
+ @Override
+ public JobId startJob(DeploymentId deploymentId, JobSpecification jobSpec) throws Exception {
+ return startJob(deploymentId, jobSpec, EnumSet.noneOf(JobFlag.class));
+ }
+
+ @Override
+ public JobId startJob(DeploymentId deploymentId, JobSpecification jobSpec, EnumSet<JobFlag> jobFlags)
+ throws Exception {
+ IActivityClusterGraphGeneratorFactory jsacggf =
+ new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
+ return startJob(deploymentId, jsacggf, jobFlags);
+ }
+
+ @Override
+ public JobId startJob(DeploymentId deploymentId, IActivityClusterGraphGeneratorFactory acggf,
+ EnumSet<JobFlag> jobFlags) throws Exception {
+ StartJobRequest request = new StartJobRequest(deploymentId, acggf, jobFlags);
+ return interruptiblySubmitAndExecute(request);
+ }
+
+ @Override
+ public JobInfo getJobInfo(JobId jobId) throws Exception {
+ return hci.getJobInfo(jobId);
+ }
+
+ @Override
+ public void stopCluster(boolean terminateNCService) throws Exception {
+ hci.stopCluster(terminateNCService);
+ }
+
+ @Override
+ public String getNodeDetailsJSON(String nodeId, boolean includeStats, boolean includeConfig) throws Exception {
+ return hci.getNodeDetailsJSON(nodeId, includeStats, includeConfig);
+ }
+
+ @Override
+ public String getThreadDump(String node) throws Exception {
+ return hci.getThreadDump(node);
+ }
+
+ @Override
+ public String getHost() {
+ return ccHost;
+ }
+
+ @Override
+ public int getPort() {
+ return ccPort;
+ }
+
+ @Override
+ public boolean isConnected() {
+ return hci.isConnected();
+ }
+
+ private <T> T uninterruptiblySubmitAndExecute(UnInterruptibleRequest<T> request) throws Exception {
+ InvokeUtil.doUninterruptibly(() -> uninterruptibles.put(request));
+ return uninterruptiblyExecute(request);
+ }
+
+ private <T> T uninterruptiblyExecute(UnInterruptibleRequest<T> request) throws Exception {
+ InvokeUtil.doUninterruptibly(request);
+ return request.result();
+ }
+
+ private <T> T interruptiblySubmitAndExecute(UnInterruptibleRequest<T> request) throws Exception {
+ uninterruptibles.put(request);
+ return uninterruptiblyExecute(request);
+ }
+
+ private abstract class UnInterruptibleRequest<T> implements InterruptibleAction {
+ boolean completed = false;
+ boolean failed = false;
+ Throwable failure = null;
+ T response = null;
+
+ @SuppressWarnings("squid:S1181")
+ private final void handle() {
+ try {
+ response = doHandle();
+ } catch (Throwable th) {
+ failed = true;
+ failure = th;
+ } finally {
+ synchronized (this) {
+ completed = true;
+ notifyAll();
+ }
+ }
+ }
+
+ protected abstract T doHandle() throws Exception;
+
+ @Override
+ public final synchronized void run() throws InterruptedException {
+ while (!completed) {
+ wait();
+ }
+ }
+
+ public T result() throws Exception {
+ if (failed) {
+ if (failure instanceof Error) {
+ throw (Error) failure;
+ }
+ throw (Exception) failure;
+ }
+ return response;
+ }
+ }
+
+ private class CancelJobRequest extends UnInterruptibleRequest<Void> {
+ final JobId jobId;
+
+ public CancelJobRequest(JobId jobId) {
+ this.jobId = jobId;
+ }
+
+ @Override
+ protected Void doHandle() throws Exception {
+ hci.cancelJob(jobId);
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ return "CancelJobRequest: " + jobId.toString();
+ }
+
+ }
+
+ private class StartDeployedJobRequest extends UnInterruptibleRequest<JobId> {
+
+ private final DeployedJobSpecId deployedJobSpecId;
+ private final Map<byte[], byte[]> jobParameters;
+
+ public StartDeployedJobRequest(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) {
+ this.deployedJobSpecId = deployedJobSpecId;
+ this.jobParameters = jobParameters;
+ }
+
+ @Override
+ protected JobId doHandle() throws Exception {
+ return hci.startJob(deployedJobSpecId, jobParameters);
+ }
+
+ }
+
+ private class StartJobRequest extends UnInterruptibleRequest<JobId> {
+ private final DeploymentId deploymentId;
+ private final IActivityClusterGraphGeneratorFactory acggf;
+ private final EnumSet<JobFlag> jobFlags;
+
+ public StartJobRequest(DeploymentId deploymentId, IActivityClusterGraphGeneratorFactory acggf,
+ EnumSet<JobFlag> jobFlags) {
+ this.deploymentId = deploymentId;
+ this.acggf = acggf;
+ this.jobFlags = jobFlags;
+ }
+
+ @Override
+ protected JobId doHandle() throws Exception {
+ if (deploymentId == null) {
+ return hci.startJob(JavaSerializationUtils.serialize(acggf), jobFlags);
+ } else {
+ return hci.startJob(deploymentId, JavaSerializationUtils.serialize(acggf), jobFlags);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "StartJobRequest";
+ }
+
+ }
+
+ private class UninterrubtileRequestHandler implements Runnable {
+ @SuppressWarnings({ "squid:S2189", "squid:S2142" })
+ @Override
+ public void run() {
+ String nameBefore = Thread.currentThread().getName();
+ Thread.currentThread().setName(nameBefore + getClass().getSimpleName());
+ try {
+ while (true) {
+ try {
+ UnInterruptibleRequest<?> current = uninterruptibles.take();
+ reqId++;
+ running = true;
+ current.handle();
+ } catch (InterruptedException e) {
+ LOGGER.log(Level.WARN, "Ignoring interrupt. This thread should never be interrupted.");
+ continue;
+ } finally {
+ running = false;
+ }
+ }
+ } finally {
+ Thread.currentThread().setName(nameBefore);
+ }
+ }
+ }
+
+ public class UninterrubtileHandlerWatcher implements Runnable {
+ @Override
+ @SuppressWarnings({ "squid:S2189", "squid:S2142" })
+ public void run() {
+ String nameBefore = Thread.currentThread().getName();
+ Thread.currentThread().setName(nameBefore + getClass().getSimpleName());
+ try {
+ long currentReqId = 0L;
+ long currentTime = System.nanoTime();
+ while (true) {
+ try {
+ TimeUnit.MINUTES.sleep(1);
+ } catch (InterruptedException e) {
+ LOGGER.log(Level.WARN, "Ignoring interrupt. This thread should never be interrupted.");
+ continue;
+ }
+ if (running) {
+ if (reqId == currentReqId) {
+ if (TimeUnit.NANOSECONDS.toMinutes(System.nanoTime() - currentTime) > 0) {
+ ExitUtil.halt(ExitUtil.EC_FAILED_TO_PROCESS_UN_INTERRUPTIBLE_REQUEST);
+ }
+ } else {
+ currentReqId = reqId;
+ currentTime = System.nanoTime();
+ }
+ }
+ }
+ } finally {
+ Thread.currentThread().setName(nameBefore);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/pom.xml b/hyracks-fullstack/hyracks/pom.xml
index 3b4178d..5990526 100644
--- a/hyracks-fullstack/hyracks/pom.xml
+++ b/hyracks-fullstack/hyracks/pom.xml
@@ -72,8 +72,8 @@
<modules>
<module>hyracks-util</module>
- <module>hyracks-ipc</module>
<module>hyracks-api</module>
+ <module>hyracks-ipc</module>
<module>hyracks-comm</module>
<module>hyracks-client</module>
<module>hyracks-dataflow-common</module>
[2/2] asterixdb git commit: [NO ISSUE][OTH] Fix hyracks-api
Dependences
Posted by mh...@apache.org.
[NO ISSUE][OTH] Fix hyracks-api Dependences
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Ensure hyracks-api module depends only on hyracks-util. This way
new APIs can be added to hyracks-api and used on all other modules
without facing cyclic dependency issues.
Change-Id: I7f4329b3dad99c256fb2e10a7863aaca41990ce0
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3047
Reviewed-by: Murtadha Hubail <mh...@apache.org>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
Contrib: Jenkins <je...@fulliautomatix.ics.uci.edu>
Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/da7e8a16
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/da7e8a16
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/da7e8a16
Branch: refs/heads/master
Commit: da7e8a16ddaabd808992847aa0132127db2a7c9a
Parents: 51e3812
Author: Murtadha Hubail <mh...@apache.org>
Authored: Tue Dec 4 02:29:11 2018 +0300
Committer: Murtadha Hubail <mh...@apache.org>
Committed: Tue Dec 4 01:04:46 2018 -0800
----------------------------------------------------------------------
.../asterix/app/nc/NCAppRuntimeContext.java | 4 +-
.../asterix/drivers/AsterixClientDriver.java | 2 +-
.../hyracks/bootstrap/CCApplication.java | 2 +-
.../common/AsterixHyracksIntegrationUtil.java | 2 +-
asterixdb/asterix-runtime/pom.xml | 4 +
.../runtime/utils/CcApplicationContext.java | 2 +-
.../algebricks/algebricks-tests/pom.xml | 5 +
.../util/AlgebricksHyracksIntegrationUtil.java | 2 +-
hyracks-fullstack/hyracks/hyracks-api/pom.xml | 13 -
.../api/client/ClusterControllerInfo.java | 58 ---
.../client/HyracksClientInterfaceFunctions.java | 464 ------------------
.../HyracksClientInterfaceRemoteProxy.java | 199 --------
.../hyracks/api/client/HyracksConnection.java | 480 ------------------
.../api/client/IHyracksClientInterface.java | 1 +
.../api/client/impl/ClusterControllerInfo.java | 58 +++
.../apache/hyracks/api/context/ICCContext.java | 2 +-
.../result/ResultDirectoryRemoteProxy.java | 6 +-
.../hyracks/client/stats/HyracksUtils.java | 2 +-
.../hyracks/control/cc/ClientInterfaceIPCI.java | 2 +-
.../control/cc/ClusterControllerService.java | 2 +-
.../common/controllers/NodeParameters.java | 2 +-
.../btree-example/btreeclient/pom.xml | 5 +
.../btree/client/InsertPipelineExample.java | 2 +-
.../client/PrimaryIndexBulkLoadExample.java | 2 +-
.../btree/client/PrimaryIndexSearchExample.java | 2 +-
.../client/SecondaryIndexBulkLoadExample.java | 2 +-
.../client/SecondaryIndexSearchExample.java | 2 +-
.../hyracks-integration-tests/pom.xml | 5 +
.../integration/AbstractIntegrationTest.java | 2 +-
.../AbstractMultiNCIntegrationTest.java | 2 +-
.../tests/integration/DeployedJobSpecsTest.java | 2 +-
.../shutdown/test/ClusterShutdownIT.java | 2 +-
.../text-example/textclient/pom.xml | 5 +
.../examples/text/client/WordCountMain.java | 2 +-
.../tpch-example/tpchclient/pom.xml | 5 +
.../hyracks/examples/tpch/client/Groupby.java | 2 +-
.../hyracks/examples/tpch/client/Join.java | 2 +-
.../hyracks/examples/tpch/client/Sort.java | 7 +-
hyracks-fullstack/hyracks/hyracks-hdfs/pom.xml | 5 +
.../hyracks/hdfs/scheduler/Scheduler.java | 2 +-
.../hyracks/hdfs/dataflow/DataflowTest.java | 2 +-
.../apache/hyracks/hdfs/utils/HyracksUtils.java | 2 +-
.../hyracks/hdfs2/dataflow/DataflowTest.java | 2 +-
hyracks-fullstack/hyracks/hyracks-ipc/pom.xml | 13 +
.../impl/HyracksClientInterfaceFunctions.java | 464 ++++++++++++++++++
.../impl/HyracksClientInterfaceRemoteProxy.java | 202 ++++++++
.../hyracks/ipc/impl/HyracksConnection.java | 482 +++++++++++++++++++
hyracks-fullstack/hyracks/pom.xml | 2 +-
48 files changed, 1291 insertions(+), 1248 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
index 3524474..07d540b 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/nc/NCAppRuntimeContext.java
@@ -76,9 +76,8 @@ import org.apache.asterix.runtime.utils.NoOpCoordinationService;
import org.apache.asterix.transaction.management.resource.PersistentLocalResourceRepository;
import org.apache.asterix.transaction.management.resource.PersistentLocalResourceRepositoryFactory;
import org.apache.hyracks.api.application.INCServiceContext;
-import org.apache.hyracks.api.client.ClusterControllerInfo;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
import org.apache.hyracks.api.control.CcId;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.io.IIOManager;
@@ -86,6 +85,7 @@ import org.apache.hyracks.api.io.IPersistedResourceRegistry;
import org.apache.hyracks.api.lifecycle.ILifeCycleComponent;
import org.apache.hyracks.api.lifecycle.ILifeCycleComponentManager;
import org.apache.hyracks.control.nc.NodeControllerService;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMIOOperationScheduler;
import org.apache.hyracks.storage.am.lsm.common.api.ILSMMergePolicyFactory;
import org.apache.hyracks.storage.am.lsm.common.impls.AsynchronousScheduler;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/asterixdb/asterix-app/src/main/java/org/apache/asterix/drivers/AsterixClientDriver.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/drivers/AsterixClientDriver.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/drivers/AsterixClientDriver.java
index aa6bbdd..558c25d 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/drivers/AsterixClientDriver.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/drivers/AsterixClientDriver.java
@@ -26,8 +26,8 @@ import org.apache.asterix.app.translator.DefaultStatementExecutorFactory;
import org.apache.asterix.compiler.provider.AqlCompilationProvider;
import org.apache.asterix.compiler.provider.ILangCompilationProvider;
import org.apache.asterix.file.StorageComponentProvider;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.kohsuke.args4j.CmdLineParser;
public class AsterixClientDriver {
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
index a5fd063..482f67f 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/hyracks/bootstrap/CCApplication.java
@@ -83,7 +83,6 @@ import org.apache.asterix.util.MetadataBuiltinFunctions;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.application.ICCServiceContext;
import org.apache.hyracks.api.application.IServiceContext;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.config.IConfigManager;
import org.apache.hyracks.api.control.IGatekeeper;
@@ -98,6 +97,7 @@ import org.apache.hyracks.http.server.HttpServer;
import org.apache.hyracks.http.server.HttpServerConfig;
import org.apache.hyracks.http.server.HttpServerConfigBuilder;
import org.apache.hyracks.http.server.WebManager;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.util.LoggingConfigUtil;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
index 1301c01..f510be5 100644
--- a/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterixdb/asterix-app/src/test/java/org/apache/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -50,7 +50,6 @@ import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.hyracks.api.application.ICCApplication;
import org.apache.hyracks.api.application.INCApplication;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.config.IOption;
import org.apache.hyracks.control.cc.ClusterControllerService;
@@ -59,6 +58,7 @@ import org.apache.hyracks.control.common.controllers.CCConfig;
import org.apache.hyracks.control.common.controllers.ControllerConfig;
import org.apache.hyracks.control.common.controllers.NCConfig;
import org.apache.hyracks.control.nc.NodeControllerService;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.lsm.btree.impl.TestLsmBtreeLocalResource;
import org.apache.hyracks.test.support.TestUtils;
import org.apache.logging.log4j.Level;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/asterixdb/asterix-runtime/pom.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/pom.xml b/asterixdb/asterix-runtime/pom.xml
index b54c8c7..f95a1e0 100644
--- a/asterixdb/asterix-runtime/pom.xml
+++ b/asterixdb/asterix-runtime/pom.xml
@@ -178,6 +178,10 @@
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
index 0d2a1df..48463e8 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/utils/CcApplicationContext.java
@@ -51,10 +51,10 @@ import org.apache.asterix.runtime.job.listener.NodeJobTracker;
import org.apache.asterix.runtime.transaction.ResourceIdManager;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.api.application.ICCServiceContext;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.job.IJobLifecycleListener;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.common.IStorageManager;
/*
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/algebricks/algebricks-tests/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-tests/pom.xml b/hyracks-fullstack/algebricks/algebricks-tests/pom.xml
index 0c27353..3800f62 100644
--- a/hyracks-fullstack/algebricks/algebricks-tests/pom.xml
+++ b/hyracks-fullstack/algebricks/algebricks-tests/pom.xml
@@ -174,6 +174,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/algebricks/algebricks-tests/src/test/java/org/apache/hyracks/algebricks/tests/util/AlgebricksHyracksIntegrationUtil.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-tests/src/test/java/org/apache/hyracks/algebricks/tests/util/AlgebricksHyracksIntegrationUtil.java b/hyracks-fullstack/algebricks/algebricks-tests/src/test/java/org/apache/hyracks/algebricks/tests/util/AlgebricksHyracksIntegrationUtil.java
index 9b3817e..701af7c 100644
--- a/hyracks-fullstack/algebricks/algebricks-tests/src/test/java/org/apache/hyracks/algebricks/tests/util/AlgebricksHyracksIntegrationUtil.java
+++ b/hyracks-fullstack/algebricks/algebricks-tests/src/test/java/org/apache/hyracks/algebricks/tests/util/AlgebricksHyracksIntegrationUtil.java
@@ -25,7 +25,6 @@ import java.util.EnumSet;
import org.apache.commons.io.FileUtils;
import org.apache.hyracks.algebricks.core.config.AlgebricksConfig;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.job.JobFlag;
import org.apache.hyracks.api.job.JobId;
@@ -34,6 +33,7 @@ import org.apache.hyracks.control.cc.ClusterControllerService;
import org.apache.hyracks.control.common.controllers.CCConfig;
import org.apache.hyracks.control.common.controllers.NCConfig;
import org.apache.hyracks.control.nc.NodeControllerService;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
public class AlgebricksHyracksIntegrationUtil {
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/pom.xml b/hyracks-fullstack/hyracks/hyracks-api/pom.xml
index 257110c..037e50e 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-api/pom.xml
@@ -56,19 +56,6 @@
</build>
<dependencies>
<dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.hyracks</groupId>
- <artifactId>hyracks-ipc</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/ClusterControllerInfo.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/ClusterControllerInfo.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/ClusterControllerInfo.java
deleted file mode 100644
index 0e04dca..0000000
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/ClusterControllerInfo.java
+++ /dev/null
@@ -1,58 +0,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.
- */
-package org.apache.hyracks.api.client;
-
-import org.apache.hyracks.api.control.CcId;
-
-import java.io.Serializable;
-
-public class ClusterControllerInfo implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private final CcId ccId;
-
- private final String clientNetAddress;
-
- private final int clientNetPort;
-
- private final int webPort;
-
- public ClusterControllerInfo(CcId ccId, String clientNetAddress, int clientNetPort, int webPort) {
- this.ccId = ccId;
- this.clientNetAddress = clientNetAddress;
- this.clientNetPort = clientNetPort;
- this.webPort = webPort;
- }
-
- public CcId getCcId() {
- return ccId;
- }
-
- public int getWebPort() {
- return webPort;
- }
-
- public String getClientNetAddress() {
- return clientNetAddress;
- }
-
- public int getClientNetPort() {
- return clientNetPort;
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceFunctions.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceFunctions.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceFunctions.java
deleted file mode 100644
index 72bdc3e..0000000
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceFunctions.java
+++ /dev/null
@@ -1,464 +0,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.
- */
-package org.apache.hyracks.api.client;
-
-import java.io.Serializable;
-import java.net.URL;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.hyracks.api.deployment.DeploymentId;
-import org.apache.hyracks.api.job.DeployedJobSpecId;
-import org.apache.hyracks.api.job.JobFlag;
-import org.apache.hyracks.api.job.JobId;
-import org.apache.hyracks.api.result.ResultDirectoryRecord;
-import org.apache.hyracks.api.result.ResultSetId;
-
-public class HyracksClientInterfaceFunctions {
- public enum FunctionId {
- GET_CLUSTER_CONTROLLER_INFO,
- GET_CLUSTER_TOPOLOGY,
- GET_JOB_STATUS,
- GET_JOB_INFO,
- START_JOB,
- DEPLOY_JOB,
- UNDEPLOY_JOB,
- REDEPLOY_JOB,
- CANCEL_JOB,
- GET_RESULT_DIRECTORY_ADDRESS,
- GET_RESULT_STATUS,
- GET_RESULT_LOCATIONS,
- WAIT_FOR_COMPLETION,
- GET_NODE_CONTROLLERS_INFO,
- CLI_DEPLOY_BINARY,
- CLI_UNDEPLOY_BINARY,
- CLUSTER_SHUTDOWN,
- GET_NODE_DETAILS_JSON,
- THREAD_DUMP
- }
-
- public abstract static class Function implements Serializable {
- private static final long serialVersionUID = 1L;
-
- public abstract FunctionId getFunctionId();
- }
-
- public static class GetClusterControllerInfoFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_CLUSTER_CONTROLLER_INFO;
- }
- }
-
- public static class GetJobStatusFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final JobId jobId;
-
- public GetJobStatusFunction(JobId jobId) {
- this.jobId = jobId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_JOB_STATUS;
- }
-
- public JobId getJobId() {
- return jobId;
- }
- }
-
- public static class GetJobInfoFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final JobId jobId;
-
- public GetJobInfoFunction(JobId jobId) {
- this.jobId = jobId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_JOB_INFO;
- }
-
- public JobId getJobId() {
- return jobId;
- }
- }
-
- public static class redeployJobSpecFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final byte[] acggfBytes;
-
- private final DeployedJobSpecId deployedJobSpecId;
-
- public redeployJobSpecFunction(DeployedJobSpecId deployedJobSpecId, byte[] acggfBytes) {
- this.deployedJobSpecId = deployedJobSpecId;
- this.acggfBytes = acggfBytes;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.REDEPLOY_JOB;
- }
-
- public byte[] getACGGFBytes() {
- return acggfBytes;
- }
-
- public DeployedJobSpecId getDeployedJobSpecId() {
- return deployedJobSpecId;
- }
- }
-
- public static class DeployJobSpecFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final byte[] acggfBytes;
-
- public DeployJobSpecFunction(byte[] acggfBytes) {
- this.acggfBytes = acggfBytes;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.DEPLOY_JOB;
- }
-
- public byte[] getACGGFBytes() {
- return acggfBytes;
- }
- }
-
- public static class CancelJobFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final JobId jobId;
-
- public CancelJobFunction(JobId jobId) {
- this.jobId = jobId;
- if (jobId == null) {
- throw new IllegalArgumentException("jobId");
- }
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.CANCEL_JOB;
- }
-
- public JobId getJobId() {
- return jobId;
- }
- }
-
- public static class UndeployJobSpecFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final DeployedJobSpecId deployedJobSpecId;
-
- public UndeployJobSpecFunction(DeployedJobSpecId deployedJobSpecId) {
- this.deployedJobSpecId = deployedJobSpecId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.UNDEPLOY_JOB;
- }
-
- public DeployedJobSpecId getDeployedJobSpecId() {
- return deployedJobSpecId;
- }
- }
-
- public static class StartJobFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final byte[] acggfBytes;
- private final Set<JobFlag> jobFlags;
- private final DeploymentId deploymentId;
- private final DeployedJobSpecId deployedJobSpecId;
- private final Map<byte[], byte[]> jobParameters;
-
- public StartJobFunction(DeploymentId deploymentId, byte[] acggfBytes, Set<JobFlag> jobFlags,
- DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) {
- this.acggfBytes = acggfBytes;
- this.jobFlags = jobFlags;
- this.deploymentId = deploymentId;
- this.deployedJobSpecId = deployedJobSpecId;
- this.jobParameters = jobParameters;
- }
-
- public StartJobFunction(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) {
- this(null, null, EnumSet.noneOf(JobFlag.class), deployedJobSpecId, jobParameters);
- }
-
- public StartJobFunction(byte[] acggfBytes, Set<JobFlag> jobFlags) {
- this(null, acggfBytes, jobFlags, null, null);
- }
-
- public StartJobFunction(DeploymentId deploymentId, byte[] acggfBytes, Set<JobFlag> jobFlags) {
- this(deploymentId, acggfBytes, jobFlags, null, null);
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.START_JOB;
- }
-
- public Map<byte[], byte[]> getJobParameters() {
- return jobParameters;
- }
-
- public DeployedJobSpecId getDeployedJobSpecId() {
- return deployedJobSpecId;
- }
-
- public byte[] getACGGFBytes() {
- return acggfBytes;
- }
-
- public Set<JobFlag> getJobFlags() {
- return jobFlags;
- }
-
- public DeploymentId getDeploymentId() {
- return deploymentId;
- }
- }
-
- public static class GetResultDirectoryAddressFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_RESULT_DIRECTORY_ADDRESS;
- }
- }
-
- public static class GetResultStatusFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final JobId jobId;
-
- private final ResultSetId rsId;
-
- public GetResultStatusFunction(JobId jobId, ResultSetId rsId) {
- this.jobId = jobId;
- this.rsId = rsId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_RESULT_STATUS;
- }
-
- public JobId getJobId() {
- return jobId;
- }
-
- public ResultSetId getResultSetId() {
- return rsId;
- }
- }
-
- public static class GetResultLocationsFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final JobId jobId;
-
- private final ResultSetId rsId;
-
- private final ResultDirectoryRecord[] knownRecords;
-
- public GetResultLocationsFunction(JobId jobId, ResultSetId rsId, ResultDirectoryRecord[] knownRecords) {
- this.jobId = jobId;
- this.rsId = rsId;
- this.knownRecords = knownRecords;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_RESULT_LOCATIONS;
- }
-
- public JobId getJobId() {
- return jobId;
- }
-
- public ResultSetId getResultSetId() {
- return rsId;
- }
-
- public ResultDirectoryRecord[] getKnownRecords() {
- return knownRecords;
- }
- }
-
- public static class WaitForCompletionFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- private final JobId jobId;
-
- public WaitForCompletionFunction(JobId jobId) {
- this.jobId = jobId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.WAIT_FOR_COMPLETION;
- }
-
- public JobId getJobId() {
- return jobId;
- }
- }
-
- public static class GetNodeControllersInfoFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_NODE_CONTROLLERS_INFO;
- }
- }
-
- public static class GetClusterTopologyFunction extends Function {
- private static final long serialVersionUID = 1L;
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_CLUSTER_TOPOLOGY;
- }
- }
-
- public static class CliDeployBinaryFunction extends Function {
- private static final long serialVersionUID = 1L;
- private final List<URL> binaryURLs;
- private final DeploymentId deploymentId;
-
- public CliDeployBinaryFunction(List<URL> binaryURLs, DeploymentId deploymentId) {
- this.binaryURLs = binaryURLs;
- this.deploymentId = deploymentId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.CLI_DEPLOY_BINARY;
- }
-
- public List<URL> getBinaryURLs() {
- return binaryURLs;
- }
-
- public DeploymentId getDeploymentId() {
- return deploymentId;
- }
- }
-
- public static class CliUnDeployBinaryFunction extends Function {
- private static final long serialVersionUID = 1L;
- private final DeploymentId deploymentId;
-
- public CliUnDeployBinaryFunction(DeploymentId deploymentId) {
- this.deploymentId = deploymentId;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.CLI_UNDEPLOY_BINARY;
- }
-
- public DeploymentId getDeploymentId() {
- return deploymentId;
- }
- }
-
- public static class ClusterShutdownFunction extends Function {
- private static final long serialVersionUID = 1L;
- private final boolean terminateNCService;
-
- public ClusterShutdownFunction(boolean terminateNCService) {
- this.terminateNCService = terminateNCService;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.CLUSTER_SHUTDOWN;
- }
-
- public boolean isTerminateNCService() {
- return terminateNCService;
- }
- }
-
- public static class GetNodeDetailsJSONFunction extends Function {
- private static final long serialVersionUID = 1L;
- private final String nodeId;
- private final boolean includeStats;
- private final boolean includeConfig;
-
- public GetNodeDetailsJSONFunction(String nodeId, boolean includeStats, boolean includeConfig) {
- this.nodeId = nodeId;
- this.includeStats = includeStats;
- this.includeConfig = includeConfig;
- }
-
- public String getNodeId() {
- return nodeId;
- }
-
- public boolean isIncludeStats() {
- return includeStats;
- }
-
- public boolean isIncludeConfig() {
- return includeConfig;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.GET_NODE_DETAILS_JSON;
- }
- }
-
- public static class ThreadDumpFunction extends Function {
- private final String node;
-
- public ThreadDumpFunction(String node) {
- this.node = node;
- }
-
- @Override
- public FunctionId getFunctionId() {
- return FunctionId.THREAD_DUMP;
- }
-
- public String getNode() {
- return node;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceRemoteProxy.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceRemoteProxy.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceRemoteProxy.java
deleted file mode 100644
index 63a32f7..0000000
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksClientInterfaceRemoteProxy.java
+++ /dev/null
@@ -1,199 +0,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.
- */
-package org.apache.hyracks.api.client;
-
-import java.net.URL;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.hyracks.api.comm.NetworkAddress;
-import org.apache.hyracks.api.deployment.DeploymentId;
-import org.apache.hyracks.api.job.DeployedJobSpecId;
-import org.apache.hyracks.api.job.JobFlag;
-import org.apache.hyracks.api.job.JobId;
-import org.apache.hyracks.api.job.JobInfo;
-import org.apache.hyracks.api.job.JobStatus;
-import org.apache.hyracks.api.topology.ClusterTopology;
-import org.apache.hyracks.ipc.api.IIPCHandle;
-import org.apache.hyracks.ipc.api.RPCInterface;
-import org.apache.hyracks.ipc.exceptions.IPCException;
-
-public class HyracksClientInterfaceRemoteProxy implements IHyracksClientInterface {
- private static final int SHUTDOWN_CONNECTION_TIMEOUT_SECS = 30;
-
- private final IIPCHandle ipcHandle;
-
- private final RPCInterface rpci;
-
- public HyracksClientInterfaceRemoteProxy(IIPCHandle ipcHandle, RPCInterface rpci) {
- this.ipcHandle = ipcHandle;
- this.rpci = rpci;
- }
-
- @Override
- public ClusterControllerInfo getClusterControllerInfo() throws Exception {
- HyracksClientInterfaceFunctions.GetClusterControllerInfoFunction gccif =
- new HyracksClientInterfaceFunctions.GetClusterControllerInfoFunction();
- return (ClusterControllerInfo) rpci.call(ipcHandle, gccif);
- }
-
- @Override
- public JobStatus getJobStatus(JobId jobId) throws Exception {
- HyracksClientInterfaceFunctions.GetJobStatusFunction gjsf =
- new HyracksClientInterfaceFunctions.GetJobStatusFunction(jobId);
- return (JobStatus) rpci.call(ipcHandle, gjsf);
- }
-
- @Override
- public JobId startJob(byte[] acggfBytes, EnumSet<JobFlag> jobFlags) throws Exception {
- HyracksClientInterfaceFunctions.StartJobFunction sjf =
- new HyracksClientInterfaceFunctions.StartJobFunction(acggfBytes, jobFlags);
- return (JobId) rpci.call(ipcHandle, sjf);
- }
-
- @Override
- public void cancelJob(JobId jobId) throws Exception {
- HyracksClientInterfaceFunctions.CancelJobFunction cjf =
- new HyracksClientInterfaceFunctions.CancelJobFunction(jobId);
- rpci.call(ipcHandle, cjf);
- }
-
- @Override
- public JobId startJob(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) throws Exception {
- HyracksClientInterfaceFunctions.StartJobFunction sjf =
- new HyracksClientInterfaceFunctions.StartJobFunction(deployedJobSpecId, jobParameters);
- return (JobId) rpci.call(ipcHandle, sjf);
- }
-
- @Override
- public JobId startJob(DeploymentId deploymentId, byte[] acggfBytes, EnumSet<JobFlag> jobFlags) throws Exception {
- HyracksClientInterfaceFunctions.StartJobFunction sjf =
- new HyracksClientInterfaceFunctions.StartJobFunction(deploymentId, acggfBytes, jobFlags);
- return (JobId) rpci.call(ipcHandle, sjf);
- }
-
- @Override
- public DeployedJobSpecId deployJobSpec(byte[] acggfBytes) throws Exception {
- HyracksClientInterfaceFunctions.DeployJobSpecFunction sjf =
- new HyracksClientInterfaceFunctions.DeployJobSpecFunction(acggfBytes);
- return (DeployedJobSpecId) rpci.call(ipcHandle, sjf);
- }
-
- @Override
- public void redeployJobSpec(DeployedJobSpecId deployedJobSpecId, byte[] acggfBytes) throws Exception {
- HyracksClientInterfaceFunctions.redeployJobSpecFunction udjsf =
- new HyracksClientInterfaceFunctions.redeployJobSpecFunction(deployedJobSpecId, acggfBytes);
- rpci.call(ipcHandle, udjsf);
- }
-
- @Override
- public void undeployJobSpec(DeployedJobSpecId deployedJobSpecId) throws Exception {
- HyracksClientInterfaceFunctions.UndeployJobSpecFunction sjf =
- new HyracksClientInterfaceFunctions.UndeployJobSpecFunction(deployedJobSpecId);
- rpci.call(ipcHandle, sjf);
- }
-
- @Override
- public NetworkAddress getResultDirectoryAddress() throws Exception {
- HyracksClientInterfaceFunctions.GetResultDirectoryAddressFunction gddsf =
- new HyracksClientInterfaceFunctions.GetResultDirectoryAddressFunction();
- return (NetworkAddress) rpci.call(ipcHandle, gddsf);
- }
-
- @Override
- public void waitForCompletion(JobId jobId) throws Exception {
- HyracksClientInterfaceFunctions.WaitForCompletionFunction wfcf =
- new HyracksClientInterfaceFunctions.WaitForCompletionFunction(jobId);
- rpci.call(ipcHandle, wfcf);
- }
-
- @Override
- public Map<String, NodeControllerInfo> getNodeControllersInfo() throws Exception {
- HyracksClientInterfaceFunctions.GetNodeControllersInfoFunction gncif =
- new HyracksClientInterfaceFunctions.GetNodeControllersInfoFunction();
- return (Map<String, NodeControllerInfo>) rpci.call(ipcHandle, gncif);
- }
-
- @Override
- public ClusterTopology getClusterTopology() throws Exception {
- HyracksClientInterfaceFunctions.GetClusterTopologyFunction gctf =
- new HyracksClientInterfaceFunctions.GetClusterTopologyFunction();
- return (ClusterTopology) rpci.call(ipcHandle, gctf);
- }
-
- @Override
- public void deployBinary(List<URL> binaryURLs, DeploymentId deploymentId) throws Exception {
- HyracksClientInterfaceFunctions.CliDeployBinaryFunction dbf =
- new HyracksClientInterfaceFunctions.CliDeployBinaryFunction(binaryURLs, deploymentId);
- rpci.call(ipcHandle, dbf);
- }
-
- @Override
- public void unDeployBinary(DeploymentId deploymentId) throws Exception {
- HyracksClientInterfaceFunctions.CliUnDeployBinaryFunction dbf =
- new HyracksClientInterfaceFunctions.CliUnDeployBinaryFunction(deploymentId);
- rpci.call(ipcHandle, dbf);
- }
-
- @Override
- public JobInfo getJobInfo(JobId jobId) throws Exception {
- HyracksClientInterfaceFunctions.GetJobInfoFunction gjsf =
- new HyracksClientInterfaceFunctions.GetJobInfoFunction(jobId);
- return (JobInfo) rpci.call(ipcHandle, gjsf);
- }
-
- @Override
- public void stopCluster(boolean terminateNCService) throws Exception {
- HyracksClientInterfaceFunctions.ClusterShutdownFunction csdf =
- new HyracksClientInterfaceFunctions.ClusterShutdownFunction(terminateNCService);
- rpci.call(ipcHandle, csdf);
- int i = 0;
- // give the CC some time to do final settling after it returns our request
- while (ipcHandle.isConnected() && i++ < SHUTDOWN_CONNECTION_TIMEOUT_SECS) {
- synchronized (this) {
- wait(TimeUnit.SECONDS.toMillis(1));
- }
- }
- if (ipcHandle.isConnected()) {
- throw new IPCException(
- "CC refused to release connection after " + SHUTDOWN_CONNECTION_TIMEOUT_SECS + " seconds");
- }
- }
-
- @Override
- public String getNodeDetailsJSON(String nodeId, boolean includeStats, boolean includeConfig) throws Exception {
- HyracksClientInterfaceFunctions.GetNodeDetailsJSONFunction gjsf =
- new HyracksClientInterfaceFunctions.GetNodeDetailsJSONFunction(nodeId, includeStats, includeConfig);
- return (String) rpci.call(ipcHandle, gjsf);
- }
-
- @Override
- public String getThreadDump(String node) throws Exception {
- HyracksClientInterfaceFunctions.ThreadDumpFunction tdf =
- new HyracksClientInterfaceFunctions.ThreadDumpFunction(node);
- return (String) rpci.call(ipcHandle, tdf);
- }
-
- @Override
- public boolean isConnected() {
- return ipcHandle.isConnected();
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
deleted file mode 100644
index 48c656f..0000000
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/HyracksConnection.java
+++ /dev/null
@@ -1,480 +0,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.
- */
-package org.apache.hyracks.api.client;
-
-import java.io.File;
-import java.net.InetSocketAddress;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.entity.FileEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.DefaultHttpClient;
-import org.apache.hyracks.api.client.impl.JobSpecificationActivityClusterGraphGeneratorFactory;
-import org.apache.hyracks.api.comm.NetworkAddress;
-import org.apache.hyracks.api.deployment.DeploymentId;
-import org.apache.hyracks.api.exceptions.HyracksException;
-import org.apache.hyracks.api.job.DeployedJobSpecId;
-import org.apache.hyracks.api.job.IActivityClusterGraphGeneratorFactory;
-import org.apache.hyracks.api.job.JobFlag;
-import org.apache.hyracks.api.job.JobId;
-import org.apache.hyracks.api.job.JobInfo;
-import org.apache.hyracks.api.job.JobSpecification;
-import org.apache.hyracks.api.job.JobStatus;
-import org.apache.hyracks.api.topology.ClusterTopology;
-import org.apache.hyracks.api.util.InvokeUtil;
-import org.apache.hyracks.api.util.JavaSerializationUtils;
-import org.apache.hyracks.ipc.api.RPCInterface;
-import org.apache.hyracks.ipc.impl.IPCSystem;
-import org.apache.hyracks.ipc.impl.JavaSerializationBasedPayloadSerializerDeserializer;
-import org.apache.hyracks.util.ExitUtil;
-import org.apache.hyracks.util.InterruptibleAction;
-import org.apache.logging.log4j.Level;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-/**
- * Connection Class used by a Hyracks Client to interact with a Hyracks Cluster
- * Controller.
- *
- * @author vinayakb
- */
-public final class HyracksConnection implements IHyracksClientConnection {
-
- private static final Logger LOGGER = LogManager.getLogger();
-
- private final String ccHost;
-
- private final int ccPort;
-
- private final IPCSystem ipc;
-
- private final IHyracksClientInterface hci;
-
- private final ClusterControllerInfo ccInfo;
-
- private volatile boolean running = false;
-
- private volatile long reqId = 0L;
-
- private final ExecutorService uninterruptibleExecutor =
- Executors.newFixedThreadPool(2, r -> new Thread(r, "HyracksConnection Uninterrubtible thread: "));
-
- private final BlockingQueue<UnInterruptibleRequest<?>> uninterruptibles = new ArrayBlockingQueue<>(1);
-
- /**
- * Constructor to create a connection to the Hyracks Cluster Controller.
- *
- * @param ccHost
- * Host name (or IP Address) where the Cluster Controller can be
- * reached.
- * @param ccPort
- * Port to reach the Hyracks Cluster Controller at the specified
- * host name.
- * @throws Exception
- */
- public HyracksConnection(String ccHost, int ccPort) throws Exception {
- this.ccHost = ccHost;
- this.ccPort = ccPort;
- RPCInterface rpci = new RPCInterface();
- ipc = new IPCSystem(new InetSocketAddress(0), rpci, new JavaSerializationBasedPayloadSerializerDeserializer());
- ipc.start();
- hci = new HyracksClientInterfaceRemoteProxy(ipc.getReconnectingHandle(new InetSocketAddress(ccHost, ccPort)),
- rpci);
- ccInfo = hci.getClusterControllerInfo();
- uninterruptibleExecutor.execute(new UninterrubtileRequestHandler());
- uninterruptibleExecutor.execute(new UninterrubtileHandlerWatcher());
- }
-
- @Override
- public JobStatus getJobStatus(JobId jobId) throws Exception {
- return hci.getJobStatus(jobId);
- }
-
- @Override
- public void cancelJob(JobId jobId) throws Exception {
- CancelJobRequest request = new CancelJobRequest(jobId);
- uninterruptiblySubmitAndExecute(request);
- }
-
- @Override
- public JobId startJob(JobSpecification jobSpec) throws Exception {
- return startJob(jobSpec, EnumSet.noneOf(JobFlag.class));
- }
-
- @Override
- public JobId startJob(JobSpecification jobSpec, EnumSet<JobFlag> jobFlags) throws Exception {
- IActivityClusterGraphGeneratorFactory jsacggf =
- new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
- return startJob(jsacggf, jobFlags);
- }
-
- @Override
- public void redeployJobSpec(DeployedJobSpecId deployedJobSpecId, JobSpecification jobSpec) throws Exception {
- JobSpecificationActivityClusterGraphGeneratorFactory jsacggf =
- new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
- hci.redeployJobSpec(deployedJobSpecId, JavaSerializationUtils.serialize(jsacggf));
- }
-
- @Override
- public DeployedJobSpecId deployJobSpec(JobSpecification jobSpec) throws Exception {
- JobSpecificationActivityClusterGraphGeneratorFactory jsacggf =
- new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
- return deployJobSpec(jsacggf);
- }
-
- @Override
- public void undeployJobSpec(DeployedJobSpecId deployedJobSpecId) throws Exception {
- hci.undeployJobSpec(deployedJobSpecId);
- }
-
- @Override
- public JobId startJob(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) throws Exception {
- StartDeployedJobRequest request = new StartDeployedJobRequest(deployedJobSpecId, jobParameters);
- return interruptiblySubmitAndExecute(request);
- }
-
- @Override
- public JobId startJob(IActivityClusterGraphGeneratorFactory acggf, EnumSet<JobFlag> jobFlags) throws Exception {
- return startJob(null, acggf, jobFlags);
- }
-
- public DeployedJobSpecId deployJobSpec(IActivityClusterGraphGeneratorFactory acggf) throws Exception {
- return hci.deployJobSpec(JavaSerializationUtils.serialize(acggf));
- }
-
- @Override
- public NetworkAddress getResultDirectoryAddress() throws Exception {
- return hci.getResultDirectoryAddress();
- }
-
- @Override
- public void waitForCompletion(JobId jobId) throws Exception {
- try {
- hci.waitForCompletion(jobId);
- } catch (InterruptedException e) {
- // Cancels an on-going job if the current thread gets interrupted.
- cancelJob(jobId);
- throw e;
- }
- }
-
- @Override
- public Map<String, NodeControllerInfo> getNodeControllerInfos() throws HyracksException {
- try {
- return hci.getNodeControllersInfo();
- } catch (Exception e) {
- throw HyracksException.create(e);
- }
- }
-
- @Override
- public ClusterTopology getClusterTopology() throws HyracksException {
- try {
- return hci.getClusterTopology();
- } catch (Exception e) {
- throw HyracksException.create(e);
- }
- }
-
- @Override
- public DeploymentId deployBinary(List<String> jars) throws Exception {
- /** generate a deployment id */
- DeploymentId deploymentId = new DeploymentId(UUID.randomUUID().toString());
- List<URL> binaryURLs = new ArrayList<>();
- if (jars != null && !jars.isEmpty()) {
- CloseableHttpClient hc = new DefaultHttpClient();
- try {
- /** upload jars through a http client one-by-one to the CC server */
- for (String jar : jars) {
- int slashIndex = jar.lastIndexOf('/');
- String fileName = jar.substring(slashIndex + 1);
- String url = "http://" + ccHost + ":" + ccInfo.getWebPort() + "/applications/"
- + deploymentId.toString() + "&" + fileName;
- HttpPut put = new HttpPut(url);
- put.setEntity(new FileEntity(new File(jar), "application/octet-stream"));
- HttpResponse response = hc.execute(put);
- response.getEntity().consumeContent();
- if (response.getStatusLine().getStatusCode() != 200) {
- hci.unDeployBinary(deploymentId);
- throw new HyracksException(response.getStatusLine().toString());
- }
- /** add the uploaded URL address into the URLs of jars to be deployed at NCs */
- binaryURLs.add(new URL(url));
- }
- } finally {
- hc.close();
- }
- }
- /** deploy the URLs to the CC and NCs */
- hci.deployBinary(binaryURLs, deploymentId);
- return deploymentId;
- }
-
- @Override
- public void unDeployBinary(DeploymentId deploymentId) throws Exception {
- hci.unDeployBinary(deploymentId);
- }
-
- @Override
- public JobId startJob(DeploymentId deploymentId, JobSpecification jobSpec) throws Exception {
- return startJob(deploymentId, jobSpec, EnumSet.noneOf(JobFlag.class));
- }
-
- @Override
- public JobId startJob(DeploymentId deploymentId, JobSpecification jobSpec, EnumSet<JobFlag> jobFlags)
- throws Exception {
- IActivityClusterGraphGeneratorFactory jsacggf =
- new JobSpecificationActivityClusterGraphGeneratorFactory(jobSpec);
- return startJob(deploymentId, jsacggf, jobFlags);
- }
-
- @Override
- public JobId startJob(DeploymentId deploymentId, IActivityClusterGraphGeneratorFactory acggf,
- EnumSet<JobFlag> jobFlags) throws Exception {
- StartJobRequest request = new StartJobRequest(deploymentId, acggf, jobFlags);
- return interruptiblySubmitAndExecute(request);
- }
-
- @Override
- public JobInfo getJobInfo(JobId jobId) throws Exception {
- return hci.getJobInfo(jobId);
- }
-
- @Override
- public void stopCluster(boolean terminateNCService) throws Exception {
- hci.stopCluster(terminateNCService);
- }
-
- @Override
- public String getNodeDetailsJSON(String nodeId, boolean includeStats, boolean includeConfig) throws Exception {
- return hci.getNodeDetailsJSON(nodeId, includeStats, includeConfig);
- }
-
- @Override
- public String getThreadDump(String node) throws Exception {
- return hci.getThreadDump(node);
- }
-
- @Override
- public String getHost() {
- return ccHost;
- }
-
- @Override
- public int getPort() {
- return ccPort;
- }
-
- @Override
- public boolean isConnected() {
- return hci.isConnected();
- }
-
- private <T> T uninterruptiblySubmitAndExecute(UnInterruptibleRequest<T> request) throws Exception {
- InvokeUtil.doUninterruptibly(() -> uninterruptibles.put(request));
- return uninterruptiblyExecute(request);
- }
-
- private <T> T uninterruptiblyExecute(UnInterruptibleRequest<T> request) throws Exception {
- InvokeUtil.doUninterruptibly(request);
- return request.result();
- }
-
- private <T> T interruptiblySubmitAndExecute(UnInterruptibleRequest<T> request) throws Exception {
- uninterruptibles.put(request);
- return uninterruptiblyExecute(request);
- }
-
- private abstract class UnInterruptibleRequest<T> implements InterruptibleAction {
- boolean completed = false;
- boolean failed = false;
- Throwable failure = null;
- T response = null;
-
- @SuppressWarnings("squid:S1181")
- private final void handle() {
- try {
- response = doHandle();
- } catch (Throwable th) {
- failed = true;
- failure = th;
- } finally {
- synchronized (this) {
- completed = true;
- notifyAll();
- }
- }
- }
-
- protected abstract T doHandle() throws Exception;
-
- @Override
- public final synchronized void run() throws InterruptedException {
- while (!completed) {
- wait();
- }
- }
-
- public T result() throws Exception {
- if (failed) {
- if (failure instanceof Error) {
- throw (Error) failure;
- }
- throw (Exception) failure;
- }
- return response;
- }
- }
-
- private class CancelJobRequest extends UnInterruptibleRequest<Void> {
- final JobId jobId;
-
- public CancelJobRequest(JobId jobId) {
- this.jobId = jobId;
- }
-
- @Override
- protected Void doHandle() throws Exception {
- hci.cancelJob(jobId);
- return null;
- }
-
- @Override
- public String toString() {
- return "CancelJobRequest: " + jobId.toString();
- }
-
- }
-
- private class StartDeployedJobRequest extends UnInterruptibleRequest<JobId> {
-
- private final DeployedJobSpecId deployedJobSpecId;
- private final Map<byte[], byte[]> jobParameters;
-
- public StartDeployedJobRequest(DeployedJobSpecId deployedJobSpecId, Map<byte[], byte[]> jobParameters) {
- this.deployedJobSpecId = deployedJobSpecId;
- this.jobParameters = jobParameters;
- }
-
- @Override
- protected JobId doHandle() throws Exception {
- return hci.startJob(deployedJobSpecId, jobParameters);
- }
-
- }
-
- private class StartJobRequest extends UnInterruptibleRequest<JobId> {
- private final DeploymentId deploymentId;
- private final IActivityClusterGraphGeneratorFactory acggf;
- private final EnumSet<JobFlag> jobFlags;
-
- public StartJobRequest(DeploymentId deploymentId, IActivityClusterGraphGeneratorFactory acggf,
- EnumSet<JobFlag> jobFlags) {
- this.deploymentId = deploymentId;
- this.acggf = acggf;
- this.jobFlags = jobFlags;
- }
-
- @Override
- protected JobId doHandle() throws Exception {
- if (deploymentId == null) {
- return hci.startJob(JavaSerializationUtils.serialize(acggf), jobFlags);
- } else {
- return hci.startJob(deploymentId, JavaSerializationUtils.serialize(acggf), jobFlags);
- }
- }
-
- @Override
- public String toString() {
- return "StartJobRequest";
- }
-
- }
-
- private class UninterrubtileRequestHandler implements Runnable {
- @SuppressWarnings({ "squid:S2189", "squid:S2142" })
- @Override
- public void run() {
- String nameBefore = Thread.currentThread().getName();
- Thread.currentThread().setName(nameBefore + getClass().getSimpleName());
- try {
- while (true) {
- try {
- UnInterruptibleRequest<?> current = uninterruptibles.take();
- reqId++;
- running = true;
- current.handle();
- } catch (InterruptedException e) {
- LOGGER.log(Level.WARN, "Ignoring interrupt. This thread should never be interrupted.");
- continue;
- } finally {
- running = false;
- }
- }
- } finally {
- Thread.currentThread().setName(nameBefore);
- }
- }
- }
-
- public class UninterrubtileHandlerWatcher implements Runnable {
- @Override
- @SuppressWarnings({ "squid:S2189", "squid:S2142" })
- public void run() {
- String nameBefore = Thread.currentThread().getName();
- Thread.currentThread().setName(nameBefore + getClass().getSimpleName());
- try {
- long currentReqId = 0L;
- long currentTime = System.nanoTime();
- while (true) {
- try {
- TimeUnit.MINUTES.sleep(1);
- } catch (InterruptedException e) {
- LOGGER.log(Level.WARN, "Ignoring interrupt. This thread should never be interrupted.");
- continue;
- }
- if (running) {
- if (reqId == currentReqId) {
- if (TimeUnit.NANOSECONDS.toMinutes(System.nanoTime() - currentTime) > 0) {
- ExitUtil.halt(ExitUtil.EC_FAILED_TO_PROCESS_UN_INTERRUPTIBLE_REQUEST);
- }
- } else {
- currentReqId = reqId;
- currentTime = System.nanoTime();
- }
- }
- }
- } finally {
- Thread.currentThread().setName(nameBefore);
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/IHyracksClientInterface.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/IHyracksClientInterface.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/IHyracksClientInterface.java
index 4cc47d2..e92db5e 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/IHyracksClientInterface.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/IHyracksClientInterface.java
@@ -23,6 +23,7 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Map;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
import org.apache.hyracks.api.comm.NetworkAddress;
import org.apache.hyracks.api.deployment.DeploymentId;
import org.apache.hyracks.api.job.DeployedJobSpecId;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/impl/ClusterControllerInfo.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/impl/ClusterControllerInfo.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/impl/ClusterControllerInfo.java
new file mode 100644
index 0000000..7d0dd61
--- /dev/null
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/client/impl/ClusterControllerInfo.java
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.hyracks.api.client.impl;
+
+import java.io.Serializable;
+
+import org.apache.hyracks.api.control.CcId;
+
+public class ClusterControllerInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private final CcId ccId;
+
+ private final String clientNetAddress;
+
+ private final int clientNetPort;
+
+ private final int webPort;
+
+ public ClusterControllerInfo(CcId ccId, String clientNetAddress, int clientNetPort, int webPort) {
+ this.ccId = ccId;
+ this.clientNetAddress = clientNetAddress;
+ this.clientNetPort = clientNetPort;
+ this.webPort = webPort;
+ }
+
+ public CcId getCcId() {
+ return ccId;
+ }
+
+ public int getWebPort() {
+ return webPort;
+ }
+
+ public String getClientNetAddress() {
+ return clientNetAddress;
+ }
+
+ public int getClientNetPort() {
+ return clientNetPort;
+ }
+}
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/ICCContext.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/ICCContext.java b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/ICCContext.java
index 83e0482..c3da155 100644
--- a/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/ICCContext.java
+++ b/hyracks-fullstack/hyracks/hyracks-api/src/main/java/org/apache/hyracks/api/context/ICCContext.java
@@ -22,7 +22,7 @@ import java.net.InetAddress;
import java.util.Map;
import java.util.Set;
-import org.apache.hyracks.api.client.ClusterControllerInfo;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
import org.apache.hyracks.api.exceptions.HyracksDataException;
import org.apache.hyracks.api.topology.ClusterTopology;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-client/src/main/java/org/apache/hyracks/client/result/ResultDirectoryRemoteProxy.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-client/src/main/java/org/apache/hyracks/client/result/ResultDirectoryRemoteProxy.java b/hyracks-fullstack/hyracks/hyracks-client/src/main/java/org/apache/hyracks/client/result/ResultDirectoryRemoteProxy.java
index 77c6e4b..e802ef9 100644
--- a/hyracks-fullstack/hyracks/hyracks-client/src/main/java/org/apache/hyracks/client/result/ResultDirectoryRemoteProxy.java
+++ b/hyracks-fullstack/hyracks/hyracks-client/src/main/java/org/apache/hyracks/client/result/ResultDirectoryRemoteProxy.java
@@ -18,14 +18,14 @@
*/
package org.apache.hyracks.client.result;
-import org.apache.hyracks.api.client.HyracksClientInterfaceFunctions;
-import org.apache.hyracks.api.result.ResultJobRecord.Status;
+import org.apache.hyracks.api.job.JobId;
import org.apache.hyracks.api.result.IResultDirectory;
import org.apache.hyracks.api.result.ResultDirectoryRecord;
+import org.apache.hyracks.api.result.ResultJobRecord.Status;
import org.apache.hyracks.api.result.ResultSetId;
-import org.apache.hyracks.api.job.JobId;
import org.apache.hyracks.ipc.api.IIPCHandle;
import org.apache.hyracks.ipc.api.RPCInterface;
+import org.apache.hyracks.ipc.impl.HyracksClientInterfaceFunctions;
//TODO(madhusudancs): Should this implementation be moved to org.apache.hyracks.client?
public class ResultDirectoryRemoteProxy implements IResultDirectory {
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-client/src/test/java/org/apache/hyracks/client/stats/HyracksUtils.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-client/src/test/java/org/apache/hyracks/client/stats/HyracksUtils.java b/hyracks-fullstack/hyracks/hyracks-client/src/test/java/org/apache/hyracks/client/stats/HyracksUtils.java
index 3eff037..cf77c72 100644
--- a/hyracks-fullstack/hyracks/hyracks-client/src/test/java/org/apache/hyracks/client/stats/HyracksUtils.java
+++ b/hyracks-fullstack/hyracks/hyracks-client/src/test/java/org/apache/hyracks/client/stats/HyracksUtils.java
@@ -21,7 +21,6 @@ package org.apache.hyracks.client.stats;
import java.util.EnumSet;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.job.JobFlag;
import org.apache.hyracks.api.job.JobId;
@@ -30,6 +29,7 @@ import org.apache.hyracks.control.cc.ClusterControllerService;
import org.apache.hyracks.control.common.controllers.CCConfig;
import org.apache.hyracks.control.common.controllers.NCConfig;
import org.apache.hyracks.control.nc.NodeControllerService;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
public class HyracksUtils {
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClientInterfaceIPCI.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClientInterfaceIPCI.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClientInterfaceIPCI.java
index 2edbab8..f2ea988 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClientInterfaceIPCI.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClientInterfaceIPCI.java
@@ -18,7 +18,6 @@
*/
package org.apache.hyracks.control.cc;
-import org.apache.hyracks.api.client.HyracksClientInterfaceFunctions;
import org.apache.hyracks.api.comm.NetworkAddress;
import org.apache.hyracks.api.job.DeployedJobSpecId;
import org.apache.hyracks.api.job.DeployedJobSpecIdFactory;
@@ -45,6 +44,7 @@ import org.apache.hyracks.control.common.work.IPCResponder;
import org.apache.hyracks.ipc.api.IIPCHandle;
import org.apache.hyracks.ipc.api.IIPCI;
import org.apache.hyracks.ipc.exceptions.IPCException;
+import org.apache.hyracks.ipc.impl.HyracksClientInterfaceFunctions;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
index b2e4a5e..e751589 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-cc/src/main/java/org/apache/hyracks/control/cc/ClusterControllerService.java
@@ -36,7 +36,7 @@ import java.util.TreeMap;
import java.util.concurrent.ExecutorService;
import org.apache.hyracks.api.application.ICCApplication;
-import org.apache.hyracks.api.client.ClusterControllerInfo;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
import org.apache.hyracks.api.comm.NetworkAddress;
import org.apache.hyracks.api.config.IApplicationConfig;
import org.apache.hyracks.api.context.ICCContext;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeParameters.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeParameters.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeParameters.java
index e78a423..d9165e1 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeParameters.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-common/src/main/java/org/apache/hyracks/control/common/controllers/NodeParameters.java
@@ -20,7 +20,7 @@ package org.apache.hyracks.control.common.controllers;
import java.io.Serializable;
-import org.apache.hyracks.api.client.ClusterControllerInfo;
+import org.apache.hyracks.api.client.impl.ClusterControllerInfo;
public class NodeParameters implements Serializable {
private static final long serialVersionUID = 1L;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/pom.xml b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/pom.xml
index 4dae07a..69a80c7 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/pom.xml
@@ -77,6 +77,11 @@
<artifactId>hyracks-data-std</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
</dependencies>
<build>
<plugins>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
index 8ac34d8..872fd35 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/InsertPipelineExample.java
@@ -19,7 +19,6 @@
package org.apache.hyracks.examples.btree.client;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
import org.apache.hyracks.api.dataflow.IConnectorDescriptor;
@@ -43,6 +42,7 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
import org.apache.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
import org.apache.hyracks.examples.btree.helper.DataGenOperatorDescriptor;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.TreeIndexInsertUpdateDeleteOperatorDescriptor;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
index 2fb1cee..5ba53d5 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexBulkLoadExample.java
@@ -18,7 +18,6 @@
*/
package org.apache.hyracks.examples.btree.client;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.constraints.PartitionConstraintHelper;
import org.apache.hyracks.api.dataflow.IConnectorDescriptor;
@@ -43,6 +42,7 @@ import org.apache.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
import org.apache.hyracks.examples.btree.helper.DataGenOperatorDescriptor;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.TreeIndexBulkLoadOperatorDescriptor;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
index c32b72c..a6b9af5 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/PrimaryIndexSearchExample.java
@@ -20,7 +20,6 @@ package org.apache.hyracks.examples.btree.client;
import java.io.DataOutput;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -40,6 +39,7 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
import org.apache.hyracks.dataflow.std.misc.ConstantTupleSourceOperatorDescriptor;
import org.apache.hyracks.dataflow.std.misc.PrinterOperatorDescriptor;
import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.btree.dataflow.BTreeSearchOperatorDescriptor;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
index a8bea08..f266fa8 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexBulkLoadExample.java
@@ -18,7 +18,6 @@
*/
package org.apache.hyracks.examples.btree.client;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -36,6 +35,7 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
import org.apache.hyracks.dataflow.std.misc.NullSinkOperatorDescriptor;
import org.apache.hyracks.dataflow.std.sort.ExternalSortOperatorDescriptor;
import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.TreeIndexBulkLoadOperatorDescriptor;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
index ccf20fe..2f0ad23 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/btree-example/btreeclient/src/main/java/org/apache/hyracks/examples/btree/client/SecondaryIndexSearchExample.java
@@ -20,7 +20,6 @@ package org.apache.hyracks.examples.btree.client;
import java.io.DataOutput;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.dataflow.value.IBinaryComparatorFactory;
import org.apache.hyracks.api.dataflow.value.ISerializerDeserializer;
@@ -40,6 +39,7 @@ import org.apache.hyracks.dataflow.std.file.IFileSplitProvider;
import org.apache.hyracks.dataflow.std.misc.ConstantTupleSourceOperatorDescriptor;
import org.apache.hyracks.dataflow.std.misc.PrinterOperatorDescriptor;
import org.apache.hyracks.examples.btree.helper.BTreeHelperStorageManager;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.hyracks.storage.am.btree.dataflow.BTreeSearchOperatorDescriptor;
import org.apache.hyracks.storage.am.common.dataflow.IIndexDataflowHelperFactory;
import org.apache.hyracks.storage.am.common.dataflow.IndexDataflowHelperFactory;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/pom.xml
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/pom.xml b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/pom.xml
index 98cdea8..a6c7aca 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/pom.xml
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/pom.xml
@@ -146,6 +146,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.hyracks</groupId>
+ <artifactId>hyracks-ipc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
index 5dcc99a..a4a00ce 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractIntegrationTest.java
@@ -32,7 +32,6 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.commons.io.FileUtils;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.comm.IFrameTupleAccessor;
import org.apache.hyracks.api.comm.VSizeFrame;
@@ -53,6 +52,7 @@ import org.apache.hyracks.control.nc.NodeControllerService;
import org.apache.hyracks.control.nc.resources.memory.FrameManager;
import org.apache.hyracks.dataflow.common.comm.io.ResultFrameTupleAccessor;
import org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.AfterClass;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractMultiNCIntegrationTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractMultiNCIntegrationTest.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractMultiNCIntegrationTest.java
index 55fd9a0..4bee7ee 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractMultiNCIntegrationTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/AbstractMultiNCIntegrationTest.java
@@ -25,7 +25,6 @@ import java.util.EnumSet;
import java.util.List;
import org.apache.commons.io.FileUtils;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.comm.IFrameTupleAccessor;
import org.apache.hyracks.api.comm.VSizeFrame;
@@ -48,6 +47,7 @@ import org.apache.hyracks.control.nc.NodeControllerService;
import org.apache.hyracks.control.nc.resources.memory.FrameManager;
import org.apache.hyracks.dataflow.common.comm.io.ResultFrameTupleAccessor;
import org.apache.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.AfterClass;
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/da7e8a16/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/DeployedJobSpecsTest.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/DeployedJobSpecsTest.java b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/DeployedJobSpecsTest.java
index d8f4064..8e84b89 100644
--- a/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/DeployedJobSpecsTest.java
+++ b/hyracks-fullstack/hyracks/hyracks-examples/hyracks-integration-tests/src/test/java/org/apache/hyracks/tests/integration/DeployedJobSpecsTest.java
@@ -27,7 +27,6 @@ import java.lang.reflect.Field;
import java.util.HashMap;
import org.apache.commons.io.FileUtils;
-import org.apache.hyracks.api.client.HyracksConnection;
import org.apache.hyracks.api.client.IHyracksClientConnection;
import org.apache.hyracks.api.job.DeployedJobSpecId;
import org.apache.hyracks.api.job.JobId;
@@ -38,6 +37,7 @@ import org.apache.hyracks.control.cc.cluster.NodeManager;
import org.apache.hyracks.control.common.controllers.CCConfig;
import org.apache.hyracks.control.common.controllers.NCConfig;
import org.apache.hyracks.control.nc.NodeControllerService;
+import org.apache.hyracks.ipc.impl.HyracksConnection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.AfterClass;