/* RegionObserver implementation */
@Override
public void start(CoprocessorEnvironment e) throws IOException {
if (e instanceof RegionCoprocessorEnvironment) {
RegionCoprocessorEnvironment env = (RegionCoprocessorEnvironment) e;
Supplier<TransactionStateCache> cacheSupplier = getTransactionStateCacheSupplier(env);
this.cache = cacheSupplier.get();
HTableDescriptor tableDesc = env.getRegion().getTableDesc();
for (HColumnDescriptor columnDesc : tableDesc.getFamilies()) {
String columnTTL = columnDesc.getValue(TxConstants.PROPERTY_TTL);
long ttl = 0;
if (columnTTL != null) {
try {
ttl = Long.parseLong(columnTTL);
LOG.info("Family " + columnDesc.getNameAsString() + " has TTL of " + columnTTL);
} catch (NumberFormatException nfe) {
LOG.warn("Invalid TTL value configured for column family " + columnDesc.getNameAsString() +
", value = " + columnTTL);
}
}
ttlByFamily.put(columnDesc.getName(), ttl);
}
this.allowEmptyValues = env.getConfiguration().getBoolean(TxConstants.ALLOW_EMPTY_VALUES_KEY,
TxConstants.ALLOW_EMPTY_VALUES_DEFAULT);
}
}