Github user rmetzger commented on a diff in the pull request:
https://github.com/apache/flink/pull/1046#discussion_r38844529
--- Diff:
flink-contrib/flink-storm-compatibility/flink-storm-compatibility-core/src/main/java/org/apache/flink/stormcompatibility/wrappers/StormWrapperSetupHelper.java
---
@@ -107,4 +112,40 @@ public static TopologyContext
convertToTopologyContext(final StreamingRuntimeCon
return new FlinkTopologyContext(new StormTopology(spoutSpecs,
bolts, null), taskToComponents, taskId);
}
+ /**
+ * Get storm configuration from StreamingRuntimeContext.
+ *
+ * @param ctx
+ * The RuntimeContext of operator.
+ * @return The storm configuration map.
+ * @throws Exception
+ */
+ public static Map getStormConfFromContext(final RuntimeContext ctx)
+ throws Exception {
+ Map stormConf = null;
+ if (ctx instanceof StreamingRuntimeContext) {
+ Configuration jobConfiguration =
((StreamingRuntimeContext) ctx).getJobConfiguration();
+
+ if (jobConfiguration != null) {
+ /* topologies mode */
+ stormConf = (Map)
InstantiationUtil.readObjectFromConfig(jobConfiguration,
StormConfig.STORM_DEFAULT_CONFIG, Map.class.getClassLoader());
--- End diff --
Since the map is untyped, it might happen that users pass arbitrary
objects, containing classes from the user code into the Map.
This would lead to class not found exceptions when running the code on
clusters. Can you use the classloader of `StormWrapperSetupHelper´ ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---