Define characteristics of etcd/etcd3gw driver

Change-Id: Iddc76c7c1fbd68c99af15d0346c027ed78c76de8
This commit is contained in:
Takashi Kajinami 2024-04-12 13:10:01 +09:00
parent 0e2010d930
commit c61cc7aa16
2 changed files with 18 additions and 0 deletions

View File

@ -232,6 +232,15 @@ class EtcdDriver(coordination.CoordinationDriver):
#: Class that will be used to encode lock names into a valid etcd url.
lock_encoder_cls = utils.Base64LockEncoder
CHARACTERISTICS = (
coordination.Characteristics.NON_TIMEOUT_BASED,
coordination.Characteristics.DISTRIBUTED_ACROSS_THREADS,
coordination.Characteristics.DISTRIBUTED_ACROSS_PROCESSES,
# https://etcd.io/docs/v3.5/learning/api_guarantees/
coordination.Characteristics.LINEARIZABLE,
coordination.Characteristics.SERIALIZABLE,
)
def __init__(self, member_id, parsed_url, options):
super(EtcdDriver, self).__init__(member_id, parsed_url, options)
host = parsed_url.hostname or self.DEFAULT_HOST

View File

@ -204,6 +204,15 @@ class Etcd3Driver(coordination.CoordinationDriverCachedRunWatchers,
GROUP_PREFIX = b"tooz/groups/"
CHARACTERISTICS = (
coordination.Characteristics.NON_TIMEOUT_BASED,
coordination.Characteristics.DISTRIBUTED_ACROSS_THREADS,
coordination.Characteristics.DISTRIBUTED_ACROSS_PROCESSES,
# https://etcd.io/docs/v3.5/learning/api_guarantees/
coordination.Characteristics.LINEARIZABLE,
coordination.Characteristics.SERIALIZABLE,
)
def __init__(self, member_id, parsed_url, options):
super(Etcd3Driver, self).__init__(member_id, parsed_url, options)
protocol = 'https' if parsed_url.scheme.endswith('https') else 'http'