mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 12:58:37 +08:00
Update arrow version to fix plasma bugs (#4127)
* Update arrow * Change to 2c511979b13b230e73a179dab1d55b03cd81ec02 which is rebased on Arrow 46f75d7 * Update to fix comment * disable tests which use python/ray/rllib/tests/data/cartpole_small * Fix get order of meta and data in MockObjectStore.java
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.ray.runtime.objectstore;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -65,7 +64,7 @@ public class MockObjectStore implements ObjectStoreLink {
|
||||
public List<byte[]> get(byte[][] objectIds, int timeoutMs, boolean isMetadata) {
|
||||
return get(objectIds, timeoutMs)
|
||||
.stream()
|
||||
.map(data -> isMetadata ? data.data : data.metadata)
|
||||
.map(data -> isMetadata ? data.metadata : data.data)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -93,15 +92,9 @@ public class MockObjectStore implements ObjectStoreLink {
|
||||
firstCheck = false;
|
||||
}
|
||||
ArrayList<ObjectStoreData> rets = new ArrayList<>();
|
||||
for (byte[] id : objectIds) {
|
||||
try {
|
||||
Constructor<?> constructor = ObjectStoreData.class.getDeclaredConstructors()[0];
|
||||
constructor.setAccessible(true);
|
||||
rets.add((ObjectStoreData) constructor.newInstance(data.get(new UniqueId(id)),
|
||||
metadata.get(new UniqueId(id))));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
for (byte[] objId : objectIds) {
|
||||
UniqueId uniqueId = new UniqueId(objId);
|
||||
rets.add(new ObjectStoreData(metadata.get(uniqueId), data.get(uniqueId)));
|
||||
}
|
||||
return rets;
|
||||
}
|
||||
|
||||
@@ -78,10 +78,8 @@ public class ObjectStoreProxy {
|
||||
|
||||
List<GetResult<T>> results = new ArrayList<>();
|
||||
for (int i = 0; i < dataAndMetaList.size(); i++) {
|
||||
// TODO(hchen): Plasma API returns data and metadata in wrong order, this should be fixed
|
||||
// from the arrow side first.
|
||||
byte[] meta = dataAndMetaList.get(i).data;
|
||||
byte[] data = dataAndMetaList.get(i).metadata;
|
||||
byte[] meta = dataAndMetaList.get(i).metadata;
|
||||
byte[] data = dataAndMetaList.get(i).data;
|
||||
|
||||
GetResult<T> result;
|
||||
if (meta != null) {
|
||||
|
||||
Reference in New Issue
Block a user