mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 22:37:36 +08:00
Upgrade flatbuffers version to 1.10.0. (#3559)
* Upgrade flatbuffers version to 1.10.0. * Temporarily change ray.utils.decode for backwards compatibility.
This commit is contained in:
committed by
Philipp Moritz
parent
ddd4c842f1
commit
bb7ca3bae7
@@ -366,12 +366,14 @@ class GlobalState(object):
|
||||
node_info[client_id] = {
|
||||
"ClientID": client_id,
|
||||
"IsInsertion": client.IsInsertion(),
|
||||
"NodeManagerAddress": decode(client.NodeManagerAddress()),
|
||||
"NodeManagerAddress": decode(
|
||||
client.NodeManagerAddress(), allow_none=True),
|
||||
"NodeManagerPort": client.NodeManagerPort(),
|
||||
"ObjectManagerPort": client.ObjectManagerPort(),
|
||||
"ObjectStoreSocketName": decode(
|
||||
client.ObjectStoreSocketName()),
|
||||
"RayletSocketName": decode(client.RayletSocketName()),
|
||||
client.ObjectStoreSocketName(), allow_none=True),
|
||||
"RayletSocketName": decode(
|
||||
client.RayletSocketName(), allow_none=True),
|
||||
"Resources": resources
|
||||
}
|
||||
return list(node_info.values())
|
||||
@@ -433,7 +435,8 @@ class GlobalState(object):
|
||||
|
||||
component_type = decode(profile_table_message.ComponentType())
|
||||
component_id = binary_to_hex(profile_table_message.ComponentId())
|
||||
node_ip_address = decode(profile_table_message.NodeIpAddress())
|
||||
node_ip_address = decode(
|
||||
profile_table_message.NodeIpAddress(), allow_none=True)
|
||||
|
||||
for j in range(profile_table_message.ProfileEventsLength()):
|
||||
profile_event_message = profile_table_message.ProfileEvents(j)
|
||||
|
||||
+17
-3
@@ -165,10 +165,24 @@ def random_string():
|
||||
return random_id
|
||||
|
||||
|
||||
def decode(byte_str):
|
||||
"""Make this unicode in Python 3, otherwise leave it as bytes."""
|
||||
def decode(byte_str, allow_none=False):
|
||||
"""Make this unicode in Python 3, otherwise leave it as bytes.
|
||||
|
||||
Args:
|
||||
byte_str: The byte string to decode.
|
||||
allow_none: If true, then we will allow byte_str to be None in which
|
||||
case we will return an empty string. TODO(rkn): Remove this flag.
|
||||
This is only here to simplify upgrading to flatbuffers 1.10.0.
|
||||
|
||||
Returns:
|
||||
A byte string in Python 2 and a unicode string in Python 3.
|
||||
"""
|
||||
if byte_str is None and allow_none:
|
||||
return ""
|
||||
|
||||
if not isinstance(byte_str, bytes):
|
||||
raise ValueError("The argument must be a bytes object.")
|
||||
raise ValueError(
|
||||
"The argument {} must be a bytes object.".format(byte_str))
|
||||
if sys.version_info >= (3, 0):
|
||||
return byte_str.decode("ascii")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user