Skip to content

Commit

Permalink
Fixed case with statsTrackingStore not being wrapped around properly
Browse files Browse the repository at this point in the history
with DynamicTimeoutStoreClient since ser. and compression were disabled
  • Loading branch information
abh1nay committed Jun 18, 2013
1 parent d90118f commit f23d03b
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/java/voldemort/client/AbstractStoreClientFactory.java
Expand Up @@ -106,7 +106,6 @@ public abstract class AbstractStoreClientFactory implements StoreClientFactory {
private final HashSet<SchedulerService> clientAsyncServiceRepo;

private Cluster cluster;
private List<StoreDefinition> storeDefs;

public AbstractStoreClientFactory(ClientConfig config) {
this.config = config;
Expand Down Expand Up @@ -222,7 +221,8 @@ public <K, V, T> Store<K, V, T> getRawStore(String storeName,
logger.debug("Obtained stores metadata xml" + storesXml);
}

storeDefs = storeMapper.readStoreList(new StringReader(storesXml), false);
List<StoreDefinition> storeDefs = storeMapper.readStoreList(new StringReader(storesXml),
false);
StoreDefinition storeDef = null;
for(StoreDefinition d: storeDefs)
if(d.getName().equals(storeName))
Expand Down Expand Up @@ -297,12 +297,10 @@ public <K, V, T> Store<K, V, T> getRawStore(String storeName,

store = new LoggingStore(store);

Store<K, V, T> finalStore = (Store<K, V, T>) store;

if(isJmxEnabled) {
StatTrackingStore statStore = new StatTrackingStore(store, this.stats);
store = statStore;
JmxUtils.registerMbean(new StoreStatsJmx(statStore.getStats()),
store = new StatTrackingStore(store, this.stats);
// store = statStore;
JmxUtils.registerMbean(new StoreStatsJmx(((StatTrackingStore) store).getStats()),
JmxUtils.createObjectName(JmxUtils.getPackageName(store.getClass()),
store.getName()
+ JmxUtils.getJmxId(jmxId)));
Expand All @@ -317,6 +315,8 @@ public <K, V, T> Store<K, V, T> getRawStore(String storeName,
}
}

Store<K, V, T> finalStore = (Store<K, V, T>) store;

if(this.config.isEnableSerializationLayer()) {
Serializer<K> keySerializer = (Serializer<K>) serializerFactory.getSerializer(storeDef.getKeySerializer());
Serializer<V> valueSerializer = (Serializer<V>) serializerFactory.getSerializer(storeDef.getValueSerializer());
Expand Down Expand Up @@ -536,12 +536,4 @@ private void stopClientAsyncSchedulers() {
protected String getClientContext() {
return clientContextName;
}

public Cluster getCluster() {
return cluster;
}

public List<StoreDefinition> getStoreDefs() {
return storeDefs;
}
}

0 comments on commit f23d03b

Please sign in to comment.