Github user arunmahadevan commented on a diff in the pull request:
https://github.com/apache/storm/pull/2801#discussion_r209432875
--- Diff: storm-client/src/jvm/org/apache/storm/utils/ConfigUtils.java ---
@@ -52,6 +79,16 @@ public static ConfigUtils setInstance(ConfigUtils u) {
return oldInstance;
}
+ public static Map<String, Object> maskPasswords(final Map<String,
Object> conf) {
+ Maps.EntryTransformer<String, Object, Object> maskPasswords =
--- End diff --
The problem is that the map is traversed and copied even if we don't intend
to log the conf and I was trying to avoid it using the Guava transformer. It
may not be a major issue now since the conf is logged only once at the
beginning, but wanted to avoid any potential future misuse.
I could not figure out a way to do the same with java 8 Streams API. I have
refactored it to return a wrapped object which will be evaluated only when its
required to log. Please take a look and let me know if it makes sense or if
theres a better way.
---