mirror of
https://github.com/wassname/ray.git
synced 2026-07-29 11:26:04 +08:00
remove scheduler_server files (not needed any more)
This commit is contained in:
@@ -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<ObjChunk> *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> server(builder.BuildAndStart());
|
||||
|
||||
server->Wait();
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 2) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
start_scheduler_server(argv[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#ifndef ORCHESTRA_SCHEDULER_SERVER_H
|
||||
#define ORCHESTRA_SCHEDULER_SERVER_H
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
|
||||
#include "scheduler.h"
|
||||
|
||||
|
||||
class SchedulerServerServiceImpl final : public SchedulerServer::Service {
|
||||
ObjTable objtable_;
|
||||
std::unique_ptr<Scheduler> 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
|
||||
Reference in New Issue
Block a user