diff --git a/computer-k8s-operator/src/main/java/com/baidu/hugegraph/computer/k8s/operator/controller/ComputerJobDeployer.java b/computer-k8s-operator/src/main/java/com/baidu/hugegraph/computer/k8s/operator/controller/ComputerJobDeployer.java index b14771cb6..b91d88f3b 100644 --- a/computer-k8s-operator/src/main/java/com/baidu/hugegraph/computer/k8s/operator/controller/ComputerJobDeployer.java +++ b/computer-k8s-operator/src/main/java/com/baidu/hugegraph/computer/k8s/operator/controller/ComputerJobDeployer.java @@ -31,6 +31,9 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.hugegraph.config.HugeConfig; +import org.apache.hugegraph.util.E; +import org.apache.hugegraph.util.Log; import org.slf4j.Logger; import com.baidu.hugegraph.computer.driver.config.ComputerOptions; @@ -40,9 +43,6 @@ import com.baidu.hugegraph.computer.k8s.crd.model.ResourceName; import com.baidu.hugegraph.computer.k8s.operator.config.OperatorOptions; import com.baidu.hugegraph.computer.k8s.util.KubeUtil; -import org.apache.hugegraph.config.HugeConfig; -import org.apache.hugegraph.util.E; -import org.apache.hugegraph.util.Log; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -93,7 +93,7 @@ public class ComputerJobDeployer { private static final String TRANSPORT_PORT_NAME = "transport-port"; private static final String RPC_PORT_NAME = "rpc-port"; private static final int DEFAULT_TRANSPORT_PORT = 8099; - private static final int DEFAULT_RPC_PORT = 8090; + private static final int DEFAULT_RPC_PORT = 8093; private static final String COMPUTER_CONFIG_MAP_VOLUME = "computer-config-map-volume"; diff --git a/computer-test/src/main/java/com/baidu/hugegraph/computer/algorithm/AlgorithmTestBase.java b/computer-test/src/main/java/com/baidu/hugegraph/computer/algorithm/AlgorithmTestBase.java index 8ddb70baa..841473458 100644 --- a/computer-test/src/main/java/com/baidu/hugegraph/computer/algorithm/AlgorithmTestBase.java +++ b/computer-test/src/main/java/com/baidu/hugegraph/computer/algorithm/AlgorithmTestBase.java @@ -26,6 +26,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.apache.hugegraph.config.RpcOptions; +import org.apache.hugegraph.testutil.Assert; +import org.apache.hugegraph.util.Log; import org.slf4j.Logger; import com.baidu.hugegraph.computer.core.config.ComputerOptions; @@ -35,9 +38,6 @@ import com.baidu.hugegraph.computer.core.worker.MockWorkerService; import com.baidu.hugegraph.computer.core.worker.WorkerService; import com.baidu.hugegraph.computer.suite.unit.UnitTestBase; -import org.apache.hugegraph.config.RpcOptions; -import org.apache.hugegraph.testutil.Assert; -import org.apache.hugegraph.util.Log; public class AlgorithmTestBase extends UnitTestBase { @@ -54,8 +54,6 @@ public static void runAlgorithm(String algorithmParams, String ... options) WorkerService workerService = null; try { Map params = new HashMap<>(); - params.put(RpcOptions.RPC_REMOTE_URL.name(), - "127.0.0.1:8090"); params.put(ComputerOptions.JOB_ID.name(), "algo_test_job1"); params.put(ComputerOptions.JOB_WORKERS_COUNT.name(), @@ -101,8 +99,6 @@ public static void runAlgorithm(String algorithmParams, String ... options) Map params = new HashMap<>(); params.put(RpcOptions.RPC_SERVER_HOST.name(), "localhost"); - params.put(RpcOptions.RPC_SERVER_PORT.name(), - "8090"); params.put(ComputerOptions.JOB_ID.name(), "algo_test_job1"); params.put(ComputerOptions.JOB_WORKERS_COUNT.name(), diff --git a/computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/DataServerManagerTest.java b/computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/DataServerManagerTest.java index 84d7f043e..284d69c79 100644 --- a/computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/DataServerManagerTest.java +++ b/computer-test/src/main/java/com/baidu/hugegraph/computer/core/network/DataServerManagerTest.java @@ -21,6 +21,7 @@ import java.net.InetSocketAddress; +import org.apache.hugegraph.testutil.Assert; import org.junit.Test; import com.baidu.hugegraph.computer.core.common.exception.TransportException; @@ -35,15 +36,12 @@ import com.baidu.hugegraph.computer.core.worker.MockComputation; import com.baidu.hugegraph.computer.core.worker.MockMasterComputation; import com.baidu.hugegraph.computer.suite.unit.UnitTestBase; -import org.apache.hugegraph.config.RpcOptions; -import org.apache.hugegraph.testutil.Assert; public class DataServerManagerTest extends UnitTestBase { @Test public void test() { Config config = UnitTestBase.updateWithRequiredOptions( - RpcOptions.RPC_REMOTE_URL, "127.0.0.1:8090", ComputerOptions.JOB_ID, "local_001", ComputerOptions.JOB_WORKERS_COUNT, "1", ComputerOptions.BSP_LOG_INTERVAL, "30000", diff --git a/computer-test/src/main/java/com/baidu/hugegraph/computer/core/sender/QueuedMessageSenderTest.java b/computer-test/src/main/java/com/baidu/hugegraph/computer/core/sender/QueuedMessageSenderTest.java index d5031f43a..b91b3c11b 100644 --- a/computer-test/src/main/java/com/baidu/hugegraph/computer/core/sender/QueuedMessageSenderTest.java +++ b/computer-test/src/main/java/com/baidu/hugegraph/computer/core/sender/QueuedMessageSenderTest.java @@ -19,6 +19,8 @@ package com.baidu.hugegraph.computer.core.sender; +import org.apache.hugegraph.testutil.Assert; +import org.apache.hugegraph.testutil.Whitebox; import org.junit.Before; import org.junit.Test; @@ -26,19 +28,15 @@ import com.baidu.hugegraph.computer.core.config.Config; import com.baidu.hugegraph.computer.core.worker.MockComputation2; import com.baidu.hugegraph.computer.suite.unit.UnitTestBase; -import org.apache.hugegraph.config.RpcOptions; -import org.apache.hugegraph.testutil.Assert; -import org.apache.hugegraph.testutil.Whitebox; import com.google.common.collect.ImmutableSet; -public class QueuedMessageSenderTest { +public class QueuedMessageSenderTest extends UnitTestBase { private Config config; @Before public void setup() { this.config = UnitTestBase.updateWithRequiredOptions( - RpcOptions.RPC_REMOTE_URL, "127.0.0.1:8090", ComputerOptions.JOB_ID, "local_002", ComputerOptions.JOB_WORKERS_COUNT, "2", ComputerOptions.JOB_PARTITIONS_COUNT, "2", diff --git a/computer-test/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerServiceTest.java b/computer-test/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerServiceTest.java index 9bcb7a89f..772bf7cc3 100644 --- a/computer-test/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerServiceTest.java +++ b/computer-test/src/main/java/com/baidu/hugegraph/computer/core/worker/WorkerServiceTest.java @@ -24,6 +24,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import org.apache.hugegraph.config.RpcOptions; +import org.apache.hugegraph.testutil.Assert; +import org.apache.hugegraph.util.Log; import org.junit.Test; import org.slf4j.Logger; @@ -34,9 +37,6 @@ import com.baidu.hugegraph.computer.core.master.MasterService; import com.baidu.hugegraph.computer.core.output.LimitedLogOutput; import com.baidu.hugegraph.computer.suite.unit.UnitTestBase; -import org.apache.hugegraph.config.RpcOptions; -import org.apache.hugegraph.testutil.Assert; -import org.apache.hugegraph.util.Log; public class WorkerServiceTest extends UnitTestBase { @@ -50,7 +50,6 @@ public void testServiceWith1Worker() throws InterruptedException { pool.submit(() -> { Config config = UnitTestBase.updateWithRequiredOptions( - RpcOptions.RPC_REMOTE_URL, "127.0.0.1:8090", ComputerOptions.JOB_ID, "local_002", ComputerOptions.JOB_WORKERS_COUNT, "1", ComputerOptions.TRANSPORT_SERVER_PORT, "8086", @@ -87,7 +86,6 @@ public void testServiceWith1Worker() throws InterruptedException { pool.submit(() -> { Config config = UnitTestBase.updateWithRequiredOptions( RpcOptions.RPC_SERVER_HOST, "localhost", - RpcOptions.RPC_SERVER_PORT, "8090", ComputerOptions.JOB_ID, "local_002", ComputerOptions.JOB_WORKERS_COUNT, "1", ComputerOptions.BSP_REGISTER_TIMEOUT, "100000", @@ -138,7 +136,6 @@ public void testServiceWith2Workers() throws InterruptedException { pool.submit(() -> { Config config = UnitTestBase.updateWithRequiredOptions( - RpcOptions.RPC_REMOTE_URL, "127.0.0.1:8090", ComputerOptions.JOB_ID, "local_003", ComputerOptions.JOB_WORKERS_COUNT, "2", ComputerOptions.JOB_PARTITIONS_COUNT, "2", @@ -169,7 +166,6 @@ public void testServiceWith2Workers() throws InterruptedException { pool.submit(() -> { Config config = UnitTestBase.updateWithRequiredOptions( - RpcOptions.RPC_REMOTE_URL, "127.0.0.1:8090", ComputerOptions.JOB_ID, "local_003", ComputerOptions.JOB_WORKERS_COUNT, "2", ComputerOptions.JOB_PARTITIONS_COUNT, "2", @@ -201,7 +197,6 @@ public void testServiceWith2Workers() throws InterruptedException { pool.submit(() -> { Config config = UnitTestBase.updateWithRequiredOptions( RpcOptions.RPC_SERVER_HOST, "localhost", - RpcOptions.RPC_SERVER_PORT, "8090", ComputerOptions.JOB_ID, "local_003", ComputerOptions.JOB_WORKERS_COUNT, "2", ComputerOptions.JOB_PARTITIONS_COUNT, "2", @@ -238,7 +233,6 @@ public void testServiceWith2Workers() throws InterruptedException { @Test public void testFailToConnectEtcd() { Config config = UnitTestBase.updateWithRequiredOptions( - RpcOptions.RPC_REMOTE_URL, "127.0.0.1:8090", // Unavailable etcd endpoints ComputerOptions.BSP_ETCD_ENDPOINTS, "http://abc:8098", ComputerOptions.JOB_ID, "local_004", diff --git a/computer-test/src/main/resources/computer-worker1.properties b/computer-test/src/main/resources/computer-worker1.properties index d5acd63c1..8852515b8 100644 --- a/computer-test/src/main/resources/computer-worker1.properties +++ b/computer-test/src/main/resources/computer-worker1.properties @@ -1,5 +1,3 @@ -rpc.remote_url=127.0.0.1:8090 - job.id=local_002 job.workers_count=1