Output result to `fd`, this will be handled by registered vineyard C++ adaptor. Args: results (:class:`Context`): Results return by `run_app` operation, store the query results. fd (str): Such as `file:///tmp/result_path` selector (str): Select the type of data to retrie
(
context,
fd,
selector,
vertex_range,
storage_options=None,
write_options=None,
**kwargs,
)
| 914 | |
| 915 | |
| 916 | def output( |
| 917 | context, |
| 918 | fd, |
| 919 | selector, |
| 920 | vertex_range, |
| 921 | storage_options=None, |
| 922 | write_options=None, |
| 923 | **kwargs, |
| 924 | ): |
| 925 | """Output result to `fd`, this will be handled by registered vineyard C++ adaptor. |
| 926 | |
| 927 | Args: |
| 928 | results (:class:`Context`): Results return by `run_app` operation, store the query results. |
| 929 | fd (str): Such as `file:///tmp/result_path` |
| 930 | selector (str): Select the type of data to retrieve. |
| 931 | vertex_range (str): Specify a range to retrieve. |
| 932 | Returns: |
| 933 | An op to output results to `fd`. |
| 934 | """ |
| 935 | if storage_options is None: |
| 936 | storage_options = {} |
| 937 | storage_options.update(kwargs) |
| 938 | if write_options is None: |
| 939 | write_options = {} |
| 940 | write_options.update(kwargs) |
| 941 | config = {} |
| 942 | config[types_pb2.FD] = utils.s_to_attr(fd) |
| 943 | config[types_pb2.SELECTOR] = utils.s_to_attr(selector) |
| 944 | config[types_pb2.STORAGE_OPTIONS] = utils.s_to_attr(json.dumps(storage_options)) |
| 945 | config[types_pb2.WRITE_OPTIONS] = utils.s_to_attr(json.dumps(write_options)) |
| 946 | if vertex_range is not None: |
| 947 | config[types_pb2.VERTEX_RANGE] = utils.s_to_attr(vertex_range) |
| 948 | |
| 949 | op = Operation( |
| 950 | context.session_id, |
| 951 | types_pb2.OUTPUT, |
| 952 | config=config, |
| 953 | inputs=[context.op], |
| 954 | output_types=types_pb2.NULL_OUTPUT, |
| 955 | ) |
| 956 | return op |
| 957 | |
| 958 | |
| 959 | def get_context_data(results, node): |