Search in sources :

Example 6 with CompactionState

use of org.apache.tephra.hbase.txprune.CompactionState in project cdap by caskdata.

the class HBaseQueueRegionObserver method initializePruneState.

private void initializePruneState(RegionCoprocessorEnvironment env) {
    CConfiguration conf = configCache.getCConf();
    if (conf != null) {
        pruneEnable = conf.getBoolean(TxConstants.TransactionPruning.PRUNE_ENABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_ENABLE);
        if (Boolean.TRUE.equals(pruneEnable)) {
            String pruneTable = conf.get(TxConstants.TransactionPruning.PRUNE_STATE_TABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_STATE_TABLE);
            long pruneFlushInterval = TimeUnit.SECONDS.toMillis(conf.getLong(TxConstants.TransactionPruning.PRUNE_FLUSH_INTERVAL, TxConstants.TransactionPruning.DEFAULT_PRUNE_FLUSH_INTERVAL));
            compactionState = new CompactionState(env, TableName.valueOf(pruneTable), pruneFlushInterval);
            if (LOG.isDebugEnabled()) {
                TableName tableName = env.getRegion().getRegionInfo().getTable();
                LOG.debug(String.format("Automatic invalid list pruning is enabled for table %s:%s. Compaction state " + "will be recorded in table %s", tableName.getNamespaceAsString(), tableName.getNameAsString(), pruneTable));
            }
        }
    }
}
Also used : TableName(org.apache.hadoop.hbase.TableName) CompactionState(org.apache.tephra.hbase.txprune.CompactionState) CConfiguration(co.cask.cdap.common.conf.CConfiguration)

Example 7 with CompactionState

use of org.apache.tephra.hbase.txprune.CompactionState in project cdap by caskdata.

the class HBaseQueueRegionObserver method initializePruneState.

private void initializePruneState(RegionCoprocessorEnvironment env) {
    CConfiguration conf = configCache.getCConf();
    if (conf != null) {
        pruneEnable = conf.getBoolean(TxConstants.TransactionPruning.PRUNE_ENABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_ENABLE);
        if (Boolean.TRUE.equals(pruneEnable)) {
            String pruneTable = conf.get(TxConstants.TransactionPruning.PRUNE_STATE_TABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_STATE_TABLE);
            long pruneFlushInterval = TimeUnit.SECONDS.toMillis(conf.getLong(TxConstants.TransactionPruning.PRUNE_FLUSH_INTERVAL, TxConstants.TransactionPruning.DEFAULT_PRUNE_FLUSH_INTERVAL));
            compactionState = new CompactionState(env, TableName.valueOf(pruneTable), pruneFlushInterval);
            if (LOG.isDebugEnabled()) {
                TableName tableName = env.getRegion().getRegionInfo().getTable();
                LOG.debug(String.format("Automatic invalid list pruning is enabled for table %s:%s. Compaction state " + "will be recorded in table %s", tableName.getNamespaceAsString(), tableName.getNameAsString(), pruneTable));
            }
        }
    }
}
Also used : TableName(org.apache.hadoop.hbase.TableName) CompactionState(org.apache.tephra.hbase.txprune.CompactionState) CConfiguration(co.cask.cdap.common.conf.CConfiguration)

Example 8 with CompactionState

use of org.apache.tephra.hbase.txprune.CompactionState in project cdap by caskdata.

the class MessageTableRegionObserver method initializePruneState.

