| 2197 | } |
| 2198 | |
| 2199 | Status MasterSession::MakeCallable(const MakeCallableRequest& req, |
| 2200 | MakeCallableResponse* resp) { |
| 2201 | UpdateLastAccessTime(); |
| 2202 | |
| 2203 | BuildGraphOptions opts; |
| 2204 | opts.callable_options = req.options(); |
| 2205 | opts.use_function_convention = false; |
| 2206 | |
| 2207 | ReffedClientGraph* callable; |
| 2208 | |
| 2209 | { |
| 2210 | mutex_lock l(mu_); |
| 2211 | if (closed_) { |
| 2212 | return errors::FailedPrecondition("Session is closed."); |
| 2213 | } |
| 2214 | std::unique_ptr<ClientGraph> client_graph; |
| 2215 | TF_RETURN_IF_ERROR(execution_state_->BuildGraph(opts, &client_graph)); |
| 2216 | callable = new ReffedClientGraph(handle_, opts, std::move(client_graph), |
| 2217 | session_opts_, stats_publisher_factory_, |
| 2218 | execution_state_.get(), false /* is_partial */, |
| 2219 | get_worker_cache(), env_, |
| 2220 | !should_delete_worker_sessions_); |
| 2221 | } |
| 2222 | |
| 2223 | Status s = BuildAndRegisterPartitions(callable); |
| 2224 | if (!s.ok()) { |
| 2225 | callable->Unref(); |
| 2226 | return s; |
| 2227 | } |
| 2228 | |
| 2229 | uint64 handle; |
| 2230 | { |
| 2231 | mutex_lock l(mu_); |
| 2232 | handle = next_callable_handle_++; |
| 2233 | callables_[handle] = callable; |
| 2234 | } |
| 2235 | |
| 2236 | resp->set_handle(handle); |
| 2237 | return Status::OK(); |
| 2238 | } |
| 2239 | |
| 2240 | Status MasterSession::DoRunCallable(CallOptions* opts, ReffedClientGraph* rcg, |
| 2241 | const RunCallableRequest& req, |
nothing calls this directly
no test coverage detected