def run_collector():
    LOG.info("Starting collector..")
    gevent.signal(signal.SIGQUIT, gevent.kill)
    redis_flush_keys()
    get_device_list()
    create_cluster_tables()
    create_daily_tables()
    try:
        tasks = [run_scheduler, run_store_ingestion, run_process_counters, run_request_parser, run_request_fetch]
        g_thread_pool = [gevent.spawn(task) for task in tasks]
        gevent.joinall(g_thread_pool)
    except KeyboardInterrupt:
        print "Keyboard interrupt.."
    finally:
        #pass
        gevent.killall(g_thread_pool, exception=gevent.GreenletExit)
def run_collector():
    LOG.info("Starting collector..")
    gevent.signal(signal.SIGQUIT, gevent.kill)
    redis_flush_keys()
    get_device_list()
    create_cluster_tables()
    create_daily_tables()
    try:
        tasks = [
            run_scheduler, run_store_ingestion, run_process_counters,
            run_request_parser, run_request_fetch
        ]
        g_thread_pool = [gevent.spawn(task) for task in tasks]
        gevent.joinall(g_thread_pool)
    except KeyboardInterrupt:
        print "Keyboard interrupt.."
    finally:
        #pass
        gevent.killall(g_thread_pool, exception=gevent.GreenletExit)
 def create_daily_cf_job():
     tomorrow = date.today() + timedelta(days=1)
     tomorrow_strf = tomorrow.strftime('%m%d%Y')
     LOG.info("Creating tables for date: " + tomorrow_strf)
     create_daily_tables(tomorrow_strf)
 def create_daily_cf_job():
     tomorrow = date.today()+timedelta(days=1)
     tomorrow_strf = tomorrow.strftime('%m%d%Y')
     LOG.info("Creating tables for date: " + tomorrow_strf)
     create_daily_tables(tomorrow_strf)