def get_jids():
    '''
    Return a list of all job ids
    '''
    query = '''SELECT jid, load FROM {keyspace}.jids;'''.format(keyspace=_get_keyspace())

    ret = {}

    # cassandra_cql.cql_query may raise a CommandExecutionError
    try:
        data = __salt__['cassandra_cql.cql_query'](query)
        if data:
            for row in data:
                jid = row.get('jid')
                load = row.get('load')
                if jid and load:
                    ret[jid] = salt.utils.jid.format_jid_instance(
                        jid,
                        salt.utils.json.loads(load))
    except CommandExecutionError:
        log.critical('Could not get a list of all job ids.')
        raise
    except Exception as e:
        log.critical(
            'Unexpected error while getting list of all job ids: %s', e)
        raise

    return ret