Rate This Document
Findability
Accuracy
Completeness
Readability

Configuration Items

The parameter configuration rules for the Log, StateStore, and Metric modules of OmniStateStore cover log management, state storage, and performance monitoring, providing guidance for deploying and tuning OmniStateStore on Flink.

Table 1, Table 2, and Table 3 describe the configuration items of the Log, StateStore, and Metric modules.

Table 1 Configuration items of the Log module

Configuration Item

Description

Default Value

Value Range

Remarks

state.backend.ockdb.jni.logfile

Log file path and name.

/usr/local/flink/log/kv.log

Files in the path on which the Flink run user has the read and write permissions (The path must exist.)

Check that the path exists and the Flink run user has the read and write permissions on the path.

state.backend.ockdb.jni.loglevel

Log level.

  • 1: DEBUG
  • 2: INFO
  • 3: WARN
  • 4: ERROR

2

[1, 4]

None

state.backend.ockdb.jni.lognum

Maximum number of log files.

20

[10, 50]

None

state.backend.ockdb.jni.logsize

Size of a single log file. Unit: MB.

20

[10, 50]

None

Table 2 Configuration items of the StateStore module

Configuration Item

Description

Default Value

Value Range

Remarks

state.backend

Open source Flink parameter, which is used to configure the state backend.

None

com.huawei.ock.bss.OckDBStateBackendFactory

Ensure that the case-sensitive characters are correctly spelled.

state.backend.ockdb.localdir

Local OmniStateStore data path.

None

An existing path for which the Flink run user has the read and write permissions.

  • Check that the path exists and the Flink run user has the read and write permissions on the path.
  • Check that the path and the taskmanager.state.local.root-dirs path are in the same file system.

taskmanager.state.local.root-dirs

Open-source Flink parameter, which is used to set the local checkpoint temporary directory.

None

An existing path for which the Flink run user has the read and write permissions.

  • You are recommended to set this configuration item. If you choose not to set this configuration item, the path specified by io.tmp.dirs is used by default.
  • Check that the path and the state.backend.ockdb.localdir path are in the same file system.

state.backend.ockdb.savepoint.sort.local.dir

Path for storing temporary sorting files generated during savepoint creation. This parameter is required for using savepoints.

/usr/local/flink/savepoint/tmp

An existing path for which the Flink run user has the read and write permissions.

Check that the path exists and the Flink run user has the read and write permissions on the path.

state.backend.ockdb.jni.slice.watermark.ratio

The cache layer triggers data eviction by setting the high and low watermark ratio thresholds. Cold data is migrated to the LSM file storage layer based on the preset policy to dynamically balance storage resources.

0.8

(0, 1)

Generally, you do not need to set it separately.

state.backend.ockdb.file.memory.fraction

Ratio of the memory cache space used for reading and writing data at the LSM layer to the maximum memory of the entire database instance.

0.2

[0.1, 0.5]

Generally, you do not need to set it separately.

state.backend.ockdb.jni.lsmstore.compaction.switch

Indicates whether to sort and merge data in the LSM file storage layer. The leveled compaction mechanism of the LSM file storage layer controls the sorting and compaction of data files to optimize storage performance and space utilization.

1

  • 0: disable
  • 1: enable

It is recommended that you enable this option.

state.backend.ockdb.ttl.filter.switch

Compresses time to live (TTL) expired data in the background.

false

  • false: disable
  • true: enable

You are advised to enable this function for TTL State.

state.backend.ockdb.lsmstore.compression.policy

Compression policy of each level in the LSM store. It is used with the default value of "state.backend.ockdb.lsmstore.compression.level.policy".

  • level0: Compression is disabled.
  • level1: Compression is disabled.
  • level2: LZ4 compression is enabled.
  • Other levels: Full compression is enabled.

lz4

  • none: Compression is disabled.
  • lz4: LZ4 compression is enabled.

If the checkpoint file to be uploaded is too large, you are advised to enable this function.

state.backend.ockdb.lsmstore.compression.level.policy

