Repository: ray-project/ray
File: src/ray/raylet/lease_dependency_manager.h (C/C++)

Code before:
  bool GetOwnerAddress(const ObjectID &object_id, rpc::Address *owner_address) const;

  /// Start or update a worker's `ray.wait` request. This will attempt to make
  /// any remote objects local, including previously requested objects. The
  /// `ray.wait` request will stay active until the objects are made local or
  /// the request for this worker is canceled, whichever occurs first.
  ///
  /// This method may be called multiple times per worker on the same objects.
  ///
  /// \param worker_id The ID of the worker that called `ray.wait`.
  /// \param required_objects The objects required by the worker.
  void StartOrUpdateWaitRequest(
      const WorkerID &worker_id,
      const std::vector<rpc::ObjectReference> &required_objects);

  /// Cancel a worker's `ray.wait` request. We will no longer attempt to fetch
  /// any objects that this worker requested previously, if no other task or
  /// worker requires them.
  ///
  /// \param worker_id The ID of the worker whose `ray.wait` request we should
  /// cancel.
  void CancelWaitRequest(const WorkerID &worker_id);

  /// \param worker_id The ID of the worker that called `ray.get`.
  /// \param required_objects The objects required by the worker.
  /// \param get_request_id The ID of the get request.
  void StartGetRequest(const WorkerID &worker_id,
                       std::vector<rpc::ObjectReference> &&required_objects,
                       int64_t get_request_id);

  /// Cleans up either an inflight or finished get request. Cancels the underlying
  /// pull if necessary.
  ///
  /// \param worker_id The ID of the worker that called `ray.get`.
  /// \param request_id The ID of the get request.
  /// \param required_objects The objects required by the worker.
  /// \return the request id which will be used for cleanup.
  void CancelGetRequest(const WorkerID &worker_id, const GetRequestId &request_id);

  /// Cancel all of a worker's `ray.get` requests. We will no longer attempt to fetch
  /// any objects that this worker requested previously, if no other lease or
  /// worker requires them.
  ///
  /// \param worker_id The ID of the worker whose `ray.get` request we should
  /// cancel.
  void CancelGetRequest(const WorkerID &worker_id);

  /// Request dependencies for a queued lease. This will attempt to make any
  /// remote objects local until the caller cancels the lease's dependencies.
  ///
  /// This method can only be called once per lease, until the lease has been

Review comment (refactor):
```suggestion
  /// \param get_request_id The ID of the get request. It is used by the worker to clean up a GetRequest.
```

Code after:
  bool GetOwnerAddress(const ObjectID &object_id, rpc::Address *owner_address) const;

  /// Start or update a worker's `ray.wait` request. This will attempt to make
  /// any remote objects local, including previously requested objects. The
  /// `ray.wait` request will stay active until the objects are made local or
  /// the request for this worker is canceled, whichever occurs first.
  ///
  /// This method may be called multiple times per worker on the same objects.
  ///
  /// \param worker_id The ID of the worker that called `ray.wait`.
  /// \param required_objects The objects required by the worker.
  void StartOrUpdateWaitRequest(
      const WorkerID &worker_id,
      const std::vector<rpc::ObjectReference> &required_objects);

  /// Cancel a worker's `ray.wait` request. We will no longer attempt to fetch
  /// any objects that this worker requested previously, if no other task or
  /// worker requires them.
  ///
  /// \param worker_id The ID of the worker whose `ray.wait` request we should
  /// cancel.
  void CancelWaitRequest(const WorkerID &worker_id);

  /// \param worker_id The ID of the worker that called `ray.get`.
  /// \param required_objects The objects required by the worker.
  /// \param get_request_id The ID of the get request. It is used by the worker to clean
  /// up a GetRequest.
  void StartGetRequest(const WorkerID &worker_id,
                       std::vector<rpc::ObjectReference> &&required_objects,
                       int64_t get_request_id);

  /// Cleans up either an inflight or finished get request. Cancels the underlying
  /// pull if necessary.
  ///
  /// \param worker_id The ID of the worker that called `ray.get`.
  /// \param request_id The ID of the get request.
  /// \param required_objects The objects required by the worker.
  /// \return the request id which will be used for cleanup.
  void CancelGetRequest(const WorkerID &worker_id, const GetRequestId &request_id);

  /// Cancel all of a worker's `ray.get` requests. We will no longer attempt to fetch
  /// any objects that this worker requested previously, if no other lease or
  /// worker requires them.
  ///
  /// \param worker_id The ID of the worker whose `ray.get` request we should
  /// cancel.
  void CancelGetRequest(const WorkerID &worker_id);

  /// Request dependencies for a queued lease. This will attempt to make any
  /// remote objects local until the caller cancels the lease's dependencies.
  ///