def walk(self, fn=None):
    type_to_object = {}
    for (obj_uuid, obj_col) in self._cassandra_driver.get_range(datastore_api.OBJ_UUID_CF_NAME, columns=['type', 'fq_name']):
        try:
            obj_type = json.loads(obj_col['type'])
            obj_fq_name = json.loads(obj_col['fq_name'])
            self.cache_uuid_to_fq_name_add(obj_uuid, obj_fq_name, obj_type)
            try:
                type_to_object[obj_type].append(obj_uuid)
            except KeyError:
                type_to_object[obj_type] = [obj_uuid]
        except Exception as e:
            self._logger(('Error in db walk read %s' % str(e)), level=SandeshLevel.SYS_ERR)
            continue
    if (fn is None):
        return []
    walk_results = []
    for (obj_type, uuid_list) in list(type_to_object.items()):
        try:
            self._logger(('DB walk: obj_type %s len %s' % (obj_type, len(uuid_list))), level=SandeshLevel.SYS_INFO)
            result = fn(obj_type, uuid_list)
            if result:
                walk_results.append(result)
        except Exception as e:
            self._logger(('Error in db walk invoke %s' % str(e)), level=SandeshLevel.SYS_ERR)
            continue
    return walk_results
def walk(self, fn=None):
    type_to_object = {}
    for (obj_uuid, obj_col) in self._cassandra_driver.get_range(datastore_api.OBJ_UUID_CF_NAME, columns=['type', 'fq_name']):
        try:
            obj_type = json.loads(obj_col['type'])
            obj_fq_name = json.loads(obj_col['fq_name'])
            self.cache_uuid_to_fq_name_add(obj_uuid, obj_fq_name, obj_type)
            try:
                type_to_object[obj_type].append(obj_uuid)
            except KeyError:
                type_to_object[obj_type] = [obj_uuid]
        except Exception as e:
            self._logger(('Error in db walk read %s' % str(e)), level=SandeshLevel.SYS_ERR)
            continue
    if (fn is None):
        return []
    walk_results = []
    for (obj_type, uuid_list) in list(type_to_object.items()):
        try:
            self._logger(('DB walk: obj_type %s len %s' % (obj_type, len(uuid_list))), level=SandeshLevel.SYS_INFO)
            result = fn(obj_type, uuid_list)
            if result:
                walk_results.append(result)
        except Exception as e:
            self._logger(('Error in db walk invoke %s' % str(e)), level=SandeshLevel.SYS_ERR)
            continue
    return walk_results