Exemplo n.º 1
0
 def __init__(self, table_name, args, log):
     """Init per-batch table data cache."""
     BaseHandler.__init__(self, table_name, args, log)
     try:
         self.dst_queue_name = args['queue']
     except KeyError:
         raise Exception('specify queue with handler-arg')
     self.rows = []
Exemplo n.º 2
0
 def __init__(self, table_name, args, log):
     """Init per-batch table data cache."""
     BaseHandler.__init__(self, table_name, args, log)
     try:
         self.dst_queue_name = args['queue']
     except KeyError:
         raise Exception('specify queue with handler-arg')
     self.rows = []
Exemplo n.º 3
0
    def __init__(self, table_name, args, dest_table):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, args, dest_table)

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}
        self.method = int(args.get('method', DEFAULT_METHOD))
        if not self.method in (0, 1, 2):
            raise Exception('unknown method: %s' % self.method)

        self.log.debug('bulk_init(%r), method=%d', args, self.method)
Exemplo n.º 4
0
    def __init__(self, table_name, args, log):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, args, log)

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}
        self.method = int(args.get('method', DEFAULT_METHOD))
        if not self.method in (0,1,2):
            raise Exception('unknown method: %s' % self.method)

        self.log.debug('bulk_init(%s), method=%d' % (repr(args), self.method))
Exemplo n.º 5
0
 def __init__(self, table_name, args, log):
     BaseHandler.__init__(self, table_name, args, log)
     # show args
     self.log.debug("dispatch.init: table_name=%r, args=%r" % \
                    (table_name, args))
     # get table name
     self.table_name = args.get('table', self.table_name)
     self.quoted_name = quote_fqident(self.table_name)
     self.batch_info = None
     self.dst_curs = None
     self.pkeys = None
     # config
     self.conf = self.get_config()
     hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
     self.row_handler = hdlr_cls(self.log)
Exemplo n.º 6
0
    def __init__(self, table_name, args, dest_table):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, args, dest_table)

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}
        self.method = int(args.get("method", DEFAULT_METHOD))
        if not self.method in (0, 1, 2):
            raise Exception("unknown method: %s" % self.method)

        self.log.debug("bulk_init(%r), method=%d", args, self.method)
Exemplo n.º 7
0
 def __init__(self, table_name, args, log):
     BaseHandler.__init__(self, table_name, args, log)
     # show args
     self.log.debug("dispatch.init: table_name=%r, args=%r" % \
                    (table_name, args))
     # get table name
     self.table_name = args.get('table', self.table_name)
     self.quoted_name = quote_fqident(self.table_name)
     self.batch_info = None
     self.dst_curs = None
     self.pkeys = None
     # config
     self.conf = self.get_config()
     hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
     self.row_handler = hdlr_cls(self.log)
Exemplo n.º 8
0
 def __init__(self, table_name, args, log):
     BaseHandler.__init__(self, table_name, args, log)
     # show args
     self.log.debug("dispatch.init: table_name=%r, args=%r" % (table_name, args))
     # get table name
     self.table_name = args.get("table", self.table_name)
     self.quoted_name = quote_fqident(self.table_name)
     self.batch_info = None
     self.dst_curs = None
     self.pkeys = None
     # config
     self.conf = self.get_config()
     hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
     self.row_handler = hdlr_cls(self.log)
     if self.conf.encoding:
         self.encoding_validator = EncodingValidator(self.log, self.conf.encoding)
     else:
         self.encoding_validator = None
Exemplo n.º 9
0
    def __init__(self, table_name, args, dest_table):

        # compat for dest-table
        dest_table = args.get('table', dest_table)

        BaseHandler.__init__(self, table_name, args, dest_table)

        # show args
        self.log.debug("dispatch.init: table_name=%r, args=%r", table_name, args)
        self.batch_info = None
        self.dst_curs = None
        self.pkeys = None
        # config
        self.conf = self.get_config()
        hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
        self.row_handler = hdlr_cls(self.log)
        if self.conf.encoding:
            self.encoding_validator = EncodingValidator(self.log,
                                                        self.conf.encoding)
        else:
            self.encoding_validator = None
Exemplo n.º 10
0
    def __init__(self, table_name, args, dest_table):

        # compat for dest-table
        dest_table = args.get('table', dest_table)

        BaseHandler.__init__(self, table_name, args, dest_table)

        # show args
        self.log.debug("dispatch.init: table_name=%r, args=%r" % \
                       (table_name, args))
        self.batch_info = None
        self.dst_curs = None
        self.pkeys = None
        # config
        self.conf = self.get_config()
        hdlr_cls = ROW_HANDLERS[self.conf.row_mode]
        self.row_handler = hdlr_cls(self.log)
        if self.conf.encoding:
            self.encoding_validator = EncodingValidator(
                self.log, self.conf.encoding)
        else:
            self.encoding_validator = None
Exemplo n.º 11
0
    def __init__(self, table_name, next, args, log):
        """Init per-batch table data cache."""

        BaseHandler.__init__(self, table_name, next, args, log)

        self.method = DEFAULT_METHOD

        self.pkey_list = None
        self.dist_fields = None
        self.col_list = None

        self.pkey_ev_map = {}

        for a in args:
            k, v = a.split('=')
            if k == 'method':
                m = int(v)
                if m not in (0,1,2):
                    raise Exception('unknown method: %s' % v)
                self.method = int(v)
            else:
                raise Exception('unknown argument: %s' % a)

        self.log.debug('bulk_init(%s), method=%d' % (repr(args), self.method))
Exemplo n.º 12
0
 def __init__(self, name, next, args):
     BaseHandler.__init__(self, name, next, args)
     self.key = args[0]
Exemplo n.º 13
0
 def __init__(self, name, next, args):
     BaseHandler.__init__(self, name, next, args)
     self.key = args[0]