use of com.emc.storageos.db.client.impl.GlobalLockType in project coprhd-controller by CoprHD.
the class DataObjectScanner method processClass.
/**
* Processes data object or time series class and extracts CF
* requirements
*
* @param clazz data object or time series class
*/
@SuppressWarnings("unchecked")
@Override
protected void processClass(Class clazz) {
if (DataObject.class.isAssignableFrom(clazz)) {
if (!isDualDbSvcMode()) {
addToTypeMap(clazz, _cfMap);
} else if (KeyspaceUtil.isLocal(clazz)) {
addToTypeMap(clazz, _cfMap);
} else if (KeyspaceUtil.isGlobal(clazz)) {
addToTypeMap(clazz, _geocfMap);
} else {
addToTypeMap(clazz, _geocfMap);
addToTypeMap(clazz, _cfMap);
}
} else if (TimeSeries.class.isAssignableFrom(clazz)) {
TimeSeriesType tsType = TypeMap.getTimeSeriesType(clazz);
ColumnFamily cf = tsType.getCf();
_cfMap.put(cf.getName(), cf);
if (tsType.getCompactOptimized() && _dbCommonInfo != null && Boolean.TRUE.toString().equalsIgnoreCase(_dbCommonInfo.getProperty(DbClientImpl.DB_STAT_OPTIMIZE_DISK_SPACE, "false"))) {
// modify TTL for Compaction Enable Series types
int min_ttl = Integer.parseInt(_dbCommonInfo.getProperty(DbClientImpl.DB_LOG_MINIMAL_TTL, "604800"));
if (min_ttl < tsType.getTtl()) {
_log.info("Setting TTL for the CF {} equal to {}", cf.getName(), min_ttl);
tsType.setTtl(min_ttl);
}
}
} else if (SchemaRecord.class.isAssignableFrom(clazz)) {
SchemaRecordType srType = TypeMap.getSchemaRecordType();
ColumnFamily cf = srType.getCf();
_cfMap.put(cf.getName(), cf);
} else if (GlobalLock.class.isAssignableFrom(clazz)) {
GlobalLockType glType = TypeMap.getGlobalLockType();
ColumnFamily cf = glType.getCf();
_geocfMap.put(cf.getName(), cf);
} else {
throw new IllegalStateException("Failed to process Class " + clazz.getName());
}
}
Aggregations