Beispiel #1
0
 def __init__(self, table_name, args, log):
     TableHandler.__init__(self, table_name, args, log)
     self.max_part = None       # max part number
     self.local_part = None     # part number of local node
     self.key = args.get('key')        
     if self.key is None:
         raise Exception('Specify key field as key agument')
Beispiel #2
0
 def __init__(self, table_name, args, log):
     TableHandler.__init__(self, table_name, args, log)
     self.max_part = None  # max part number
     self.local_part = None  # part number of local node
     self.key = args.get('key')
     if self.key is None:
         raise Exception('Specify key field as key agument')
Beispiel #3
0
    def __init__(self, table_name, args, dest_table):
        TableHandler.__init__(self, table_name, args, dest_table)
        self.hash_mask = None  # aka max part number (atm)
        self.shard_nr = None  # part number of local node

        # primary key columns
        self.hash_key = args.get('hash_key', args.get('key'))
        self._validate_hash_key()

        # hash function & full expression
        hashfunc = args.get('hashfunc', self.DEFAULT_HASHFUNC)
        self.hashexpr = self.DEFAULT_HASHEXPR % (skytools.quote_fqident(
            hashfunc), skytools.quote_ident(self.hash_key or ''))
        self.hashexpr = args.get('hashexpr', self.hashexpr)
Beispiel #4
0
    def __init__(self, table_name, args, dest_table):
        TableHandler.__init__(self, table_name, args, dest_table)
        self.max_part = None  # max part number
        self.local_part = None  # part number of local node

        # primary key columns
        self.key = args.get('key')
        if self.key is None:
            raise Exception('Specify key field as key agument')

        # hash function & full expression
        hashfunc = args.get('hashfunc', self.DEFAULT_HASHFUNC)
        self.hashexpr = self.DEFAULT_HASHEXPR % (
            skytools.quote_fqident(hashfunc), skytools.quote_ident(self.key))
        self.hashexpr = args.get('hashexpr', self.hashexpr)
Beispiel #5
0
    def __init__(self, table_name, args, dest_table):
        TableHandler.__init__(self, table_name, args, dest_table)
        self.hash_mask = None   # aka max part number (atm)
        self.shard_nr = None    # part number of local node

        # primary key columns
        self.hash_key = args.get('hash_key', args.get('key'))
        self._validate_hash_key()

        # hash function & full expression
        hashfunc = args.get('hashfunc', self.DEFAULT_HASHFUNC)
        self.hashexpr = self.DEFAULT_HASHEXPR % (
                skytools.quote_fqident(hashfunc),
                skytools.quote_ident(self.hash_key or ''))
        self.hashexpr = args.get('hashexpr', self.hashexpr)
Beispiel #6
0
    def __init__(self, table_name, args, dest_table):
        TableHandler.__init__(self, table_name, args, dest_table)
        self.max_part = None       # max part number
        self.local_part = None     # part number of local node

        # primary key columns
        self.key = args.get('key')
        if self.key is None:
            raise Exception('Specify key field as key argument')

        # hash function & full expression
        hashfunc = args.get('hashfunc', self.DEFAULT_HASHFUNC)
        self.hashexpr = self.DEFAULT_HASHEXPR % (
                skytools.quote_fqident(hashfunc),
                skytools.quote_ident(self.key))
        self.hashexpr = args.get('hashexpr', self.hashexpr)