igalshilman commented on a change in pull request #27: [FLINK-16149][core] Set
configurations using StreamExecutionEnvironment#getConfiguration
URL: https://github.com/apache/flink-statefun/pull/27#discussion_r381955581
##########
File path:
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/StatefulFunctionsJob.java
##########
@@ -82,14 +85,37 @@ private static void setDefaultContextClassLoaderIfAbsent()
{
}
}
- private static void setDefaultProviderIfAbsent(
- Configuration configuration, StatefulFunctionsUniverseProvider provider)
{
- if (!configuration.contains(
-
StatefulFunctionsJobConstants.STATEFUL_FUNCTIONS_UNIVERSE_INITIALIZER_CLASS_BYTES))
{
- ConfigurationUtil.storeSerializedInstance(
- configuration,
-
StatefulFunctionsJobConstants.STATEFUL_FUNCTIONS_UNIVERSE_INITIALIZER_CLASS_BYTES,
- provider);
+ /**
+ * Finds the location of the flink-conf. The fallback keys are required to
find the configuration
+ * in non-image based deployments; (i.e., anything using the flink cli).
+ *
+ * <p>Taken from org.apache.flink.client.cli.CliFrontend
+ */
+ private static String getConfigurationDirectoryFromEnv() {
+ String location = System.getenv(ConfigConstants.ENV_FLINK_CONF_DIR);
+
+ if (location != null) {
+ if (new File(location).exists()) {
+ return location;
+ } else {
+ throw new RuntimeException(
+ "The configuration directory '"
+ + location
+ + "', specified in the '"
+ + ConfigConstants.ENV_FLINK_CONF_DIR
+ + "' environment variable, does not exist.");
+ }
+ } else if (new File(CONFIG_DIRECTORY_FALLBACK_1).exists()) {
Review comment:
I think that it would be better if you'll add here a log message, that says
which configuration value was selected,
which fallback or environment.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services