mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 01:00:10 +08:00
[Java] Do not expose GcsClient to normal users (#4675)
This commit is contained in:
@@ -20,7 +20,8 @@ public class MicroBenchmarks {
|
||||
}
|
||||
final long duration = System.nanoTime() - start;
|
||||
LOGGER.info(
|
||||
"Benchmark \"{}\" finished, repeated {} times, total duration {} ms, average duration {} ns.",
|
||||
"Benchmark \"{}\" finished, repeated {} times, total duration {} ms," +
|
||||
" average duration {} ns.",
|
||||
name, numRepeats, duration / 1_000_000, duration / numRepeats);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import com.google.common.base.Preconditions;
|
||||
import java.util.List;
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.TestUtils;
|
||||
import org.ray.api.gcs.GcsClient;
|
||||
import org.ray.api.gcs.NodeInfo;
|
||||
import org.ray.api.runtimecontext.NodeInfo;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.ray.runtime.config.RayConfig;
|
||||
import org.ray.runtime.gcs.GcsClient;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
@@ -31,7 +31,7 @@ public class GcsClientTest extends BaseTest {
|
||||
RayConfig config = ((AbstractRayRuntime)Ray.internal()).getRayConfig();
|
||||
|
||||
Preconditions.checkNotNull(config);
|
||||
GcsClient gcsClient = Ray.getGcsClient();
|
||||
GcsClient gcsClient = ((AbstractRayRuntime)Ray.internal()).getGcsClient();
|
||||
List<NodeInfo> allNodeInfo = gcsClient.getAllNodeInfo();
|
||||
Assert.assertEquals(allNodeInfo.size(), 1);
|
||||
Assert.assertEquals(allNodeInfo.get(0).nodeAddress, config.nodeIp);
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.ray.api.RayObject;
|
||||
import org.ray.api.TestUtils;
|
||||
import org.ray.api.annotation.RayRemote;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.ray.runtime.gcs.GcsClientImpl;
|
||||
import org.ray.runtime.util.UniqueIdUtil;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
@@ -37,7 +36,8 @@ public class PlasmaFreeTest extends BaseTest {
|
||||
Assert.assertEquals("hello", helloId.get());
|
||||
Ray.internal().free(ImmutableList.of(helloId.getId()), true, true);
|
||||
|
||||
final boolean result = TestUtils.waitForCondition(() -> !((GcsClientImpl) Ray.getGcsClient())
|
||||
final boolean result = TestUtils.waitForCondition(
|
||||
() -> !(((AbstractRayRuntime)Ray.internal()).getGcsClient())
|
||||
.rayletTaskExistsInGcs(UniqueIdUtil.computeTaskId(helloId.getId())), 50);
|
||||
Assert.assertTrue(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user