Skip to content
Browse files

Fixed the conflicts

  • Loading branch information...
2 parents f70b3c2 + d1b9bb8 commit ea0c80bc8005d92bab5a72a794d99cff57d9d995 Chinmay Soman committed Jun 21, 2012
View
9 src/java/voldemort/client/AbstractStoreClientFactory.java
@@ -274,8 +274,13 @@ public FailureDetector getFailureDetector() {
synchronized(this) {
// second check: avoids double initialization
result = failureDetector;
- if(result == null)
+ if(result == null) {
failureDetector = result = initFailureDetector(config, cluster.getNodes());
+ JmxUtils.registerMbean(failureDetector,
+ JmxUtils.createObjectName(JmxUtils.getPackageName(failureDetector.getClass()),
+ JmxUtils.getClassName(failureDetector.getClass())
+ + jmxId()));
+ }
}
}
@@ -400,7 +405,7 @@ public void close() {
}
/* Give a unique id to avoid jmx clashes */
- private String jmxId() {
+ public String jmxId() {
return jmxId == 0 ? "" : Integer.toString(jmxId);
}
View
6 src/java/voldemort/client/SocketStoreClientFactory.java
@@ -38,6 +38,7 @@
import voldemort.store.socket.SocketStoreFactory;
import voldemort.store.socket.clientrequest.ClientRequestExecutorPool;
import voldemort.utils.ByteArray;
+import voldemort.utils.JmxUtils;
import voldemort.versioning.InconsistencyResolver;
import voldemort.versioning.Versioned;
@@ -68,6 +69,11 @@ public SocketStoreClientFactory(ClientConfig config) {
config.getSocketBufferSize(),
config.getSocketKeepAlive(),
config.isJmxEnabled());
+ if(config.isJmxEnabled())
+ JmxUtils.registerMbean(storeFactory,
+ JmxUtils.createObjectName(JmxUtils.getPackageName(storeFactory.getClass()),
+ JmxUtils.getClassName(storeFactory.getClass())
+ + jmxId()));
}
@Override

1 comment on commit ea0c80b

@shingon

same problem #80. memory leak.

example:

while(true)
    new SocketStoreClientFactory(config).close();

JmxUtils.registerMbean [pseudo code]

def registerMbean(ObjectName name):
  if isRegistered(name):
    unregisterMbean(name)  # not running. jmxId is incremented by AbstractStoreClientFactory()
  registerMBean(name)
Please sign in to comment.
Something went wrong with that request. Please try again.