def instantiate(self, queue, pair_id, conf, last_checkpoint=''): """Instantiate a reader or writer""" rwtype = rwtypes.get_type(conf['type']) exec('import %s' % rwtype['module']) exec('clazz = %s.%s' % (rwtype['module'], rwtype['class'])) return clazz(queue, conf, last_checkpoint=last_checkpoint, thread_name='%s-%s' % (rwtype['class'], pair_id))
def has_known_type(conf): if get_type(conf['type']) == None: raise ConfigurationError("Type '%s' is unknown. Check your conf.yaml." % conf['type'])