Add a driver feature compatibility matrix

Change-Id: I8c5e58fbfa6da53a334ca43829d02d765f85a3fd
This commit is contained in:
Joshua Harlow 2015-03-09 12:30:38 -07:00
parent 3f64bf5d13
commit bb00a5beee
5 changed files with 223 additions and 0 deletions

View File

@ -0,0 +1,68 @@
=============
Compatibility
=============
Grouping
========
APIs
----
* :py:meth:`~tooz.coordination.CoordinationDriver.watch_join_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.unwatch_join_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.watch_leave_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.unwatch_leave_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.create_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.get_groups`
* :py:meth:`~tooz.coordination.CoordinationDriver.join_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.leave_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.delete_group`
* :py:meth:`~tooz.coordination.CoordinationDriver.get_members`
* :py:meth:`~tooz.coordination.CoordinationDriver.get_member_capabilities`
* :py:meth:`~tooz.coordination.CoordinationDriver.update_capabilities`
Driver support
--------------
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
:py:class:`~tooz.drivers.file.FileDriver` :py:class:`~tooz.drivers.ipc.IPCDriver` :py:class:`~tooz.drivers.memcached.MemcachedDriver` :py:class:`~tooz.drivers.mysql.MySQLDriver` :py:class:`~tooz.drivers.pgsql.PostgresDriver` :py:class:`~tooz.drivers.redis.RedisDriver` :py:class:`~tooz.drivers.zake.ZakeDriver` :py:class:`~tooz.drivers.zookeeper.KazooDriver`
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
No No Yes No No Yes Yes Yes
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
Leaders
=======
APIs
----
* :py:meth:`~tooz.coordination.CoordinationDriver.watch_elected_as_leader`
* :py:meth:`~tooz.coordination.CoordinationDriver.unwatch_elected_as_leader`
* :py:meth:`~tooz.coordination.CoordinationDriver.stand_down_group_leader`
* :py:meth:`~tooz.coordination.CoordinationDriver.get_leader`
Driver support
--------------
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
:py:class:`~tooz.drivers.file.FileDriver` :py:class:`~tooz.drivers.ipc.IPCDriver` :py:class:`~tooz.drivers.memcached.MemcachedDriver` :py:class:`~tooz.drivers.mysql.MySQLDriver` :py:class:`~tooz.drivers.pgsql.PostgresDriver` :py:class:`~tooz.drivers.redis.RedisDriver` :py:class:`~tooz.drivers.zake.ZakeDriver` :py:class:`~tooz.drivers.zookeeper.KazooDriver`
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
No No Yes No No No Yes Yes
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
Locking
=======
APIs
----
* :py:meth:`~tooz.coordination.CoordinationDriver.get_lock`
Driver support
--------------
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
:py:class:`~tooz.drivers.file.FileDriver` :py:class:`~tooz.drivers.ipc.IPCDriver` :py:class:`~tooz.drivers.memcached.MemcachedDriver` :py:class:`~tooz.drivers.mysql.MySQLDriver` :py:class:`~tooz.drivers.pgsql.PostgresDriver` :py:class:`~tooz.drivers.redis.RedisDriver` :py:class:`~tooz.drivers.zake.ZakeDriver` :py:class:`~tooz.drivers.zookeeper.KazooDriver`
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================
Yes Yes Yes Yes Yes Yes Yes Yes
=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== =================================================

View File

@ -8,6 +8,12 @@ Interfaces
.. autoclass:: tooz.coordination.CoordinationDriver
:members:
File
~~~~
.. autoclass:: tooz.drivers.file.FileDriver
:members:
IPC
~~~

View File

@ -14,6 +14,7 @@ Contents
install
drivers
compatibility
tutorial/index
developers

142
tools/compat-matrix.py Normal file
View File

@ -0,0 +1,142 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tabulate import tabulate
def print_header(txt, delim="="):
print(txt)
print(delim * len(txt))
def print_methods(methods):
driver_tpl = ":py:meth:`~tooz.coordination.CoordinationDriver.%s`"
for api_name in methods:
method_name = driver_tpl % api_name
print("* %s" % method_name)
if methods:
print("")
driver_tpl = ":py:class:`~tooz.drivers.%s`"
driver_class_names = [
"file.FileDriver",
"ipc.IPCDriver",
"memcached.MemcachedDriver",
"mysql.MySQLDriver",
"pgsql.PostgresDriver",
"redis.RedisDriver",
"zake.ZakeDriver",
"zookeeper.KazooDriver",
]
driver_headers = []
for n in driver_class_names:
driver_headers.append(driver_tpl % (n))
print_header("Grouping")
print("")
print_header("APIs", delim="-")
print("")
grouping_methods = [
'watch_join_group',
'unwatch_join_group',
'watch_leave_group',
'unwatch_leave_group',
'create_group',
'get_groups',
'join_group',
'leave_group',
'delete_group',
'get_members',
'get_member_capabilities',
'update_capabilities',
]
print_methods(grouping_methods)
print_header("Driver support", delim="-")
print("")
grouping_table = [
[
"No", # File
"No", # IPC
"Yes", # Memcached
"No", # MySQL
"No", # PostgreSQL
"Yes", # Redis
"Yes", # Zake
"Yes", # Zookeeper
],
]
print(tabulate(grouping_table, driver_headers, tablefmt="rst"))
print("")
print_header("Leaders")
print("")
print_header("APIs", delim="-")
print("")
leader_methods = [
'watch_elected_as_leader',
'unwatch_elected_as_leader',
'stand_down_group_leader',
'get_leader',
]
print_methods(leader_methods)
print_header("Driver support", delim="-")
print("")
leader_table = [
[
"No", # File
"No", # IPC
"Yes", # Memcached
"No", # MySQL
"No", # PostgreSQL
"No", # Redis
"Yes", # Zake
"Yes", # Zookeeper
],
]
print(tabulate(leader_table, driver_headers, tablefmt="rst"))
print("")
print_header("Locking")
print("")
print_header("APIs", delim="-")
print("")
lock_methods = [
'get_lock',
]
print_methods(lock_methods)
print_header("Driver support", delim="-")
print("")
lock_table = [
[
"Yes", # File
"Yes", # IPC
"Yes", # Memcached
"Yes", # MySQL
"Yes", # PostgreSQL
"Yes", # Redis
"Yes", # Zake
"Yes", # Zookeeper
],
]
print(tabulate(lock_table, driver_headers, tablefmt="rst"))
print("")

View File

@ -96,3 +96,9 @@ show-source = True
[hacking]
import_exceptions = six.moves
unittest.mock
[doc8]
# This path is pretty much all automatically generated, and has really
# long lines, so just ignore it....
ignore-path = doc/source/compatibility.rst