Ejemplo n.º 1
0
    def run(self):
        start_time = datetime.now()

        user_dim = UserDimension()
        user_dim.sync_all()

        project_dim = ProjectDimension()
        project_dim.sync_all()

        discussion_dim = DiscussionDimension()
        discussion_dim.sync_all()

        end_time = datetime.now()

        conf.log.info("SCD2 done, took %s" % str(end_time - start_time))
Ejemplo n.º 2
0
    def __init__(self):
        self.user_dim = UserDimension()
        self.event_dim = EventDimension()
        self.project_dim = ProjectDimension()
        self.discussion_dim = DiscussionDimension()
        self.date_dim = DateDimension()
        self.context_dim = ContextDimension()

        # Extracted data transformed to sql
        self.event_insert_clause = (
            "INSERT IGNORE INTO event_fact VALUES(%(date_sk)d, %(project_sk)d, "
            "%(user_sk)d, %(event_sk)d, %(discussion_sk)d, '%(timestamp)s', %(micros)d);"
        )
        self.request_insert_clause = (
            "INSERT IGNORE INTO request_fact VALUES(%(project_sk)d, %(date_sk)d, "
            "%(context_sk)d, %(user_sk)d, '%(timestamp)s', %(micros)d);")

        # Extract will write into these
        self.sql_rows = []

        # Progress info
        self.trans_fail_count = 0