diff --git a/dev-python/uhashring/Manifest b/dev-python/uhashring/Manifest new file mode 100644 index 0000000000..a910ed1d2e --- /dev/null +++ b/dev-python/uhashring/Manifest @@ -0,0 +1 @@ +DIST uhashring-2.1.tar.gz 18288 BLAKE2B 95d76b1999d21b52ff33b5f76b2eee125d22fa02c51281d6b72058b9d608ea69cca11608f41f50b9348d46a26cc8931c40a6873f0fe17b72d76891b51dcaa1cb SHA512 0e3b3647f1b8b648389fa1018f5903d880947556244633e0b2b4809ccab3d14cf8e742cd14a99e2e88972a84c8fb97956dc290b023e514de63c7793a21b6c294 diff --git a/dev-python/uhashring/metadata.xml b/dev-python/uhashring/metadata.xml new file mode 100644 index 0000000000..6459b118c0 --- /dev/null +++ b/dev-python/uhashring/metadata.xml @@ -0,0 +1,30 @@ + + + + + comaintainers welcome + lssndrbarbieri@gmail.com + Alessandro Barbieri + + +uhashring implements consistent hashing in pure Python. + +Consistent hashing is mostly used on distributed systems/caches/databases as this avoid the total reshuffling of your key-node mappings when adding or removing a node in your ring (called continuum on libketama). More information and details about this can be found in the literature section. + +This full featured implementation offers: + +a lot of convenient methods to use your consistent hash ring in real world applications. +simple integration with other libs such as memcache through monkey patching. +a full ketama compatibility if you need to use it (see important mention below). +all the missing functions in the libketama C python binding (which is not even available on pypi) for ketama users. +possibility to use your own weight and hash functions if you don't care about the ketama compatibility. +instance-oriented usage so you can use your consistent hash ring object directly in your code (see advanced usage). +native pypy support, since this is a pure python library. +tests of implementation, key distribution and ketama compatibility. +Per node weight is also supported and will affect the nodes distribution on the ring. + + + ultrabug/uhashring + uhashring + + diff --git a/dev-python/uhashring/uhashring-2.1.ebuild b/dev-python/uhashring/uhashring-2.1.ebuild new file mode 100644 index 0000000000..2a04a77255 --- /dev/null +++ b/dev-python/uhashring/uhashring-2.1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Full featured consistent hashing python library compatible with ketama" +HOMEPAGE="https://github.com/ultrabug/uhashring" +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND="" +DEPEND=" + ${RDEPEND} + test? ( + >=dev-python/python-memcached-1.59[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest