# Path: tooz/hashring.py
# class UnknownNode(tooz.ToozError):
# class HashRing(object):
#     def __init__(self, node):
#     def __init__(self, nodes, partitions=DEFAULT_PARTITION_NUMBER,
#                  hash_function=DEFAULT_HASH_FUNCTION):
#     def add_node(self, node, weight=1):
#     def add_nodes(self, nodes, weight=1):
#     def remove_node(self, node):
#     def _hash2int(key):
#     def _get_partition(self, data):
#     def _get_node(self, partition):
#     def get_nodes(self, data, ignore_nodes=None, replicas=1):
#     def __getitem__(self, key):
#     def __len__(self):
#     DEFAULT_PARTITION_NUMBER = 2**5
#     DEFAULT_HASH_FUNCTION = 'md5'


from tooz import hashring
# Copyright (C) 2020 Red Hat, Inc.
#
# 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.


hashring = hashring.HashRing({'node1', 'node2', 'node3'})

# Returns set(['node2'])
nodes_for_foo = hashring[b'foo']

# Returns set(['node2', 'node3'])
nodes_for_foo_with_replicas = hashring.get_nodes(b'foo',
                                                 replicas=2)

# Returns set(['node1', 'node3'])

# Path: tooz/hashring.py
# class UnknownNode(tooz.ToozError):
# class HashRing(object):
#     def __init__(self, node):
#     def __init__(self, nodes, partitions=DEFAULT_PARTITION_NUMBER,
#                  hash_function=DEFAULT_HASH_FUNCTION):
#     def add_node(self, node, weight=1):
#     def add_nodes(self, nodes, weight=1):
#     def remove_node(self, node):
#     def _hash2int(key):
#     def _get_partition(self, data):
#     def _get_node(self, partition):
#     def get_nodes(self, data, ignore_nodes=None, replicas=1):
#     def __getitem__(self, key):
#     def __len__(self):
#     DEFAULT_PARTITION_NUMBER = 2**5
#     DEFAULT_HASH_FUNCTION = 'md5'


# Path: examples/hashring.py
from tooz import hashring

# Copyright (C) 2020 Red Hat, Inc.
#
# 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.


hashring = hashring.HashRing({'node1', 'node2', 'node3'})

# Returns set(['node2'])
nodes_for_foo = hashring[b'foo']

# Returns set(['node2', 'node3'])
nodes_for_foo_with_replicas = hashring.get_nodes(b'foo',
                                                 replicas=2)

# Returns set(['node1', 'node3'])

nodes_for_foo_with_replicas = hashring.get_nodes(b'foo',