diff options
author | Akshay Modi <nareshmodi@google.com> | 2018-06-19 10:25:10 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-06-19 10:28:19 -0700 |
commit | c740b345e8c17cde0dd4691c7e240a065cb8c88c (patch) | |
tree | dd85bcff39031ec09de4507a335b541fb183adb4 /tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h | |
parent | ccaf2ca02739792a8a8e50a95246f2db1197aa97 (diff) |
Allow setting server def on the eager context, and add the eager service to the grpc_tensorflow_server.
PiperOrigin-RevId: 201198350
Diffstat (limited to 'tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h')
-rw-r--r-- | tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h b/tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h index ca9946cafc..c674da9490 100644 --- a/tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h +++ b/tensorflow/core/distributed_runtime/rpc/grpc_server_lib.h @@ -63,6 +63,8 @@ class GrpcServer : public ServerInterface { public: static Status Create(const ServerDef& server_def, Env* env, std::unique_ptr<ServerInterface>* out_server); + static Status Create(const ServerDef& server_def, Env* env, + std::unique_ptr<GrpcServer>* out_server); // Destruction is only supported in the factory method. Clean // shutdown is not currently implemented for this server type. @@ -74,6 +76,11 @@ class GrpcServer : public ServerInterface { Status Join() override; const string target() const override; + WorkerEnv* worker_env() { return &worker_env_; } + MasterEnv* master_env() { return &master_env_; } + + std::shared_ptr<GrpcChannelCache> channel_cache() { return channel_cache_; } + protected: Status Init(ServiceInitFunction service_func, const RendezvousMgrCreationFunction& rendezvous_mgr_func, @@ -112,11 +119,6 @@ class GrpcServer : public ServerInterface { // This method may only be called after `this->Init()` returns successfully. int bound_port() const { return bound_port_; } - WorkerEnv* worker_env() { return &worker_env_; } - MasterEnv* master_env() { return &master_env_; } - - std::shared_ptr<GrpcChannelCache> channel_cache() { return channel_cache_; } - const ServerDef& server_def() const { return server_def_; } private: @@ -155,6 +157,11 @@ class GrpcServer : public ServerInterface { AsyncServiceInterface* worker_service_ = nullptr; std::unique_ptr<Thread> worker_thread_ GUARDED_BY(mu_); + // TensorFlow Eager implementation, and RPC polling thread. + AsyncServiceInterface* eager_service_ = nullptr; + std::unique_ptr<Thread> eager_thread_ GUARDED_BY(mu_); + std::shared_ptr<WorkerSession> worker_session_; + std::unique_ptr<::grpc::Server> server_ GUARDED_BY(mu_); }; |