Search in sources :

Example 1 with GlobalLockType

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());
    }
}
Also used : GlobalLock(com.emc.storageos.db.client.model.GlobalLock) GlobalLockType(com.emc.storageos.db.client.impl.GlobalLockType) TimeSeries(com.emc.storageos.db.client.model.TimeSeries) TimeSeriesType(com.emc.storageos.db.client.impl.TimeSeriesType) SchemaRecordType(com.emc.storageos.db.client.impl.SchemaRecordType) ColumnFamily(com.netflix.astyanax.model.ColumnFamily)

Aggregations

GlobalLockType (com.emc.storageos.db.client.impl.GlobalLockType)1 SchemaRecordType (com.emc.storageos.db.client.impl.SchemaRecordType)1 TimeSeriesType (com.emc.storageos.db.client.impl.TimeSeriesType)1 GlobalLock (com.emc.storageos.db.client.model.GlobalLock)1 TimeSeries (com.emc.storageos.db.client.model.TimeSeries)1 ColumnFamily (com.netflix.astyanax.model.ColumnFamily)1