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
Prev Previous commit
Next Next commit
make murmur_hash private
  • Loading branch information
bryevdv committed Jul 11, 2019
commit bff6cc92a7b418ee99c12d3a11b4177ab34ff55d
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""Hash partition resolver implementation in the Azure Cosmos database service.
"""

from . import murmur_hash
from . import _murmur_hash
from . import _consistent_hash_ring

class HashPartitionResolver(object):
Expand Down Expand Up @@ -51,7 +51,7 @@ def __init__(self, partition_key_extractor, collection_links, default_number_of_
self.collection_links = collection_links

if hash_generator is None:
hash_generator = murmur_hash._MurmurHash()
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

https://pypi.python.org/pypi/mmh3/2.0
'''
class _MurmurHash(object):
class MurmurHash(object):
""" The 32 bit x86 version of MurmurHash3 implementation.
"""
def ComputeHash(self, key):
Expand Down
8 changes: 4 additions & 4 deletions sdk/cosmos/azure-cosmos/test/crud_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import azure.cosmos.documents as documents
import azure.cosmos.errors as errors
from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes
import azure.cosmos.murmur_hash as murmur_hash
import azure.cosmos._murmur_hash as _murmur_hash
import test_config
import azure.cosmos.base as base
import azure.cosmos.cosmos_client as cosmos_client
Expand Down Expand Up @@ -851,13 +851,13 @@ def test_murmur_hash(self):
str = 'afdgdd'
bytes = bytearray(str, encoding='utf-8')

hash_value = murmur_hash._MurmurHash._ComputeHash(bytes)
hash_value = _murmur_hash.MurmurHash._ComputeHash(bytes)
self.assertEqual(1099701186, hash_value)

num = 374.0
bytes = bytearray(pack('d', num))

hash_value = murmur_hash._MurmurHash._ComputeHash(bytes)
hash_value = _murmur_hash.MurmurHash._ComputeHash(bytes)
self.assertEqual(3717946798, hash_value)

self._validate_bytes("", 0x1B873593, bytearray(b'\xEE\xA8\xA2\x67'), 1738713326)
Expand All @@ -878,7 +878,7 @@ def test_murmur_hash(self):
3381504877)

def _validate_bytes(self, str, seed, expected_hash_bytes, expected_value):
hash_value = murmur_hash._MurmurHash._ComputeHash(bytearray(str, encoding='utf-8'), seed)
hash_value = _murmur_hash.MurmurHash._ComputeHash(bytearray(str, encoding='utf-8'), seed)
bytes = bytearray(pack('I', hash_value))
self.assertEqual(expected_value, hash_value)
self.assertEqual(expected_hash_bytes, bytes)
Expand Down