{ "info": { "author": "Joachim Bauch", "author_email": "mail@joachim-bauch.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "python-continuum - Consistent hashing\n========================================================================\n\nCopyright (c) 2010 by Joachim Bauch, mail@joachim-bauch.de\nhttp://www.joachim-bauch.de/projects/python-continuum/\n\npython-continuum provides a function to do consistent hashing. See\nwikipedia [1]_ for more informations about this technique.\n\nFirst we need the continuum object that serves as storage for server\ninformations and can later be used to resolve keys::\n\n\t>>> from continuum import Continuum\n\t>>> c = Continuum()\n\nEmpty continuums obviously can't be queried::\n\n\t>>> c.resolve('my-key1')\n\tTraceback (most recent call last):\n\t...\n\tIndexError: empty continuum\n\nAdd the server objects that are available as backends::\n\n\t>>> c.add_server('192.168.0.1', 8080)\n\t\n\t>>> c.add_server('192.168.0.2', 8080)\n\t\n\nYou can also specify different capacities of the server to priorize\nthem (this defaults to 1)::\n\n\t>>> c.add_server('192.168.0.3', 8080, 2)\n\t\n\nServer objects can also be removed::\n\n\t>>> server = c.add_server('192.168.0.4', 8080)\n\t>>> c.remove_server(server)\n\t>>> len(c)\n\t3\n\nPlease note that a server can only be added once::\n\n\t>>> c.add_server('192.168.0.2', 8080)\n\tTraceback (most recent call last):\n\t...\n\tTypeError: server already added\n\nAfter all servers have been added, the continuum can be queried for the\nserver that should be used for a given (string) key::\n\n\t>>> c.resolve('my-first-key')\n\t\n\t>>> c.resolve('my-other-key')\n\t\n\n\n.. [1] http://en.wikipedia.org/wiki/Consistent_hashing", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/python-continuum/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.joachim-bauch.de/projects/python-continuum/", "keywords": "consistent hashing", "license": "LGPL", "maintainer": null, "maintainer_email": null, "name": "python-continuum", "package_url": "https://pypi.org/project/python-continuum/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-continuum/", "project_urls": { "Download": "http://pypi.python.org/pypi/python-continuum/", "Homepage": "http://www.joachim-bauch.de/projects/python-continuum/" }, "release_url": "https://pypi.org/project/python-continuum/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Consistent hashing for Python", "version": "0.1.1" }, "last_serial": 3045773, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e8ef74846411779501a25c184bda6f9a", "sha256": "ec1c3bf49bf4c09ad64eda458e1d2759e534256cff081f2e9703e6de3a73a67a" }, "downloads": -1, "filename": "python_continuum-0.1.0-py2.6.egg", "has_sig": false, "md5_digest": "e8ef74846411779501a25c184bda6f9a", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 5583, "upload_time": "2010-11-15T00:59:35", "url": "https://files.pythonhosted.org/packages/47/69/85697fa0531156468c058394a91396ebc8b1da70e86daf4582bbf38bc45f/python_continuum-0.1.0-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "837d85dc0b2842696df29cdfebfffd7e", "sha256": "40f3ff01aaf0139971b5caa1bd384250ef4a0cf8d39525b945949a1c815c5e92" }, "downloads": -1, "filename": "python-continuum-0.1.0.tar.gz", "has_sig": false, "md5_digest": "837d85dc0b2842696df29cdfebfffd7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17811, "upload_time": "2010-11-15T00:59:10", "url": "https://files.pythonhosted.org/packages/c4/fa/0d77ea72d16887fbccfe1b3bca10d1043afb2d4699d13143803d792473e5/python-continuum-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e3ef6a8c6974bb6cd6a78af1d2ad6904", "sha256": "75b81a753c2850b924807b2c40257479325f012b4c9ff96b3fdfedd1771dd77e" }, "downloads": -1, "filename": "python_continuum-0.1.1-py2.6.egg", "has_sig": false, "md5_digest": "e3ef6a8c6974bb6cd6a78af1d2ad6904", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 5696, "upload_time": "2010-11-15T01:26:30", "url": "https://files.pythonhosted.org/packages/07/25/0fcaf38f663b93fcaedfd5694453bd2b7a30872dac3a62032ad80ecab668/python_continuum-0.1.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "09db7059f5f3f328c22df180e78f0a37", "sha256": "1646eb37fda018609bc982083240cecc0e304c5d01057692e457bff76dca321a" }, "downloads": -1, "filename": "python-continuum-0.1.1.tar.gz", "has_sig": false, "md5_digest": "09db7059f5f3f328c22df180e78f0a37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17862, "upload_time": "2010-11-15T01:26:16", "url": "https://files.pythonhosted.org/packages/d5/c9/46b2e30e90d795df2892d7ddfd99dfc63f0362f9656db6b8fa52ab65fcfa/python-continuum-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e3ef6a8c6974bb6cd6a78af1d2ad6904", "sha256": "75b81a753c2850b924807b2c40257479325f012b4c9ff96b3fdfedd1771dd77e" }, "downloads": -1, "filename": "python_continuum-0.1.1-py2.6.egg", "has_sig": false, "md5_digest": "e3ef6a8c6974bb6cd6a78af1d2ad6904", "packagetype": "bdist_egg", "python_version": "2.6", "requires_python": null, "size": 5696, "upload_time": "2010-11-15T01:26:30", "url": "https://files.pythonhosted.org/packages/07/25/0fcaf38f663b93fcaedfd5694453bd2b7a30872dac3a62032ad80ecab668/python_continuum-0.1.1-py2.6.egg" }, { "comment_text": "", "digests": { "md5": "09db7059f5f3f328c22df180e78f0a37", "sha256": "1646eb37fda018609bc982083240cecc0e304c5d01057692e457bff76dca321a" }, "downloads": -1, "filename": "python-continuum-0.1.1.tar.gz", "has_sig": false, "md5_digest": "09db7059f5f3f328c22df180e78f0a37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17862, "upload_time": "2010-11-15T01:26:16", "url": "https://files.pythonhosted.org/packages/d5/c9/46b2e30e90d795df2892d7ddfd99dfc63f0362f9656db6b8fa52ab65fcfa/python-continuum-0.1.1.tar.gz" } ] }