congress.dse2.control_bus module

class congress.dse2.control_bus.DseNodeControlBus(node)

Bases: congress.dse2.data_service.DataService

Maintain DSE connection for a DseNode.

The DSE maintains a common directory of data services and their corresponding exported tables and RPCs. This control bus maintains this view using oslo.messaging RPC primitives.

HEARTBEAT_INTERVAL = 1
dse_status()

Return latest observation of DSE status.

rpc_endpoints()

Return list of RPC endpoint objects to be exposed for this service.

A DataService may include zero or more RPC endpoints to be exposed by the DseNode. Each endpoint object must be compatible with the oslo.messaging RPC Server.

start()

Start the DataService.

This method is called by a DseNode before any RPCs are invoked.

stop()

Stop the DataService.

This method is called by a DseNode when the DataService instance is no longer needed. No RPCs will invoked on stopped DataServices.

class congress.dse2.control_bus.HeartbeatEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)

Bases: json.encoder.JSONEncoder

default(obj)

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
congress.dse2.control_bus.drop_cast_echos(wrapped)