From 65135b7e5dc83dd7fba10dc9cde22a7298342898 Mon Sep 17 00:00:00 2001 From: Philipp Moritz Date: Tue, 8 Mar 2016 14:08:32 -0800 Subject: [PATCH] remove scheduler_server files (not needed any more) --- src/scheduler_server.cc | 50 ----------------------------------------- src/scheduler_server.h | 50 ----------------------------------------- 2 files changed, 100 deletions(-) delete mode 100644 src/scheduler_server.cc delete mode 100644 src/scheduler_server.h diff --git a/src/scheduler_server.cc b/src/scheduler_server.cc deleted file mode 100644 index 43bbf8846..000000000 --- a/src/scheduler_server.cc +++ /dev/null @@ -1,50 +0,0 @@ -#include "scheduler_server.h" - -Status SchedulerServerServiceImpl::RemoteCall(ServerContext* context, const RemoteCallRequest* request, RemoteCallReply* reply) { - size_t num_return_vals = scheduler_->add_task(request->call()); - for (size_t i = 0; i < num_return_vals; ++i) { - ObjRef result = scheduler_->register_new_object(); - reply->add_result(result); - } - return Status::OK; -} - -Status SchedulerServerServiceImpl::PushObj(ServerContext* context, const PushObjRequest* request, PushObjReply* reply) { - ObjRef objref = scheduler_->register_new_object(); - ObjStoreId objstoreid = scheduler_->get_store(request->workerid()); - scheduler_->add_location(objref, objstoreid); - reply->set_objref(objref); - return Status::OK; -} - - /* - Status PushObj(ServerContext* context, ServerReader *reader, AckReply* reply) override { - ObjChunk chunk; - while (reader->Read(&chunk)) { - - } - std::cout << "got chunks" << std::endl; - return Status::OK; - } - */ - -void start_scheduler_server(const char* server_address) { - SchedulerServerServiceImpl service; - ServerBuilder builder; - - builder.AddListeningPort(std::string(server_address), grpc::InsecureServerCredentials()); - builder.RegisterService(&service); - std::unique_ptr server(builder.BuildAndStart()); - - server->Wait(); -} - -int main(int argc, char** argv) { - if (argc != 2) { - return 1; - } - - start_scheduler_server(argv[1]); - - return 0; -} diff --git a/src/scheduler_server.h b/src/scheduler_server.h deleted file mode 100644 index d6d921cc3..000000000 --- a/src/scheduler_server.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef ORCHESTRA_SCHEDULER_SERVER_H -#define ORCHESTRA_SCHEDULER_SERVER_H - -#include -#include -#include -#include - -#include "scheduler.h" - - -class SchedulerServerServiceImpl final : public SchedulerServer::Service { - ObjTable objtable_; - std::unique_ptr scheduler_; -public: - SchedulerServerServiceImpl() : scheduler_(new Scheduler()) { - } - Status RemoteCall(ServerContext* context, const RemoteCallRequest* request, RemoteCallReply* reply) override; - Status PushObj(ServerContext* context, const PushObjRequest* request, PushObjReply* reply) override; - Status PullObj(ServerContext* context, const PullObjRequest* request, AckReply* reply) override { - return Status::OK; - } - Status RegisterWorker(ServerContext* context, const RegisterWorkerRequest* request, RegisterWorkerReply* reply) override { - WorkerId workerid = scheduler_->register_worker(request->worker_address(), request->objstore_address()); - std::cout << "registered worker with workerid" << workerid << std::endl; - reply->set_workerid(workerid); - return Status::OK; - } - /* - Status RegisterObjStore(ServerContext* context, const RegisterObjStoreRequest* request, RegisterObjStoreReply* reply) override { - try { - reply->set_objstoreid(scheduler_->register_objstore(request->address())); - } catch (...) { - std::cout << "caught exception" << std::endl; - } - return Status::OK; - } - */ - Status RegisterFunction(ServerContext* context, const RegisterFunctionRequest* request, AckReply* reply) override { - std::cout << "RegisterFunction: workerid is" << request->workerid() << std::endl; - scheduler_->register_function(request->fnname(), request->workerid(), request->num_return_vals()); - return Status::OK; - } - Status GetDebugInfo(ServerContext* context, const GetDebugInfoRequest* request, GetDebugInfoReply* reply) override { - scheduler_->debug_info(*request, reply); - return Status::OK; - } -}; - -#endif