diff --git a/doc/source/compatibility.rst b/doc/source/compatibility.rst new file mode 100644 index 00000000..7a528c6e --- /dev/null +++ b/doc/source/compatibility.rst @@ -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 +=========================================== ========================================= ===================================================== ============================================= ================================================ ============================================= =========================================== ================================================= diff --git a/doc/source/developers.rst b/doc/source/developers.rst index f375e0a4..060fef1a 100644 --- a/doc/source/developers.rst +++ b/doc/source/developers.rst @@ -8,6 +8,12 @@ Interfaces .. autoclass:: tooz.coordination.CoordinationDriver :members: +File +~~~~ + +.. autoclass:: tooz.drivers.file.FileDriver + :members: + IPC ~~~ diff --git a/doc/source/index.rst b/doc/source/index.rst index f88bdfb6..ac2d25da 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,6 +14,7 @@ Contents install drivers + compatibility tutorial/index developers diff --git a/tools/compat-matrix.py b/tools/compat-matrix.py new file mode 100644 index 00000000..7e4e5409 --- /dev/null +++ b/tools/compat-matrix.py @@ -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("") diff --git a/tox.ini b/tox.ini index 42741204..d5038584 100644 --- a/tox.ini +++ b/tox.ini @@ -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