Search in sources :

Example 1 with Statistics

use of org.rocksdb.Statistics in project kafka by apache.

the class RocksDBStore method maybeSetUpStatistics.

private void maybeSetUpStatistics(final Map<String, Object> configs) {
    if (userSpecifiedOptions.statistics() != null) {
        userSpecifiedStatistics = true;
    }
    if (!userSpecifiedStatistics && RecordingLevel.forName((String) configs.get(METRICS_RECORDING_LEVEL_CONFIG)) == RecordingLevel.DEBUG) {
        // metrics recorder will clean up statistics object
        final Statistics statistics = new Statistics();
        userSpecifiedOptions.setStatistics(statistics);
    }
}
Also used : Statistics(org.rocksdb.Statistics)

Example 2 with Statistics

use of org.rocksdb.Statistics in project kafka by apache.

the class RocksDBStore method addValueProvidersToMetricsRecorder.

private void addValueProvidersToMetricsRecorder() {
    final TableFormatConfig tableFormatConfig = userSpecifiedOptions.tableFormatConfig();
    final Statistics statistics = userSpecifiedStatistics ? null : userSpecifiedOptions.statistics();
    if (tableFormatConfig instanceof BlockBasedTableConfigWithAccessibleCache) {
        final Cache cache = ((BlockBasedTableConfigWithAccessibleCache) tableFormatConfig).blockCache();
        metricsRecorder.addValueProviders(name, db, cache, statistics);
    } else if (tableFormatConfig instanceof BlockBasedTableConfig) {
        throw new ProcessorStateException("The used block-based table format configuration does not expose the " + "block cache. Use the BlockBasedTableConfig instance provided by Options#tableFormatConfig() to configure " + "the block-based table format of RocksDB. Do not provide a new instance of BlockBasedTableConfig to " + "the RocksDB options.");
    } else {
        metricsRecorder.addValueProviders(name, db, null, statistics);
    }
}
Also used : TableFormatConfig(org.rocksdb.TableFormatConfig) BlockBasedTableConfig(org.rocksdb.BlockBasedTableConfig) Statistics(org.rocksdb.Statistics) ProcessorStateException(org.apache.kafka.streams.errors.ProcessorStateException) LRUCache(org.rocksdb.LRUCache) Cache(org.rocksdb.Cache)

Aggregations

Statistics (org.rocksdb.Statistics)2 ProcessorStateException (org.apache.kafka.streams.errors.ProcessorStateException)1 BlockBasedTableConfig (org.rocksdb.BlockBasedTableConfig)1 Cache (org.rocksdb.Cache)1 LRUCache (org.rocksdb.LRUCache)1 TableFormatConfig (org.rocksdb.TableFormatConfig)1