Skip to content

Instantly share code, notes, and snippets.

@KKcorps
Created September 18, 2019 14:10
Show Gist options
  • Save KKcorps/dbd9f333528a09c336d08a2c0031b5d5 to your computer and use it in GitHub Desktop.
Save KKcorps/dbd9f333528a09c336d08a2c0031b5d5 to your computer and use it in GitHub Desktop.
class ConfigBootstrapper extends KeyedStateBootstrapFunction<String, TestConfig> {
ValueState<Integer> threshold;
@Override
public void open(Configuration parameters) throws Exception {
threshold = getRuntimeContext().getState(new ValueStateDescriptor<Integer>("thresholdState", Integer.class));
}
@Override
public void processElement(TestConfig testConfig, Context context) throws Exception {
threshold.update(testConfig.getThresholdValue());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment