示例#1
0
    def _connect_session_impl(self, cleanup_instance=True, dangling_timeout_seconds=60):
        """
        Args:
            cleanup_instance (bool, optional): If True, also delete graphscope
                instance (such as pod) in closing process.
            dangling_timeout_seconds (int, optional): After seconds of client
                disconnect, coordinator will kill this graphscope instance.
                Disable dangling check by setting -1.

        """
        request = message_pb2.ConnectSessionRequest(
            cleanup_instance=cleanup_instance,
            dangling_timeout_seconds=dangling_timeout_seconds,
            version=__version__,
            reconnect=self._reconnect,
        )

        response = self._stub.ConnectSession(request)

        self._session_id = response.session_id
        return (
            response.session_id,
            response.cluster_type,
            json.loads(response.engine_config),
            response.pod_name_list,
            response.num_workers,
            response.namespace,
        )
示例#2
0
    def _connect_session_impl(self):
        request = message_pb2.ConnectSessionRequest()

        response = self._stub.ConnectSession(request)
        response = check_grpc_response(response)

        self._session_id = response.session_id
        return (
            response.session_id,
            json.loads(response.engine_config),
            response.pod_name_list,
        )