MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / __init__

Method __init__

join/LSH/datasketch/storage.py:712–741  ·  view source on GitHub ↗

Constructor. :param dict[str, any] config: configuration following the following format: { 'basename': b'test', 'type': 'cassandra', 'cassandra': { 'seeds': ['127.0.0.1'],

(self, config, name=None, buffer_size=None)

Source from the content-addressed store, hash-verified

710 DEFAULT_BUFFER_SIZE = 5000
711
712 def __init__(self, config, name=None, buffer_size=None):
713 """
714 Constructor.
715
716 :param dict[str, any] config: configuration following the following format:
717 {
718 'basename': b'test',
719 'type': 'cassandra',
720 'cassandra': {
721 'seeds': ['127.0.0.1'],
722 'keyspace': 'lsh_test',
723 'replication': {
724 'class': 'SimpleStrategy',
725 'replication_factor': '1'
726 },
727 'drop_keyspace': True,
728 'drop_tables': True,
729 'shared_buffer': False,
730 }
731 }
732 :param bytes name: the name
733 :param int buffer_size: the buffer size
734 """
735 self._config = config
736 if buffer_size is None:
737 buffer_size = CassandraStorage.DEFAULT_BUFFER_SIZE
738 cassandra_param = self._parse_config(self._config['cassandra'])
739 self._name = name if name else _random_name(11).decode('utf-8')
740 self._buffer_size = buffer_size
741 self._client = CassandraClient(cassandra_param, name, self._buffer_size)
742
743 @staticmethod
744 def _parse_config(config):

Callers 1

__setstate__Method · 0.95

Calls 3

_parse_configMethod · 0.95
CassandraClientClass · 0.85
_random_nameFunction · 0.70

Tested by

no test coverage detected