| 295 | } |
| 296 | |
| 297 | Status GraphMgr::Register(const string& handle, const GraphDef& gdef, |
| 298 | WorkerSession* session, |
| 299 | const GraphOptions& graph_options, |
| 300 | const DebugOptions& debug_options, |
| 301 | int64 collective_graph_key, |
| 302 | DistributedFunctionLibraryRuntime* cluster_flr, |
| 303 | string* graph_handle) { |
| 304 | Item* item = new Item; |
| 305 | Status s = InitItem(handle, gdef, session, graph_options, debug_options, |
| 306 | collective_graph_key, cluster_flr, item); |
| 307 | if (!s.ok()) { |
| 308 | item->Unref(); |
| 309 | return s; |
| 310 | } |
| 311 | |
| 312 | // Inserts one item into table_. |
| 313 | { |
| 314 | mutex_lock l(mu_); |
| 315 | *graph_handle = strings::Printf("%016llx", ++next_id_); |
| 316 | item->handle = *graph_handle; |
| 317 | CHECK(table_.insert({*graph_handle, item}).second); |
| 318 | } |
| 319 | return Status::OK(); |
| 320 | } |
| 321 | |
| 322 | Status GraphMgr::Deregister(const string& handle) { |
| 323 | Item* item = nullptr; |
no test coverage detected