private void initializePruneState(RegionCoprocessorEnvironment env) {
    CConfiguration conf = topicMetadataCache.getCConfiguration();
    if (conf != null) {
        pruneEnable = conf.getBoolean(TxConstants.TransactionPruning.PRUNE_ENABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_ENABLE);
        if (Boolean.TRUE.equals(pruneEnable)) {
            String pruneTable = conf.get(TxConstants.TransactionPruning.PRUNE_STATE_TABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_STATE_TABLE);
            long pruneFlushInterval = TimeUnit.SECONDS.toMillis(conf.getLong(TxConstants.TransactionPruning.PRUNE_FLUSH_INTERVAL, TxConstants.TransactionPruning.DEFAULT_PRUNE_FLUSH_INTERVAL));
            compactionState = new CompactionState(env, TableName.valueOf(pruneTable), pruneFlushInterval);
            if (LOG.isDebugEnabled()) {
                LOG.debug(String.format("Automatic invalid list pruning is enabled for table %s. Compaction state " + "will be recorded in table %s", env.getRegionInfo().getTable().getNameWithNamespaceInclAsString(), pruneTable));
            }
        }
    }
}
Also used : CompactionState(org.apache.tephra.hbase.txprune.CompactionState) CConfiguration(co.cask.cdap.common.conf.CConfiguration)

Example 9 with CompactionState

use of org.apache.tephra.hbase.txprune.CompactionState in project cdap by caskdata.

the class HBaseQueueRegionObserver method initializePruneState.

private void initializePruneState(RegionCoprocessorEnvironment env) {
    CConfiguration conf = configCache.getCConf();
    if (conf != null) {
        pruneEnable = conf.getBoolean(TxConstants.TransactionPruning.PRUNE_ENABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_ENABLE);
        if (Boolean.TRUE.equals(pruneEnable)) {
            String pruneTable = conf.get(TxConstants.TransactionPruning.PRUNE_STATE_TABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_STATE_TABLE);
            long pruneFlushInterval = TimeUnit.SECONDS.toMillis(conf.getLong(TxConstants.TransactionPruning.PRUNE_FLUSH_INTERVAL, TxConstants.TransactionPruning.DEFAULT_PRUNE_FLUSH_INTERVAL));
            compactionState = new CompactionState(env, TableName.valueOf(pruneTable), pruneFlushInterval);
            if (LOG.isDebugEnabled()) {
                LOG.debug(String.format("Automatic invalid list pruning is enabled for table %s. Compaction state " + "will be recorded in table %s", env.getRegionInfo().getTable().getNameWithNamespaceInclAsString(), pruneTable));
            }
        }
    }
}
Also used : CompactionState(org.apache.tephra.hbase.txprune.CompactionState) CConfiguration(co.cask.cdap.common.conf.CConfiguration)

Example 10 with CompactionState

use of org.apache.tephra.hbase.txprune.CompactionState in project cdap by caskdata.

the class MessageTableRegionObserver method initializePruneState.

private void initializePruneState(RegionCoprocessorEnvironment env) {
    CConfiguration conf = topicMetadataCache.getCConfiguration();
    if (conf != null) {
        pruneEnable = conf.getBoolean(TxConstants.TransactionPruning.PRUNE_ENABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_ENABLE);
        if (Boolean.TRUE.equals(pruneEnable)) {
            String pruneTable = conf.get(TxConstants.TransactionPruning.PRUNE_STATE_TABLE, TxConstants.TransactionPruning.DEFAULT_PRUNE_STATE_TABLE);
            long pruneFlushInterval = TimeUnit.SECONDS.toMillis(conf.getLong(TxConstants.TransactionPruning.PRUNE_FLUSH_INTERVAL, TxConstants.TransactionPruning.DEFAULT_PRUNE_FLUSH_INTERVAL));
            compactionState = new CompactionState(env, TableName.valueOf(pruneTable), pruneFlushInterval);
            if (LOG.isDebugEnabled()) {
                TableName tableName = env.getRegion().getRegionInfo().getTable();
                LOG.debug(String.format("Automatic invalid list pruning is enabled for table %s:%s. Compaction state " + "will be recorded in table %s", tableName.getNamespaceAsString(), tableName.getNameAsString(), pruneTable));
            }
        }
    }
}
Also used : TableName(org.apache.hadoop.hbase.TableName) CompactionState(org.apache.tephra.hbase.txprune.CompactionState) CConfiguration(co.cask.cdap.common.conf.CConfiguration)

Aggregations

CConfiguration (co.cask.cdap.common.conf.CConfiguration)14 CompactionState (org.apache.tephra.hbase.txprune.CompactionState)14 TableName (org.apache.hadoop.hbase.TableName)8