mirror of
https://github.com/wassname/ray.git
synced 2026-07-02 23:21:32 +08:00
[java] when put an object in plasma store, ignore "object alreay exists" exception (#3687)
* distinct plasma client exception * Update ObjectStoreProxy.java * Update and rename PlasmaArrowTest.java to PlasmaStoreTest.java * store put * Use testng to replace junit to fix test failure
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package org.ray.api.test;
|
||||
|
||||
import org.apache.arrow.plasma.PlasmaClient;
|
||||
import org.apache.arrow.plasma.exceptions.DuplicateObjectException;
|
||||
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.id.UniqueId;
|
||||
import org.ray.runtime.AbstractRayRuntime;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
public class PlasmaStoreTest extends BaseTest {
|
||||
|
||||
@Test
|
||||
public void testPutWithDuplicateId() {
|
||||
UniqueId objectId = UniqueId.randomId();
|
||||
AbstractRayRuntime runtime = (AbstractRayRuntime) Ray.internal();
|
||||
PlasmaClient store = new PlasmaClient(runtime.getRayConfig().objectStoreSocketName, "", 0);
|
||||
store.put(objectId.getBytes(), new byte[]{}, new byte[]{});
|
||||
try {
|
||||
store.put(objectId.getBytes(), new byte[]{}, new byte[]{});
|
||||
Assert.fail("This line shouldn't be reached.");
|
||||
} catch (DuplicateObjectException e) {
|
||||
// Putting 2 objects with duplicate ID should throw DuplicateObjectException.
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user