Skip to content

Commit

Permalink
[FLINK-16913] Migrate StateBackends to use ReadableConfig instead of …
Browse files Browse the repository at this point in the history
…Configuration

StateBackendFactories do not need a full read and write access to the
Configuration object. It's sufficient to have read only access. Moreover
the ReadableConfig is a lightweight interface that can be implemented in
other ways, not just through the Configuration. Lastly we exposed this
lightweight interface as a configuration entry point for
ExecutionEnvironments. This change will make it possible to pass the
ReadableConfig directly to the StateBackendFactories without fragile
adapters.
  • Loading branch information
dawidwys committed Apr 5, 2020
1 parent fc1df95 commit bb46756
Show file tree
Hide file tree
Showing 31 changed files with 126 additions and 453 deletions.
4 changes: 2 additions & 2 deletions docs/_includes/generated/rocks_db_configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
</tr>
<tr>
<td><h5>state.backend.rocksdb.timer-service.factory</h5></td>
<td style="word-wrap: break-word;">"ROCKSDB"</td>
<td>String</td>
<td style="word-wrap: break-word;">ROCKSDB</td>
<td><p>Enum</p>Possible values: [HEAP, ROCKSDB]</td>
<td>This determines the factory for timer service state implementation. Options are either HEAP (heap-based, default) or ROCKSDB for an implementation based on RocksDB .</td>
</tr>
</tbody>
Expand Down
4 changes: 2 additions & 2 deletions docs/_includes/generated/state_backend_rocksdb_section.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
</tr>
<tr>
<td><h5>state.backend.rocksdb.timer-service.factory</h5></td>
<td style="word-wrap: break-word;">"ROCKSDB"</td>
<td>String</td>
<td style="word-wrap: break-word;">ROCKSDB</td>
<td><p>Enum</p>Possible values: [HEAP, ROCKSDB]</td>
<td>This determines the factory for timer service state implementation. Options are either HEAP (heap-based, default) or ROCKSDB for an implementation based on RocksDB .</td>
</tr>
</tbody>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package org.apache.flink.runtime.state;

import org.apache.flink.annotation.Internal;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.IllegalConfigurationException;
import org.apache.flink.configuration.ReadableConfig;

/**
* An interface for state backends that pick up additional parameters from a configuration.
Expand All @@ -44,5 +44,5 @@ public interface ConfigurableStateBackend {
*
* @throws IllegalConfigurationException Thrown if the configuration contained invalid entries.
*/
StateBackend configure(Configuration config, ClassLoader classLoader) throws IllegalConfigurationException;
StateBackend configure(ReadableConfig config, ClassLoader classLoader) throws IllegalConfigurationException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
package org.apache.flink.runtime.state;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.configuration.IllegalConfigurationException;
import org.apache.flink.configuration.ReadableConfig;

import java.io.IOException;

Expand Down Expand Up @@ -48,5 +48,5 @@ public interface StateBackendFactory<T extends StateBackend> {
* @throws IOException
* If the state backend initialization failed due to an I/O exception
*/
T createFromConfig(Configuration config, ClassLoader classLoader) throws IllegalConfigurationException, IOException;
T createFromConfig(ReadableConfig config, ClassLoader classLoader) throws IllegalConfigurationException, IOException;
}
Loading

0 comments on commit bb46756

Please sign in to comment.