Created
September 18, 2019 14:10
-
-
Save KKcorps/dbd9f333528a09c336d08a2c0031b5d5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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