The congress.dse2.dse_node
Module¶
-
class
congress.dse2.dse_node.
DseNode
(messaging_config, node_id, node_rpc_endpoints, partition_id=None)¶ Bases:
object
Addressable entity participating on the DSE message bus.
The Data Services Engine (DSE) is comprised of one or more DseNode instances that each may run one or more DataService instances. All communication between data services uses the DseNode interface.
- Attributes:
node_id: The unique ID of this node on the DSE. messaging_config: Configuration options for the message bus. See
oslo.messaging for more details.- node_rpc_endpoints: List of object instances exposing a remotely
- invokable interface.
-
CONTROL_TOPIC
= 'congress-control'¶
-
EXCHANGE
= 'congress'¶
-
RPC_VERSION
= '1.0'¶
-
SERVICE_TOPIC_PREFIX
= 'congress-service-'¶
-
broadcast_node_rpc
(method, kwargs=None)¶ Invoke RPC method on all DSE Nodes.
- Args:
- method: The method name to call. kwargs: A dict of method arguments.
- Returns:
- None - Methods are invoked asynchronously and results are dropped.
Raises: RemoteError, MessageDeliveryFailure
-
broadcast_service_rpc
(service_id, method, kwargs=None)¶ Invoke RPC method on all instances of service_id.
- Args:
- service_id: The ID of the data service on which to invoke the call. method: The method name to call. kwargs: A dict of method arguments.
- Returns:
- None - Methods are invoked asynchronously and results are dropped.
Raises: RemoteError, MessageDeliveryFailure
-
create_datasource_service
(datasource)¶ Create a new DataService on this node.
- :param name is the name of the service. Must be unique across all
- services
- :param classPath is a string giving the path to the class name, e.g.
- congress.datasources.fake_datasource.FakeDataSource
- :param args is the list of arguments to give the DataService
- constructor
:param type_ is the kind of service :param id_ is an optional parameter for specifying the uuid.
-
delete_missing_driver_datasources
()¶
-
dse_status
()¶ Return latest observation of DSE status.
-
get_datasource
(id_)¶ Return the created datasource.
-
get_datasources
(filter_secret=False)¶ Return the created datasources as recorded in the DB.
This returns what datasources the database contains, not the datasources that this server instance is running.
-
get_driver_info
(driver_name)¶
-
get_driver_schema
(drivername)¶
-
get_drivers_info
()¶
-
get_global_service_names
(hidden=False)¶ Return names of all services on all nodes.
-
get_services
(hidden=False)¶ Return all local service objects.
-
get_subscribers
(service_id)¶ List of services subscribed to this service.
-
get_subscription
(service_id)¶ Return publisher/tables subscribed by service: service_id
Return data structure: {publisher_id -> set of tables}
-
invoke_node_rpc
(node_id, method, kwargs=None, timeout=None)¶ Invoke RPC method on a DSE Node.
- Args:
- node_id: The ID of the node on which to invoke the call. method: The method name to call. kwargs: A dict of method arguments.
- Returns:
- The result of the method invocation.
Raises: MessagingTimeout, RemoteError, MessageDeliveryFailure
-
invoke_service_rpc
(service_id, method, kwargs=None, timeout=None, local=False, retry=None)¶ Invoke RPC method on a DSE Service.
- Args:
- service_id: The ID of the data service on which to invoke the call. method: The method name to call. kwargs: A dict of method arguments.
- Returns:
- The result of the method invocation.
Raises: MessagingTimeout, RemoteError, MessageDeliveryFailure, NotFound
-
is_valid_service
(service_id)¶
-
load_drivers
()¶ Load all configured drivers and check no name conflict
-
make_datasource_dict
(req, fields=None)¶
-
node_rpc_target
(namespace=None, server=None, fanout=False)¶
-
publish_table
(publisher, table, data)¶ Invoke RPC method on all insances of service_id.
- Args:
- service_id: The ID of the data service on which to invoke the call. method: The method name to call. kwargs: A dict of method arguments.
- Returns:
- None - Methods are invoked asynchronously and results are dropped.
Raises: RemoteError, MessageDeliveryFailure
-
publish_table_sequenced
(publisher, table, data, is_snapshot, seqnum)¶ Invoke RPC method on all insances of service_id.
- Args:
- service_id: The ID of the data service on which to invoke the call. method: The method name to call. kwargs: A dict of method arguments.
- Returns:
- None - Methods are invoked asynchronously and results are dropped.
Raises: RemoteError, MessageDeliveryFailure
-
register_service
(service)¶
-
service_object
(service_id=None, uuid_=None)¶ Return the service object requested.
Search by service_id or uuid_ (only one should be supplied). None if not found.
-
service_rpc_target
(service_id, namespace=None, server=None, fanout=False)¶
-
start
()¶
-
stop
()¶
-
subscribe_table
(subscriber, publisher, table)¶ Prepare local service to receives publications from target/table.
-
table_subscribers
(publisher, table)¶ List services on this node that subscribes to publisher/table.
-
to_set_of_tuples
(snapshot)¶
-
unregister_service
(service_id=None, uuid_=None)¶ Unregister service from DseNode matching on service_id or uuid_
Only one should be supplied. No-op if no matching service found.
-
unsubscribe_table
(subscriber, publisher, table)¶ Remove subscription for local service to target/table.
-
validate_create_datasource
(req)¶
-
wait
()¶
-
class
congress.dse2.dse_node.
DseNodeEndpoints
(dsenode)¶ Bases:
object
Collection of RPC endpoints that the DseNode exposes on the bus.
Must be a separate class since all public methods of a given class are assumed to be valid RPC endpoints.
-
handle_publish
(context, publisher, table, data)¶ Function called on the node when a publication is sent.
Forwards the publication to all of the relevant services.
-
handle_publish_sequenced
(context, publisher, table, data, is_snapshot, seqnum)¶ Function called on the node when a publication is sent.
Forwards the publication to all of the relevant services.
-