Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4c4b078
make consistent_hash_ring private
bryevdv Jul 11, 2019
038db50
make default_retry_policy private
bryevdv Jul 11, 2019
51d4466
make endpoint_discovery_retry_policy private
bryevdv Jul 11, 2019
b1719fe
make hash_partition_resolver private
bryevdv Jul 11, 2019
46e7fed
make location_cache private
bryevdv Jul 11, 2019
bff6cc9
make murmur_hash private
bryevdv Jul 11, 2019
0e100af
make range private
bryevdv Jul 11, 2019
3d2e65c
make range_partition_resolver private
bryevdv Jul 11, 2019
3e43f69
make vector_session_token private
bryevdv Jul 16, 2019
60ad7fb
make resource_throttle_retry_policy private
bryevdv Jul 16, 2019
68fd7a9
make retry_utility private
bryevdv Jul 16, 2019
8e9274c
make utils private
bryevdv Jul 16, 2019
6dad678
make routing private
bryevdv Jul 17, 2019
6b1a641
make execution_context private
bryevdv Jul 18, 2019
ce36df2
make cosmos_client_connection private
bryevdv Jul 18, 2019
2063355
make retry_options private
bryevdv Jul 18, 2019
8e84029
make query_iterable private
bryevdv Jul 18, 2019
eedb532
make constants private
bryevdv Jul 19, 2019
56c074a
make synchronized_request private
bryevdv Jul 19, 2019
109e496
make session_retry_policy private
bryevdv Jul 19, 2019
c94dc6d
make partition private
bryevdv Jul 19, 2019
4502740
make global_endpoint_manager private
bryevdv Jul 19, 2019
0a60acf
make runtime_constants private
bryevdv Jul 19, 2019
4fb54ac
make session private
bryevdv Jul 19, 2019
2a41dfc
make request_object private
bryevdv Jul 19, 2019
444d5d5
make base private
bryevdv Jul 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
make consistent_hash_ring private
  • Loading branch information
bryevdv committed Jul 11, 2019
commit 4c4b07879f59194f595e9790b7cede01645c454a
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from . import partition


class _ConsistentHashRing(object):
class ConsistentHashRing(object):
"""The ConsistentHashRing class implements a consistent hash ring using the
hash generator specified.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"""

from . import murmur_hash
from . import consistent_hash_ring
from . import _consistent_hash_ring

class HashPartitionResolver(object):
"""HashPartitionResolver implements partitioning based on the value of a hash function, allowing you to evenly
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(self, partition_key_extractor, collection_links, default_number_of_
if hash_generator is None:
hash_generator = murmur_hash._MurmurHash()

self.consistent_hash_ring = consistent_hash_ring._ConsistentHashRing(self.collection_links, default_number_of_virtual_nodes_per_collection, hash_generator)
self.consistent_hash_ring = _consistent_hash_ring.ConsistentHashRing(self.collection_links, default_number_of_virtual_nodes_per_collection, hash_generator)

def ResolveForCreate(self, document):
"""Resolves the collection for creating the document based on the partition key.
Expand Down
10 changes: 5 additions & 5 deletions sdk/cosmos/azure-cosmos/test/crud_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import urllib.parse as urllib
import uuid
import pytest
import azure.cosmos.consistent_hash_ring as consistent_hash_ring
from azure.cosmos import _consistent_hash_ring
import azure.cosmos.documents as documents
import azure.cosmos.errors as errors
from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes
Expand Down Expand Up @@ -884,19 +884,19 @@ def _validate_bytes(self, str, seed, expected_hash_bytes, expected_value):
self.assertEqual(expected_hash_bytes, bytes)

def test_get_bytes(self):
actual_bytes = consistent_hash_ring._ConsistentHashRing._GetBytes("documentdb")
actual_bytes = _consistent_hash_ring.ConsistentHashRing._GetBytes("documentdb")
expected_bytes = bytearray(b'\x64\x6F\x63\x75\x6D\x65\x6E\x74\x64\x62')
self.assertEqual(expected_bytes, actual_bytes)

actual_bytes = consistent_hash_ring._ConsistentHashRing._GetBytes("azure")
actual_bytes = _consistent_hash_ring.ConsistentHashRing._GetBytes("azure")
expected_bytes = bytearray(b'\x61\x7A\x75\x72\x65')
self.assertEqual(expected_bytes, actual_bytes)

actual_bytes = consistent_hash_ring._ConsistentHashRing._GetBytes("json")
actual_bytes = _consistent_hash_ring.ConsistentHashRing._GetBytes("json")
expected_bytes = bytearray(b'\x6A\x73\x6F\x6E')
self.assertEqual(expected_bytes, actual_bytes)

actual_bytes = consistent_hash_ring._ConsistentHashRing._GetBytes("nosql")
actual_bytes = _consistent_hash_ring.ConsistentHashRing._GetBytes("nosql")
expected_bytes = bytearray(b'\x6E\x6F\x73\x71\x6C')
self.assertEqual(expected_bytes, actual_bytes)

Expand Down