From 7fa64f2b24c3429f1911af065133bdab471e1f3d Mon Sep 17 00:00:00 2001 From: "Siyuan (Ryans) Zhuang" Date: Wed, 3 Jun 2020 12:09:19 -0700 Subject: [PATCH] Clean up unused Python code (#8755) --- python/ray/serialization.py | 4 +--- python/ray/worker.py | 48 ------------------------------------- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/python/ray/serialization.py b/python/ray/serialization.py index 157cfa12e..33a767293 100644 --- a/python/ray/serialization.py +++ b/python/ray/serialization.py @@ -123,15 +123,13 @@ class SerializationContext: def object_id_serializer(obj): self.add_contained_object_id(obj) - owner_id = "" - owner_address = "" worker = ray.worker.global_worker worker.check_connected() obj, owner_id, owner_address = ( worker.core_worker.serialize_and_promote_object_id(obj)) obj = id_serializer(obj) owner_id = id_serializer(owner_id) if owner_id else owner_id - return (obj, owner_id, owner_address) + return obj, owner_id, owner_address def object_id_deserializer(serialized_obj): obj_id, owner_id, owner_address = serialized_obj diff --git a/python/ray/worker.py b/python/ray/worker.py index 1521340a0..47aaf041b 100644 --- a/python/ray/worker.py +++ b/python/ray/worker.py @@ -363,52 +363,6 @@ class Worker: # operations into a transaction (or by implementing a custom # command that does all three things). - def _get_arguments_for_execution(self, function_name, serialized_args): - """Retrieve the arguments for the remote function. - - This retrieves the values for the arguments to the remote function that - were passed in as object IDs. Arguments that were passed by value are - not changed. This is called by the worker that is executing the remote - function. - - Args: - function_name (str): The name of the remote function whose - arguments are being retrieved. - serialized_args (List): The arguments to the function. These are - either strings representing serialized objects passed by value - or they are ray.ObjectIDs. - - Returns: - The retrieved arguments in addition to the arguments that were - passed by value. - - Raises: - RayError: This exception is raised if a task that - created one of the arguments failed. - """ - arguments = [None] * len(serialized_args) - object_ids = [] - object_indices = [] - - for (i, arg) in enumerate(serialized_args): - if isinstance(arg, ObjectID): - object_ids.append(arg) - object_indices.append(i) - else: - # pass the argument by value - arguments[i] = arg - - # Get the objects from the local object store. - if len(object_ids) > 0: - values = self.get_objects(object_ids) - for i, value in enumerate(values): - if isinstance(value, RayError): - raise value - else: - arguments[object_indices[i]] = value - - return ray.signature.recover_args(arguments) - def main_loop(self): """The main loop a worker runs to receive and execute tasks.""" @@ -1125,8 +1079,6 @@ def connect(node, driver_object_store_memory: Limit the amount of memory the driver can use in the object store when creating objects. job_id: The ID of job. If it's None, then we will generate one. - internal_config: Dictionary of (str,str) containing internal config - options to override the defaults. """ # Do some basic checking to make sure we didn't call ray.init twice. error_message = "Perhaps you called ray.init twice by accident?"