...
We propose to add a new configuration parameter default.dslstore.store.type
that impl.class
that defines the default store type implementation class used by the DSL accepting two values "rocksDB"
(default) and "in_memory"
.. Default to RocksDBStoreImplementation.class
Code Block |
---|
public class StreamsConfig { public static final String DEFAULT_DSLSTORE_STOREIMPLEMENTATION_TYPECLASS_CONFIG = "default.dslstore.storeimpl.typeclass"; private static final String DEFAULT_DSLSTORE_STOREIMPLEMENTATION_TYPECLASS_DOC = "TheStore defaultsupplier storeimplementation typeclass used by DSL operators."; public static final ROCKS_DB = "rocksDB"; public static final IN_MEMORY = "in_memory"; to use. Default is set as RocksDBStoreImplementation. It can be overwritten dynamically during streaming operation."; .define(DEFAULT_DSLSTORE_STOREIMPLEMENTATION_TYPECLASS_CONFIG, Type.STRINGCLASS, ROCKS_DB, in(ROCKS_DB, IN_MEMORYRocksDBStoreImplementation.class.getName(), Importance.LOWMEDIUM, DEFAULT_DSLSTORE_STOREIMPLEMENTATION_TYPE_DOC) } |
In addition, we propose to extend Materialized
config object with a corresponding option to specify the store type:
Code Block |
---|
public class Materialized<K, V, S extends StateStore> {
public enum StoreType {
ROCKS_DB,
IN_MEMORY
}
public static <K, V, S extends StateStore> Materialized<K, V, S> as(StoryType storeType);
public Materialized<K, V, S> withStoreType(StoryType storeType);
} |
Finally, we propose to deprecate the StreamsBuilder#build()
method.
Code Block |
---|
public class StreamsBuilder { @Deprecate public synchronized Topology build(); CLASS_DOC) } |
Proposed Changes
In order to leverage the new configuration, users will need to call StreamsBuilder#build(Properties)
instead of StreamsBuilder#build()
. This is an already established pattern that users need to follow to enable topology optimization. As we predict that we might need to access the config in the DSL more often in the future, we also propose to deprecate StreamsBuilder#build()
method to lift the mental burden for users to know which of both methods that should use.
...
Regular unit and integration testing is sufficient.
Rejected Alternatives
...
1. Use enum
toset the default store type
We propose to add a new configuration parameter default.dsl.store.type
that defines the default store type used by the DSL accepting two values "rocksDB"
(default) and "in_memory"
.
Code Block |
---|
public class StreamsConfig {
public static final String DEFAULT_DSL_STORE_TYPE_CONFIG = "default.dsl.store.type";
private static final String DEFAULT_DSL_STORE_TYPE_DOC = "The default store type used by DSL operators.";
public static final ROCKS_DB = "rocksDB";
public static final IN_MEMORY = "in_memory";
.define(DEFAULT_DSL_STORE_TYPE_CONFIG,
Type.STRING,
ROCKS_DB,
in(ROCKS_DB, IN_MEMORY),
Importance.LOW,
DEFAULT_DSL_STORE_TYPE_DOC)
} |
In addition, we propose to extend Materialized
config object with a corresponding option to specify the store type:
Code Block |
---|
public class Materialized<K, V, S extends StateStore> {
public enum StoreType {
ROCKS_DB,
IN_MEMORY
}
public static <K, V, S extends StateStore> Materialized<K, V, S> as(StoryType storeType);
public Materialized<K, V, S> withStoreType(StoryType storeType);
} |
Finally, we propose to deprecate the StreamsBuilder#build()
method.
Code Block |
---|
public class StreamsBuilder {
@Deprecate
public synchronized Topology build();
} |