Remove unused code. (#418)

This commit is contained in:
Robert Nishihara
2016-09-08 11:36:17 -07:00
committed by Philipp Moritz
parent 9abc1dd59f
commit d6e3a40744
4 changed files with 0 additions and 42 deletions
-6
View File
@@ -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
-17
View File
@@ -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<char*>(s.data), s.len));
PyObject* result = PyList_New(2);
PyList_SetItem(result, 0, PyCapsule_New(static_cast<void*>(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" },
-17
View File
@@ -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<ObjectID> &contained_objectids) {
RAY_CHECK(connected_, "Attempted to perform add_contained_objectids but failed.");
if (contained_objectids.size() > 0) {
-2
View File
@@ -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<ObjectID> &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