Metadata-Version: 1.0
Name: ConsistentHashing
Version: 0.1.6
Summary: A simple implement of consistent hashing.
Home-page: UNKNOWN
Author: Ziang Guo
Author-email: iziang@yeah.net
License: BSD
Description: Getting Started
        ---------------
        
        .. code-block:: pycon
                >>> from consistenthashing import consistenthashing
                >>> inst = consistenthashing(nodes=["122.225.109.103","221.236.5.135","58.58.179.52","61.174.51.204","222.186.31.234","182.74.141.242","179.107.90.135","178.219.4.250","178.77.185.45","178.132.38.58","62.210.180.207","178.79.59.109","182.74.12.214"], slotSize=10000, virtualNode=2)
                >>> inst.getAllNodes()
                ['122.225.109.103', '221.236.5.135', '58.58.179.52', '61.174.51.204', '222.186.31.234', '182.74.141.242', '179.107.90.135', '178.219.4.250', '178.77.185.45', '178.132.38.58', '62.210.180.207', '178.79.59.109', '182.74.12.214']
                >>> inst.addNode('1.1.1.1')
                True
                >>> inst.getNode('1')
                '178.219.4.250'
                >>> inst.getNode('a')
                '178.77.185.45'
                >>> inst.getNode('hello')
                '61.174.51.204'
                >>> inst.getNode('consistenthashing')
                '1.1.1.1'
                >>> inst.getVirtualNodeNumber()
                2
                >>> inst.getVirtualNodes('221.236.5.135')
                ['221.236.5.135_virtual1', '221.236.5.135_virtual2']
                >>> inst.removeNode('122.225.109.103')
                True
                >>> inst.getAllNodes()
                ['221.236.5.135', '58.58.179.52', '61.174.51.204', '222.186.31.234', '182.74.141.242', '179.107.90.135', '178.219.4.250', '178.77.185.45', '178.132.38.58', '62.210.180.207', '178.79.59.109', '182.74.12.214', '1.1.1.1']
        
Keywords: hashing hash consistent distributed
Platform: Any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Software Development :: Libraries :: Python Modules
