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_r381927045
 
 

 ##########
 File path: 
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/StatefulFunctionsConfig.java
 ##########
 @@ -0,0 +1,165 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.flink.statefun.flink.core;
+
+import static org.apache.flink.configuration.description.TextElement.code;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import org.apache.flink.configuration.ConfigOption;
+import org.apache.flink.configuration.ConfigOptions;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.description.Description;
+import org.apache.flink.statefun.flink.core.message.MessageFactoryType;
+import org.apache.flink.statefun.sdk.spi.StatefulFunctionModule;
+import org.apache.flink.util.InstantiationUtil;
+
+/** Configuration that captures all stateful function related settings. */
+@SuppressWarnings("WeakerAccess")
+public class StatefulFunctionsConfig implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  private static final String MODULE_CONFIG_PREFIX = "statefun.module.config.";
+
+  // This configuration option exists for the documentation generator
+  @SuppressWarnings("unused")
+  public static final ConfigOption<String> MODULE_GLOBAL_DEFAULT =
+      ConfigOptions.key(MODULE_CONFIG_PREFIX + "<KEY>")
+          .stringType()
+          .noDefaultValue()
+          .withDescription(
+              Description.builder()
+                  .text(
+                      "Adds the given key/value pair to the Stateful Functions 
global configuration.")
+                  .text(
+                      "These values will be available via the 
`globalConfigurations` parameter of StatefulFunctionModule#configure.")
+                  .linebreak()
+                  .text(
+                      "Only the key <KEY> and value are added to the 
configuration. If the key/value pairs")
+                  .list(
+                      code(MODULE_CONFIG_PREFIX + "key1: value1"),
+                      code(MODULE_CONFIG_PREFIX + "key2: value2"))
+                  .text("are set, then the map")
+                  .list(code("key1: value1"), code("key2: value2"))
+                  .text("will be made available to your module at runtime.")
+                  .build());
+
+  public static final ConfigOption<MessageFactoryType> USER_MESSAGE_SERIALIZER 
=
+      ConfigOptions.key("statefun.message.serializer")
 
 Review comment:
   I guess we don't need the `statefun` prefix now, since we have the 
`statefun.module.config.`
   
    

----------------------------------------------------------------
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

Reply via email to