Skip to content

Commit 44f7ddb

Browse files
committed
Merge pull request nathanmarz#564 from jasonjckn/0.9.0
remove usage of immutablemap in systembolt.
2 parents 78b9f99 + 66af2fa commit 44f7ddb

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/jvm/backtype/storm/metric/SystemBolt.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import clojure.lang.AFn;
1111
import clojure.lang.IFn;
1212
import clojure.lang.RT;
13-
import com.google.common.collect.ImmutableMap;
1413
import org.slf4j.Logger;
1514
import org.slf4j.LoggerFactory;
1615

1716
import java.lang.management.*;
17+
import java.util.HashMap;
1818
import java.util.List;
1919
import java.util.Map;
2020

@@ -34,14 +34,14 @@ public MemoryUsageMetric(IFn getUsage) {
3434
@Override
3535
public Object getValueAndReset() {
3636
MemoryUsage memUsage = (MemoryUsage)_getUsage.invoke();
37-
return ImmutableMap.builder()
38-
.put("maxBytes", memUsage.getMax())
39-
.put("committedBytes", memUsage.getCommitted())
40-
.put("initBytes", memUsage.getInit())
41-
.put("usedBytes", memUsage.getUsed())
42-
.put("virtualFreeBytes", memUsage.getMax() - memUsage.getUsed())
43-
.put("unusedBytes", memUsage.getCommitted() - memUsage.getUsed())
44-
.build();
37+
HashMap m = new HashMap();
38+
m.put("maxBytes", memUsage.getMax());
39+
m.put("committedBytes", memUsage.getCommitted());
40+
m.put("initBytes", memUsage.getInit());
41+
m.put("usedBytes", memUsage.getUsed());
42+
m.put("virtualFreeBytes", memUsage.getMax() - memUsage.getUsed());
43+
m.put("unusedBytes", memUsage.getCommitted() - memUsage.getUsed());
44+
return m;
4545
}
4646
}
4747

@@ -61,10 +61,9 @@ public Object getValueAndReset() {
6161

6262
Map ret = null;
6363
if(_collectionCount!=null && _collectionTime!=null) {
64-
ret = ImmutableMap.builder()
65-
.put("count", collectionCountP - _collectionCount)
66-
.put("timeMs", collectionTimeP - _collectionTime)
67-
.build();
64+
ret = new HashMap();
65+
ret.put("count", collectionCountP - _collectionCount);
66+
ret.put("timeMs", collectionTimeP - _collectionTime);
6867
}
6968

7069
_collectionCount = collectionCountP;

0 commit comments

Comments
 (0)