Hi patricia,
```setPredefinedOptions ``` can still be found in EmbeddedRocksDBStateBackend
in Flink 2.0.
You can set the option programmatically via config:
config.set(
RocksDBOptions.PREDEFINED_OPTIONS,
PredefinedOptions.FLASH_SSD_OPTIMIZED.name());
Best,
Han Yin
> 2025年7月15日 13:14,patricia lee <[email protected]> 写道:
>
> Hi,
>
> We are migrating our Flink 1.20 to Flink 2.0.
> We have set the code in our project like this:
>
>
> RockDBStateBackend rockDb = new RockDBStateBackend(config.getPath() +
> "/myrockdbpath");
> rockdb.setPredefinedOptions(PredefinedOptions.FLASH_SSD_OPTIMIZED)
>
> We followed the new way in Flink 2.0 in this link:
> https://nightlies.apache.org/flink/flink-docs-release-2.0/docs/ops/state/state_backends/#rocksdbstatebackend
>
> But how can we set the PredefinedOptions.FLASH_SSD_OPTIMIZED
> programmatically? (not thru the file configuration)
>
> Configuration config = new Configuration();
> config.set(StateBackendOptions.STATE_BACKEND, "rocksdb");
> config.set(CheckpointingOptions.CHECKPOINT_STORAGE, "filesystem");
> config.set(CheckpointingOptions.CHECKPOINTS_DIRECTORY,
> "file:///checkpoint-dir");
> env.configure(config);
> Thanks,
>
>