Esempio n. 1
0
def load(catalog_name, update=False):
    """ Load all cubes into a database. """
    catalog = get_catalog(catalog_name)
    for cube_name in fetch_index(catalog):
        if exists_raw(catalog_name, cube_name):
            cube_data = load_cube_raw(catalog_name, cube_name)
            cube = Cube(cube_name, cube_data)
            log.info("Loading: %s (%s facts)", cube_name, len(cube.facts))
            load_cube(cube, update=update)
Esempio n. 2
0
def load(catalog_name, update=False):
    """ Load all cubes into a database. """
    catalog = get_catalog(catalog_name)
    for cube_name in fetch_index(catalog):
        if exists_raw(catalog_name, cube_name):
            cube_data = load_cube_raw(catalog_name, cube_name)
            cube = Cube(cube_name, cube_data)
            log.info("Loading: %s (%s facts)", cube_name, len(cube.facts))
            load_cube(cube, update=update)
Esempio n. 3
0
def fetch(catalog_name, update=False):
    """ Dump all cubes from a catalog. """
    catalog = get_catalog(catalog_name)
    for cube_name in fetch_index(catalog):
        if not exists_raw(catalog_name, cube_name) or update:
            log.info("Fetching: %s", cube_name)
            try:
                cube_data = fetch_cube(catalog, cube_name)
                if cube_data is None:
                    log.warn("Could not fetch: %s", cube_name)
                else:
                    store_cube_raw(catalog_name, cube_name, cube_data)
            except Exception as e:
                log.exception(e)
Esempio n. 4
0
def fetch(catalog_name, update=False):
    """ Dump all cubes from a catalog. """
    catalog = get_catalog(catalog_name)
    for cube_name in fetch_index(catalog):
        if not exists_raw(catalog_name, cube_name) or update:
            log.info("Fetching: %s", cube_name)
            try:
                cube_data = fetch_cube(catalog, cube_name)
                if cube_data is None:
                    log.warn("Could not fetch: %s", cube_name)
                else:
                    store_cube_raw(catalog_name, cube_name, cube_data)
            except Exception, e:
                log.exception(e)