Package org.apache.flink.state.forst
Class ForStNativeMetricOptions
- java.lang.Object
-
- org.apache.flink.state.forst.ForStNativeMetricOptions
-
- All Implemented Interfaces:
Serializable
@Experimental public class ForStNativeMetricOptions extends Object implements Serializable
Enable which ForSt metrics to forward to Flink's metrics reporter.Property based metrics would report at the column family level and return unsigned long values.
Statistics based metrics would report at the database level, it can return ticker or histogram kind results.
Properties and doc comments are taken from RocksDB documentation. See db.h for more information.
- See Also:
- Serialized Form
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ForStNativeMetricOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableActualDelayedWriteRate()
Returns the current actual delayed write rate. 0 means no delay.void
enableBackgroundErrors()
Returns accumulated number of background errors.void
enableBlockCacheCapacity()
Returns block cache capacity.void
enableBlockCachePinnedUsage()
Returns the memory size for the entries being pinned in block cache.void
enableBlockCacheUsage()
Returns the memory size for the entries residing in block cache.void
enableCompactionPending()
Returns 1 if at least one compaction is pending; otherwise, returns 0.void
enableCurSizeActiveMemTable()
Returns approximate size of active memtable (bytes).void
enableCurSizeAllMemTables()
Returns approximate size of active and unflushed immutable memtables (bytes).void
enableEstimateLiveDataSize()
Returns an estimate of the amount of live data in bytes.void
enableEstimateNumKeys()
Returns estimated number of total keys in the active and unflushed immutable memtables and storage.void
enableEstimatePendingCompactionBytes()
Returns estimated total number of bytes compaction needs to rewrite to get all levels down to under target size.void
enableEstimateTableReadersMem()
Returns estimated memory used for reading SST tables, excluding memory used in block cache (e.g.void
enableIsWriteStopped()
Returns 1 if write has been stopped.void
enableLiveSstFilesSize()
void
enableMemTableFlushPending()
Returns 1 if a memtable flush is pending; otherwise, returns 0.void
enableNativeStatistics(ConfigOption<Boolean> nativeStatisticsOption)
void
enableNumDeletesActiveMemTable()
Returns total number of delete entries in the active memtable.void
enableNumDeletesImmMemTables()
Returns total number of delete entries in the unflushed immutable memtables.void
enableNumEntriesActiveMemTable()
Returns total number of entries in the active memtable.void
enableNumEntriesImmMemTables()
Returns total number of entries in the unflushed immutable memtables.void
enableNumFilesAtLevel()
Returns the number of files per level.void
enableNumImmutableMemTable()
Returns number of immutable memtables that have not yet been flushed.void
enableNumLiveVersions()
Returns number of live versions.void
enableNumRunningCompactions()
Returns the number of currently running compactions.void
enableNumRunningFlushes()
Returns the number of currently running flushes.void
enableNumSnapshots()
Returns number of unreleased snapshots of the database.void
enableSizeAllMemTables()
Returns approximate size of active, unflushed immutable, and pinned immutable memtables (bytes).void
enableTotalSstFilesSize()
Returns total size (bytes) of all SST files.static ForStNativeMetricOptions
fromConfig(ReadableConfig config)
Creates aForStNativeMetricOptions
based on an external configuration.Collection<org.forstdb.TickerType>
getMonitorTickerTypes()
Collection<ForStProperty>
getProperties()
boolean
isColumnFamilyAsVariable()
{ForStNativeMetricMonitor
} Whether to expose the column family as a variable..boolean
isEnabled()
{ForStNativeMetricMonitor
} is enabled if any property or ticker type is set.boolean
isStatisticsEnabled()
void
setColumnFamilyAsVariable(boolean columnFamilyAsVariable)
Returns the column family as variable.
-
-
-
Field Detail
-
METRICS_COLUMN_FAMILY_AS_VARIABLE_KEY
public static final String METRICS_COLUMN_FAMILY_AS_VARIABLE_KEY
- See Also:
- Constant Field Values
-
MONITOR_NUM_IMMUTABLE_MEM_TABLES
public static final ConfigOption<Boolean> MONITOR_NUM_IMMUTABLE_MEM_TABLES
-
MONITOR_MEM_TABLE_FLUSH_PENDING
public static final ConfigOption<Boolean> MONITOR_MEM_TABLE_FLUSH_PENDING
-
TRACK_COMPACTION_PENDING
public static final ConfigOption<Boolean> TRACK_COMPACTION_PENDING
-
MONITOR_BACKGROUND_ERRORS
public static final ConfigOption<Boolean> MONITOR_BACKGROUND_ERRORS
-
MONITOR_CUR_SIZE_ACTIVE_MEM_TABLE
public static final ConfigOption<Boolean> MONITOR_CUR_SIZE_ACTIVE_MEM_TABLE
-
MONITOR_CUR_SIZE_ALL_MEM_TABLE
public static final ConfigOption<Boolean> MONITOR_CUR_SIZE_ALL_MEM_TABLE
-
MONITOR_SIZE_ALL_MEM_TABLES
public static final ConfigOption<Boolean> MONITOR_SIZE_ALL_MEM_TABLES
-
MONITOR_NUM_ENTRIES_ACTIVE_MEM_TABLE
public static final ConfigOption<Boolean> MONITOR_NUM_ENTRIES_ACTIVE_MEM_TABLE
-
MONITOR_NUM_ENTRIES_IMM_MEM_TABLES
public static final ConfigOption<Boolean> MONITOR_NUM_ENTRIES_IMM_MEM_TABLES
-
MONITOR_NUM_DELETES_ACTIVE_MEM_TABLE
public static final ConfigOption<Boolean> MONITOR_NUM_DELETES_ACTIVE_MEM_TABLE
-
MONITOR_NUM_DELETES_IMM_MEM_TABLE
public static final ConfigOption<Boolean> MONITOR_NUM_DELETES_IMM_MEM_TABLE
-
ESTIMATE_NUM_KEYS
public static final ConfigOption<Boolean> ESTIMATE_NUM_KEYS
-
ESTIMATE_TABLE_READERS_MEM
public static final ConfigOption<Boolean> ESTIMATE_TABLE_READERS_MEM
-
MONITOR_NUM_SNAPSHOTS
public static final ConfigOption<Boolean> MONITOR_NUM_SNAPSHOTS
-
MONITOR_NUM_LIVE_VERSIONS
public static final ConfigOption<Boolean> MONITOR_NUM_LIVE_VERSIONS
-
ESTIMATE_LIVE_DATA_SIZE
public static final ConfigOption<Boolean> ESTIMATE_LIVE_DATA_SIZE
-
MONITOR_TOTAL_SST_FILES_SIZE
public static final ConfigOption<Boolean> MONITOR_TOTAL_SST_FILES_SIZE
-
MONITOR_LIVE_SST_FILES_SIZE
public static final ConfigOption<Boolean> MONITOR_LIVE_SST_FILES_SIZE
-
ESTIMATE_PENDING_COMPACTION_BYTES
public static final ConfigOption<Boolean> ESTIMATE_PENDING_COMPACTION_BYTES
-
MONITOR_NUM_RUNNING_COMPACTIONS
public static final ConfigOption<Boolean> MONITOR_NUM_RUNNING_COMPACTIONS
-
MONITOR_NUM_RUNNING_FLUSHES
public static final ConfigOption<Boolean> MONITOR_NUM_RUNNING_FLUSHES
-
MONITOR_ACTUAL_DELAYED_WRITE_RATE
public static final ConfigOption<Boolean> MONITOR_ACTUAL_DELAYED_WRITE_RATE
-
IS_WRITE_STOPPED
public static final ConfigOption<Boolean> IS_WRITE_STOPPED
-
BLOCK_CACHE_CAPACITY
public static final ConfigOption<Boolean> BLOCK_CACHE_CAPACITY
-
BLOCK_CACHE_USAGE
public static final ConfigOption<Boolean> BLOCK_CACHE_USAGE
-
BLOCK_CACHE_PINNED_USAGE
public static final ConfigOption<Boolean> BLOCK_CACHE_PINNED_USAGE
-
COLUMN_FAMILY_AS_VARIABLE
public static final ConfigOption<Boolean> COLUMN_FAMILY_AS_VARIABLE
-
MONITOR_NUM_FILES_AT_LEVEL
public static final ConfigOption<Boolean> MONITOR_NUM_FILES_AT_LEVEL
-
MONITOR_BLOCK_CACHE_HIT
public static final ConfigOption<Boolean> MONITOR_BLOCK_CACHE_HIT
-
MONITOR_BLOCK_CACHE_MISS
public static final ConfigOption<Boolean> MONITOR_BLOCK_CACHE_MISS
-
MONITOR_BLOOM_FILTER_USEFUL
public static final ConfigOption<Boolean> MONITOR_BLOOM_FILTER_USEFUL
-
MONITOR_BLOOM_FILTER_FULL_POSITIVE
public static final ConfigOption<Boolean> MONITOR_BLOOM_FILTER_FULL_POSITIVE
-
MONITOR_BLOOM_FILTER_FULL_TRUE_POSITIVE
public static final ConfigOption<Boolean> MONITOR_BLOOM_FILTER_FULL_TRUE_POSITIVE
-
MONITOR_BYTES_READ
public static final ConfigOption<Boolean> MONITOR_BYTES_READ
-
MONITOR_ITER_BYTES_READ
public static final ConfigOption<Boolean> MONITOR_ITER_BYTES_READ
-
MONITOR_BYTES_WRITTEN
public static final ConfigOption<Boolean> MONITOR_BYTES_WRITTEN
-
MONITOR_COMPACTION_READ_BYTES
public static final ConfigOption<Boolean> MONITOR_COMPACTION_READ_BYTES
-
MONITOR_COMPACTION_WRITE_BYTES
public static final ConfigOption<Boolean> MONITOR_COMPACTION_WRITE_BYTES
-
MONITOR_STALL_MICROS
public static final ConfigOption<Boolean> MONITOR_STALL_MICROS
-
-
Method Detail
-
fromConfig
public static ForStNativeMetricOptions fromConfig(ReadableConfig config)
Creates aForStNativeMetricOptions
based on an external configuration.
-
enableNativeStatistics
@VisibleForTesting public void enableNativeStatistics(ConfigOption<Boolean> nativeStatisticsOption)
-
enableNumImmutableMemTable
public void enableNumImmutableMemTable()
Returns number of immutable memtables that have not yet been flushed.
-
enableMemTableFlushPending
public void enableMemTableFlushPending()
Returns 1 if a memtable flush is pending; otherwise, returns 0.
-
enableCompactionPending
public void enableCompactionPending()
Returns 1 if at least one compaction is pending; otherwise, returns 0.
-
enableBackgroundErrors
public void enableBackgroundErrors()
Returns accumulated number of background errors.
-
enableCurSizeActiveMemTable
public void enableCurSizeActiveMemTable()
Returns approximate size of active memtable (bytes).
-
enableCurSizeAllMemTables
public void enableCurSizeAllMemTables()
Returns approximate size of active and unflushed immutable memtables (bytes).
-
enableSizeAllMemTables
public void enableSizeAllMemTables()
Returns approximate size of active, unflushed immutable, and pinned immutable memtables (bytes).
-
enableNumEntriesActiveMemTable
public void enableNumEntriesActiveMemTable()
Returns total number of entries in the active memtable.
-
enableNumEntriesImmMemTables
public void enableNumEntriesImmMemTables()
Returns total number of entries in the unflushed immutable memtables.
-
enableNumDeletesActiveMemTable
public void enableNumDeletesActiveMemTable()
Returns total number of delete entries in the active memtable.
-
enableNumDeletesImmMemTables
public void enableNumDeletesImmMemTables()
Returns total number of delete entries in the unflushed immutable memtables.
-
enableEstimateNumKeys
public void enableEstimateNumKeys()
Returns estimated number of total keys in the active and unflushed immutable memtables and storage.
-
enableEstimateTableReadersMem
public void enableEstimateTableReadersMem()
Returns estimated memory used for reading SST tables, excluding memory used in block cache (e.g.,filter and index blocks).
-
enableNumSnapshots
public void enableNumSnapshots()
Returns number of unreleased snapshots of the database.
-
enableNumLiveVersions
public void enableNumLiveVersions()
Returns number of live versions. `Version` is an internal data structure. See version_set.h for details. More live versions often mean more SST files are held from being deleted, by iterators or unfinished compactions.
-
enableEstimateLiveDataSize
public void enableEstimateLiveDataSize()
Returns an estimate of the amount of live data in bytes.
-
enableTotalSstFilesSize
public void enableTotalSstFilesSize()
Returns total size (bytes) of all SST files. WARNING: may slow down online queries if there are too many files.
-
enableLiveSstFilesSize
public void enableLiveSstFilesSize()
-
enableEstimatePendingCompactionBytes
public void enableEstimatePendingCompactionBytes()
Returns estimated total number of bytes compaction needs to rewrite to get all levels down to under target size. Not valid for other compactions than level-based.
-
enableNumRunningCompactions
public void enableNumRunningCompactions()
Returns the number of currently running compactions.
-
enableNumRunningFlushes
public void enableNumRunningFlushes()
Returns the number of currently running flushes.
-
enableActualDelayedWriteRate
public void enableActualDelayedWriteRate()
Returns the current actual delayed write rate. 0 means no delay.
-
enableIsWriteStopped
public void enableIsWriteStopped()
Returns 1 if write has been stopped.
-
enableBlockCacheCapacity
public void enableBlockCacheCapacity()
Returns block cache capacity.
-
enableBlockCacheUsage
public void enableBlockCacheUsage()
Returns the memory size for the entries residing in block cache.
-
enableBlockCachePinnedUsage
public void enableBlockCachePinnedUsage()
Returns the memory size for the entries being pinned in block cache.
-
enableNumFilesAtLevel
public void enableNumFilesAtLevel()
Returns the number of files per level.
-
setColumnFamilyAsVariable
public void setColumnFamilyAsVariable(boolean columnFamilyAsVariable)
Returns the column family as variable.
-
getProperties
public Collection<ForStProperty> getProperties()
- Returns:
- the enabled RocksDB property-based metrics
-
getMonitorTickerTypes
public Collection<org.forstdb.TickerType> getMonitorTickerTypes()
- Returns:
- the enabled RocksDB statistics metrics.
-
isEnabled
public boolean isEnabled()
{ForStNativeMetricMonitor
} is enabled if any property or ticker type is set.- Returns:
- true if {{RocksDBNativeMetricMonitor}} should be enabled, false otherwise.
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Returns:
- true if RocksDB statistics metrics are enabled, false otherwise.
-
isColumnFamilyAsVariable
public boolean isColumnFamilyAsVariable()
{ForStNativeMetricMonitor
} Whether to expose the column family as a variable..- Returns:
- true is column family to expose variable, false otherwise.
-
-