Skip to content

Commit

Permalink
remove unless RPC_REMOTE_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Nov 22, 2022
1 parent b903936 commit 875baeb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand All @@ -54,8 +54,6 @@ public static void runAlgorithm(String algorithmParams, String ... options)
WorkerService workerService = null;
try {
Map<String, String> 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(),
Expand Down Expand Up @@ -101,8 +99,6 @@ public static void runAlgorithm(String algorithmParams, String ... options)
Map<String, String> 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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,24 @@

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;

import com.baidu.hugegraph.computer.core.config.ComputerOptions;
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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 {

Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions computer-test/src/main/resources/computer-worker1.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
rpc.remote_url=127.0.0.1:8090

job.id=local_002
job.workers_count=1

Expand Down

0 comments on commit 875baeb

Please sign in to comment.