MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / BytesToken

Class BytesToken

cassandra/metadata.py:1870–1882  ·  view source on GitHub ↗

A token for ``ByteOrderedPartitioner``.

Source from the content-addressed store, hash-verified

1868
1869
1870class BytesToken(Token):
1871 """
1872 A token for ``ByteOrderedPartitioner``.
1873 """
1874
1875 @classmethod
1876 def from_string(cls, token_string):
1877 """ `token_string` should be the string representation from the server. """
1878 # unhexlify works fine with unicode input in everythin but pypy3, where it Raises "TypeError: 'str' does not support the buffer interface"
1879 if isinstance(token_string, str):
1880 token_string = token_string.encode('ascii')
1881 # The BOP stores a hex string
1882 return cls(unhexlify(token_string))
1883
1884
1885class TriggerMetadata(object):

Callers 3

test_bytes_tokensMethod · 0.90
test_comparisonMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_bytes_tokensMethod · 0.72
test_comparisonMethod · 0.72