{ "info": { "author": "Ernest W. Durbin III", "author_email": "ewdurbin@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "clandestined\r\n============\r\n\r\nrendezvous hashing implementation based on murmur3 hash\r\n\r\nmotivation\r\n----------\r\n\r\nin distributed systems, the need often arises to locate objects amongst\r\na cluster of machines. consistent hashing and rendezvous hashing are\r\nmethods of performing this task, while minimizing data movement on\r\ncluster topology changes.\r\n\r\nclandestined is a library for rendezvous hashing which has the goal of\r\nsimple clients and ease of use.\r\n\r\nCurrently targetting for support: - Python 2.5 through Python 3.6\r\n\r\n|Build Status|\r\n\r\nexample usage\r\n-------------\r\n\r\n.. code:: python\r\n\r\n >>> from clandestined import Cluster\r\n >>>\r\n >>> nodes = {\r\n ... '1': {'name': 'node1.example.com', 'zone': 'us-east-1a'},\r\n ... '2': {'name': 'node2.example.com', 'zone': 'us-east-1a'},\r\n ... '3': {'name': 'node3.example.com', 'zone': 'us-east-1a'},\r\n ... '4': {'name': 'node4.example.com', 'zone': 'us-east-1b'},\r\n ... '5': {'name': 'node5.example.com', 'zone': 'us-east-1b'},\r\n ... '6': {'name': 'node6.example.com', 'zone': 'us-east-1b'},\r\n ... '7': {'name': 'node7.example.com', 'zone': 'us-east-1c'},\r\n ... '8': {'name': 'node8.example.com', 'zone': 'us-east-1c'},\r\n ... '9': {'name': 'node9.example.com', 'zone': 'us-east-1c'},\r\n ... }\r\n >>>\r\n >>> cluster = Cluster(nodes)\r\n >>> cluster.find_nodes('mykey')\r\n ['4', '8']\r\n >>>\r\n\r\nby default, ``Cluster`` will place 2 replicas around the cluster taking\r\ncare to place the second replica in a separate zone from the first.\r\n\r\nin the event that your cluster doesn't need zone awareness, you can\r\neither invoke the ``RendezvousHash`` class directly, or use a\r\n``Cluster`` with replicas set to 1\r\n\r\n.. code:: python\r\n\r\n >>> from clandestined import Cluster\r\n >>> from clandestined import RendezvousHash\r\n >>>\r\n >>> nodes = {\r\n ... '1': {'name': 'node1.example.com'},\r\n ... '2': {'name': 'node2.example.com'},\r\n ... '3': {'name': 'node3.example.com'},\r\n ... '4': {'name': 'node4.example.com'},\r\n ... '5': {'name': 'node5.example.com'},\r\n ... '6': {'name': 'node6.example.com'},\r\n ... '7': {'name': 'node7.example.com'},\r\n ... '8': {'name': 'node8.example.com'},\r\n ... '9': {'name': 'node9.example.com'},\r\n ... }\r\n >>>\r\n >>> cluster = Cluster(nodes, replicas=1)\r\n >>> rendezvous = RendezvousHash(nodes.keys())\r\n >>>\r\n >>> cluster.find_nodes('mykey')\r\n ['4']\r\n >>> rendezvous.find_node('mykey')\r\n '4'\r\n >>>\r\n\r\nadvanced usage\r\n--------------\r\n\r\nmurmur3 seeding\r\n~~~~~~~~~~~~~~~\r\n\r\n**DISCLAIMER**\r\n\r\nclandestined was not designed with consideration for untrusted input,\r\nplease see LICENSE.\r\n\r\n**END DISCLAIMER**\r\n\r\nif you plan to use keys based on untrusted input (not supported, but go\r\nahead), it would be best to use a custom seed for hashing. although this\r\ntechnique is by no means a way to fully mitigate a DoS attack using\r\ncrafted keys, it may make you sleep better at night.\r\n\r\n.. code:: python\r\n\r\n >>> from clandestined import Cluster\r\n >>> from clandestined import RendezvousHash\r\n >>>\r\n >>> nodes = {\r\n ... '1': {'name': 'node1.example.com'},\r\n ... '2': {'name': 'node2.example.com'},\r\n ... '3': {'name': 'node3.example.com'},\r\n ... '4': {'name': 'node4.example.com'},\r\n ... '5': {'name': 'node5.example.com'},\r\n ... '6': {'name': 'node6.example.com'},\r\n ... '7': {'name': 'node7.example.com'},\r\n ... '8': {'name': 'node8.example.com'},\r\n ... '9': {'name': 'node9.example.com'},\r\n ... }\r\n >>>\r\n >>> cluster = Cluster(nodes, replicas=1, seed=1337)\r\n >>> rendezvous = RendezvousHash(nodes.keys(), seed=1337)\r\n >>>\r\n >>> cluster.find_nodes('mykey')\r\n ['7']\r\n >>> rendezvous.find_node('mykey')\r\n '7'\r\n >>>\r\n\r\n.. |Build Status| image:: https://travis-ci.org/ewdurbin/clandestined-python.svg?branch=master\r\n :target: https://travis-ci.org/ewdurbin/clandestined-python", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ewdurbin/clandestined-python", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "clandestined", "package_url": "https://pypi.org/project/clandestined/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/clandestined/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ewdurbin/clandestined-python" }, "release_url": "https://pypi.org/project/clandestined/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "rendezvous hashing implementation based on murmur3 hash", "version": "1.0.1" }, "last_serial": 3704390, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "316326ebb254ffceedda7f9a2dc61afd", "sha256": "ff8be1496fbfdeba65df7f512849017ec592f4439f194f3f0fe63f96f2be1a72" }, "downloads": -1, "filename": "clandestined-1.0.0.tar.gz", "has_sig": false, "md5_digest": "316326ebb254ffceedda7f9a2dc61afd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3408, "upload_time": "2014-12-18T05:10:06", "url": "https://files.pythonhosted.org/packages/a1/bb/94e1f24e4fb8bd34052969fd946199806613c52f6d709b2d3e817802faa7/clandestined-1.0.0.tar.gz" } ], "1.0.0a": [ { "comment_text": "", "digests": { "md5": "0cfb8b674c3a4f77e6ebfc398d8df712", "sha256": "9bb41b42c6bf096b57a06f9afaaeb0b6afdc0407e09c41667c400945b0aecb14" }, "downloads": -1, "filename": "clandestined-1.0.0a.tar.gz", "has_sig": false, "md5_digest": "0cfb8b674c3a4f77e6ebfc398d8df712", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3365, "upload_time": "2014-07-07T02:43:08", "url": "https://files.pythonhosted.org/packages/69/68/65c862ac7c2335d1da075c1c7ee61cda8bbbb9cf58b1a7d994c7254cd63a/clandestined-1.0.0a.tar.gz" } ], "1.0.0b": [ { "comment_text": "", "digests": { "md5": "0a5d3f1809f3556a85771a0e6c4f61fd", "sha256": "59e68df02a2b3dcff9d4a29f6c0e6082b29eeb8de26b51c8fb7564ebab6bb941" }, "downloads": -1, "filename": "clandestined-1.0.0b.tar.gz", "has_sig": false, "md5_digest": "0a5d3f1809f3556a85771a0e6c4f61fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3360, "upload_time": "2014-07-07T16:35:05", "url": "https://files.pythonhosted.org/packages/73/82/b8a03426ce180a20596eb9a44d90bbe1e4462aa4ac05f79a566199b0acd0/clandestined-1.0.0b.tar.gz" } ], "1.0.0rc1": [ { "comment_text": "", "digests": { "md5": "358c84ed9a57e33320880974e0103e20", "sha256": "bf425b8fa39abb1421de8fd8caf09234aed1bc3e47871af1a7bebdf9129aa7f5" }, "downloads": -1, "filename": "clandestined-1.0.0rc1.tar.gz", "has_sig": false, "md5_digest": "358c84ed9a57e33320880974e0103e20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3437, "upload_time": "2014-07-14T04:30:18", "url": "https://files.pythonhosted.org/packages/17/63/3077ed9397582107438854a2333bad6f42b001586045d45dc66ade9affd1/clandestined-1.0.0rc1.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "917805264dcd66b21c635067ea38d5c5", "sha256": "900edfec3f20ba9988286d924206e154a11ee7f5371df1bbc5a49a06fbe9efd4" }, "downloads": -1, "filename": "clandestined-1.0.1.tar.gz", "has_sig": false, "md5_digest": "917805264dcd66b21c635067ea38d5c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2015-06-30T13:19:31", "url": "https://files.pythonhosted.org/packages/bb/69/a9fb8adbbc0a7b0c865e828389bafad5225f3ca098f8d444c3d6400ce6f8/clandestined-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "917805264dcd66b21c635067ea38d5c5", "sha256": "900edfec3f20ba9988286d924206e154a11ee7f5371df1bbc5a49a06fbe9efd4" }, "downloads": -1, "filename": "clandestined-1.0.1.tar.gz", "has_sig": false, "md5_digest": "917805264dcd66b21c635067ea38d5c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3576, "upload_time": "2015-06-30T13:19:31", "url": "https://files.pythonhosted.org/packages/bb/69/a9fb8adbbc0a7b0c865e828389bafad5225f3ca098f8d444c3d6400ce6f8/clandestined-1.0.1.tar.gz" } ] }