diff --git a/include/ray/ray.h b/include/ray/ray.h index e2c32e98a..06fd0cf63 100644 --- a/include/ray/ray.h +++ b/include/ray/ray.h @@ -43,10 +43,4 @@ public: objstore_not_registered_error(const std::string& msg) : std::runtime_error(msg) {} }; -struct slice { - uint8_t* data; - size_t len; - SegmentId segmentid; -}; - #endif diff --git a/src/raylib.cc b/src/raylib.cc index 2604175bf..d5ec62680 100644 --- a/src/raylib.cc +++ b/src/raylib.cc @@ -864,22 +864,6 @@ static PyObject* add_contained_objectids(PyObject* self, PyObject* args) { Py_RETURN_NONE; } -static PyObject* get_object(PyObject* self, PyObject* args) { - // get_object assumes that objectid is a canonical objectid - Worker* worker; - ObjectID objectid; - if (!PyArg_ParseTuple(args, "O&O&", &PyObjectToWorker, &worker, &PyObjectToObjectID, &objectid)) { - return NULL; - } - slice s = worker->get_object(objectid); - Obj* obj = new Obj(); // TODO: Make sure this will get deleted - obj->ParseFromString(std::string(reinterpret_cast(s.data), s.len)); - PyObject* result = PyList_New(2); - PyList_SetItem(result, 0, PyCapsule_New(static_cast(obj), "obj", &ObjCapsule_Destructor)); - PyList_SetItem(result, 1, PyInt_FromLong(s.segmentid)); - return result; -} - static PyObject* request_object(PyObject* self, PyObject* args) { Worker* worker; ObjectID objectid; @@ -1077,7 +1061,6 @@ static PyMethodDef RayLibMethods[] = { { "register_remote_function", register_remote_function, METH_VARARGS, "register a function with the scheduler" }, { "notify_failure", notify_failure, METH_VARARGS, "notify the scheduler of a failure" }, { "add_contained_objectids", add_contained_objectids, METH_VARARGS, "notify the scheduler about the object IDs contained in a remote object" }, - { "get_object", get_object, METH_VARARGS, "get protocol buffer object from the local object store" }, { "get_objectid", get_objectid, METH_VARARGS, "register a new object reference with the scheduler" }, { "request_object" , request_object, METH_VARARGS, "request an object to be delivered to the local object store" }, { "ray_select" , ray_select, METH_VARARGS, "checks the scheduler to see if a object can be gotten" }, diff --git a/src/worker.cc b/src/worker.cc index 3fb3b40b2..9b05c0d31 100644 --- a/src/worker.cc +++ b/src/worker.cc @@ -214,23 +214,6 @@ ObjectID Worker::get_objectid() { return reply.objectid(); } -slice Worker::get_object(ObjectID objectid) { - // get_object assumes that objectid is a canonical objectid - RAY_CHECK(connected_, "Attempted to perform get_object but failed."); - ObjRequest request; - request.workerid = workerid_; - request.type = ObjRequestType::GET; - request.objectid = objectid; - RAY_CHECK(request_obj_queue_.send(&request), "Failed to send request from the worker to the object store because the message queue was full."); - ObjHandle result; - RAY_CHECK(receive_obj_queue_.receive(&result), "error receiving over IPC"); - slice slice; - slice.data = segmentpool_->get_address(result); - slice.len = result.size(); - slice.segmentid = result.segmentid(); - return slice; -} - void Worker::add_contained_objectids(ObjectID objectid, std::vector &contained_objectids) { RAY_CHECK(connected_, "Attempted to perform add_contained_objectids but failed."); if (contained_objectids.size() > 0) { diff --git a/src/worker.h b/src/worker.h index 3e2366e5b..07c9cc503 100644 --- a/src/worker.h +++ b/src/worker.h @@ -64,8 +64,6 @@ class Worker { void request_object(ObjectID objectid); // Notify the scheduler about the object IDs contained within a remote object. void add_contained_objectids(ObjectID objectid, std::vector &contained_objectids); - // retrieve serialized object from local object store - slice get_object(ObjectID objectid); // Allocates buffer for objectid with size of size const char* allocate_buffer(ObjectID objectid, int64_t size, SegmentId& segmentid); // Finishes buffer with segmentid and an offset of metadata_ofset