InSubgraph Request
| 669 | |
| 670 | |
| 671 | class InSubgraphRequest(Request): |
| 672 | """InSubgraph Request""" |
| 673 | |
| 674 | def __init__(self, nodes): |
| 675 | self.seed_nodes = nodes |
| 676 | |
| 677 | def __setstate__(self, state): |
| 678 | self.seed_nodes = state |
| 679 | |
| 680 | def __getstate__(self): |
| 681 | return self.seed_nodes |
| 682 | |
| 683 | def process_request(self, server_state): |
| 684 | local_g = server_state.graph |
| 685 | partition_book = server_state.partition_book |
| 686 | global_src, global_dst, global_eids = _in_subgraph( |
| 687 | local_g, partition_book, self.seed_nodes |
| 688 | ) |
| 689 | return SubgraphResponse(global_src, global_dst, global_eids=global_eids) |
| 690 | |
| 691 | |
| 692 | def merge_graphs(res_list, num_nodes, exclude_edges=None): |