Configures the LSM file compression policy for different levels. The default value is none,none,lz4, which indicates that compression is disabled at level 0 and level 1 and LZ4 compression is enabled at level 2.

none,none,lz4

  • none: Compression is disabled.
  • lz4: LZ4 compression is enabled.

When checkpoints become a bottleneck, you can advance the compression policy to a lower level. The default level range is [0, 5].

  • level0 indicates foreground write compression. None is recommended.
  • Other levels indicate background compression.

state.backend.ockdb.lazy.download.switch

Indicates whether to enable lazy loading during recovery from a checkpoint.

false

  • false: disable
  • true: enable

When the checkpoint size is large, enable this option to shorten the time required for restoring a task to the running state.

state.backend.ockdb.bloom.filter.switch

Enables or disables the Bloom filter for status keys.

true

  • false: disable
  • true: enable

You are advised to enable this function in scenarios where a large number of invalid key accesses. When this function is enabled, the memory usage increases by dozens of megabytes.

state.backend.bloom.filter.expected.key.count

Order of magnitude of keys to be filtered by the Bloom filter in a single state.

8000000

[1000000, 10000000]

Generally, you do not need to set it separately. A larger value indicates that the Bloom filter occupies more memory.

state.backend.ockdb.cache.filter.and.index.switch

Enables or disables the use of the least recently used (LRU) cache for filter and index blocks at the LSM layer.

true

  • false: disable
  • true: enable

Generally, you do not need to set it separately. If there are a large number of files and different files are frequently read, you are advised to enable this function.

state.backend.ockdb.cache.filter.and.index.ratio

Ratio of the memory occupied by the filter and index blocks to the total memory. This memory is not subject to LRU-based eviction.

0

(0, 1)

Generally, you do not need to set it separately. You are advised to enable this function when the filter and index blocks are frequently released in the cache due to heavy pressure.

state.backend.ockdb.checkpoint.backup

Directory for storing local checkpoint backup slice files when local restoration is enabled.

None

Files in the path on which the Flink run user has the read and write permissions (The path must exist.)

Set this parameter when local restoration is enabled. Check that the path exists and the Flink run user has the read and write permissions on the path.

state.backend.ockdb.timer-service.factory

Location where the Flink timer is stored.

OCKDB

  • OCKDB: persistently stored in the state backend
  • HEAP: stored in the JVM heap memory

When the number of timers is small, the heap-based timer may have better performance.

state.backend.ockdb.kv-separate.switch

Enables or disables KV separation.

false

  • false: disable
  • true: enable

Enable KV separation if this value is large.

state.backend.ockdb.kv-separate.threshold

Threshold for enabling KV separation. Enable KV separation when this value is exceeded.

200

(8, 4294967295)

Values greater than this threshold are stored separately after KV separation.

Table 3 Configuration items of the Metric module

Configuration Item

Description

Default Value

Value Range

Remarks

state.backend.ockdb.metric.enable

Enables or disables the overall metric function. OmniStateStore collects metric information after this function is enabled.

false

  • false: disable
  • true: enable

The metric function of each module takes effect only after this option is enabled.

state.backend.ockdb.metric.memory

Enables or disables the metric function of the MemoryManager module.

false

  • false: disable
  • true: enable

None

state.backend.ockdb.metric.fresh.table

Enables or disables the metric function of the FreshTable module.

false

  • false: disable
  • true: enable

None

state.backend.ockdb.metric.slice.table

Enables or disables the metric function of the SliceTable module.

false

  • false: disable
  • true: enable

None

state.backend.ockdb.metric.lsm.store

Enables or disables the metric function of the LSM Store module.

false

  • false: disable
  • true: enable

None

state.backend.ockdb.metric.lsm.cache

Enables or disables the metric function of the LSM Cache module.

false

  • false: disable
  • true: enable

None

state.backend.ockdb.metric.snapshot

Enables or disables the metric function of the Snapshot module.

false

  • false: disable
  • true: enable

None

state.backend.ockdb.metric.restore

Enables or disables the metric function of the Restore module.

false

  • false: disable
  • true: enable

None