示例#1
0
class ETLDisFromRawAfterCheck(ETLDisFromRaw):
    '''
        检查解析表和量化表数据一致性,

        这个是粗略处理: 解析表中有的,如果量化表没有,重新解析量化
    '''

    def __init__(self, channel, q):
        ETLDisFromRaw.__init__(self, channel, q)
        self.cv_measure_store = CVRawStore(channel, 'measure')

    def real_dispatcher(self, from_which):
        index = 0
        for item in self.cv_raw_store.get_all():
            index += 1
            if not self.cv_measure_store.find_one({'cvId':item['cvId']}):
                self.queue.put(item)

            if index % 10000 == 0:
                print "copied %d items" % index