Search in sources :

Example 1 with AggregateDbIndex

use of com.emc.storageos.db.client.impl.AggregateDbIndex in project coprhd-controller by CoprHD.

the class AggregationIndexTimeUUIDMigration method removeTimeUUIDIndexedFields.

private void removeTimeUUIDIndexedFields(Class<? extends DataObject> clazz) throws Exception {
    DataObjectType doType = TypeMap.getDoType(clazz);
    Collection<ColumnField> fields = doType.getColumnFields();
    Map<String, ColumnField> uuidFields = new HashMap<>();
    for (ColumnField field : fields) {
        DbIndex index = field.getIndex();
        if (index != null && index instanceof AggregateDbIndex) {
            uuidFields.put(field.getName(), field);
        }
    }
    // true: ignore exception while accessing db
    getInternalDbClient().resetFields(clazz, uuidFields, true);
}
Also used : HashMap(java.util.HashMap) ColumnField(com.emc.storageos.db.client.impl.ColumnField) DataObjectType(com.emc.storageos.db.client.impl.DataObjectType) AggregateDbIndex(com.emc.storageos.db.client.impl.AggregateDbIndex) DbIndex(com.emc.storageos.db.client.impl.DbIndex) AggregateDbIndex(com.emc.storageos.db.client.impl.AggregateDbIndex)

Aggregations

AggregateDbIndex (com.emc.storageos.db.client.impl.AggregateDbIndex)1 ColumnField (com.emc.storageos.db.client.impl.ColumnField)1 DataObjectType (com.emc.storageos.db.client.impl.DataObjectType)1 DbIndex (com.emc.storageos.db.client.impl.DbIndex)1 HashMap (java.util.HashMap)1