Files
ray/src/ray/raylet/worker.h
T
Melih Elibol 6e06a9e338 XRay Task Forwarding Milestone (#1785)
Summary:
Able to run 1000 tasks with object dependencies on a set of distributed Raylets.

Raylet Changes:

Finalized ClientConnection class.
Task forwarding.
NM-to-NM heartbeats.
NM resource accounting for tasks.
Simple scheduling policy with task forwarding.
Creating and maintaining NM 2 NM long-lived connections and reusing them for task forwarding.
LineageCache Changes:

LineageCache without cleanup of tasks committed by remote nodes.
Lineage cache writeback and cleanup implementation.
ObjectManager Changes:

Object manager event loop/ClientConnection refactor.
Multithreaded object manager (disabled in this PR).
Testing Changes:

Integration tests for task submission on multiple Raylets.
Stress tests for object manager (with GCS and object store integration).


Co-authored-by: Stephanie Wang <swang@cs.berkeley.edu>
Co-authored-by: Alexey Tumanov <atumanov@gmail.com>
2018-03-31 18:02:58 -07:00

42 lines
1.1 KiB
C++

#ifndef RAY_RAYLET_WORKER_H
#define RAY_RAYLET_WORKER_H
#include <memory>
#include "ray/common/client_connection.h"
#include "ray/id.h"
namespace ray {
namespace raylet {
/// Worker class encapsulates the implementation details of a worker. A worker
/// is the execution container around a unit of Ray work, such as a task or an
/// actor. Ray units of work execute in the context of a Worker.
class Worker {
public:
/// A constructor that initializes a worker object.
Worker(pid_t pid, std::shared_ptr<LocalClientConnection> connection);
/// A destructor responsible for freeing all worker state.
~Worker() {}
/// Return the worker's PID.
pid_t Pid() const;
void AssignTaskId(const TaskID &task_id);
const TaskID &GetAssignedTaskId() const;
/// Return the worker's connection.
const std::shared_ptr<LocalClientConnection> Connection() const;
private:
/// The worker's PID.
pid_t pid_;
/// Connection state of a worker.
std::shared_ptr<LocalClientConnection> connection_;
TaskID assigned_task_id_;
};
} // namespace raylet
} // namespace ray
#endif // RAY_RAYLET_WORKER_H