示例#1
0
class BugFixDispatcher(ETLDispatcherBase):
    def __init__(self, channel, q):
        ETLDispatcherBase.__init__(self, channel, q)
        self.cv_raw_store = CVRawStore(self.channel, stage='raw')
        self.cv_measure_store = CVRawStore(self.channel, stage='measure')

    def real_dispatcher(self, from_where):

        i = 0
        total_cnt = self.cv_raw_store.count_all()

        for doc in self.cv_raw_store.get_all():
            del doc['_id']
            self.queue.put(doc)
            i += 1
            if i % 10000 == 0:
                Logger.printProgress(i, total_cnt)
def get_measure_count(channel):
    store = CVRawStore(channel, stage="measure")
    return store.count_all()