You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/07/29 22:58:11 UTC
[12/50] git commit: add memoized version of local-hostname in util ns
add memoized version of local-hostname in util ns
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/a5c97d79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/a5c97d79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/a5c97d79
Branch: refs/heads/security
Commit: a5c97d79e0e809a43b962a8a6753f376e8bc020f
Parents: 85c9cd5
Author: Homer Strong <ho...@gmail.com>
Authored: Sun Jul 20 12:39:20 2014 -0700
Committer: Homer Strong <ho...@gmail.com>
Committed: Sun Jul 20 12:39:20 2014 -0700
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/util.clj | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/a5c97d79/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
index 7c1d19e..3df25b7 100644
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ b/storm-core/src/clj/backtype/storm/util.clj
@@ -204,6 +204,8 @@
[]
(.getCanonicalHostName (InetAddress/getLocalHost)))
+(def memoized-local-hostname (memoize local-hostname))
+
(letfn [(try-port [port]
(with-open [socket (java.net.ServerSocket. port)]
(.getLocalPort socket)))]