Search in sources :

Example 6 with StoreStatsJmx

use of voldemort.store.stats.StoreStatsJmx in project voldemort by voldemort.

the class StorageService method registerSystemEngine.

public void registerSystemEngine(StorageEngine<ByteArray, byte[], byte[]> engine) {
    Cluster cluster = this.metadata.getCluster();
    storeRepository.addStorageEngine(engine);
    /* Now add any store wrappers that are enabled */
    Store<ByteArray, byte[], byte[]> store = engine;
    if (voldemortConfig.isVerboseLoggingEnabled())
        store = new LoggingStore<ByteArray, byte[], byte[]>(store, cluster.getName(), SystemTime.INSTANCE);
    if (voldemortConfig.isMetadataCheckingEnabled())
        store = new InvalidMetadataCheckingStore(metadata.getNodeId(), store, metadata);
    if (voldemortConfig.isStatTrackingEnabled()) {
        StatTrackingStore statStore = new StatTrackingStore(store, this.storeStats);
        store = statStore;
        if (voldemortConfig.isJmxEnabled()) {
            MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
            ObjectName name = null;
            if (this.voldemortConfig.isEnableJmxClusterName())
                name = JmxUtils.createObjectName(metadata.getCluster().getName() + "." + JmxUtils.getPackageName(store.getClass()), store.getName());
            else
                name = JmxUtils.createObjectName(JmxUtils.getPackageName(store.getClass()), store.getName());
            synchronized (mbeanServer) {
                if (mbeanServer.isRegistered(name))
                    JmxUtils.unregisterMbean(mbeanServer, name);
                JmxUtils.registerMbean(mbeanServer, JmxUtils.createModelMBean(new StoreStatsJmx(statStore.getStats())), name);
            }
        }
    }
    storeRepository.addLocalStore(store);
}
Also used : StatTrackingStore(voldemort.store.stats.StatTrackingStore) Cluster(voldemort.cluster.Cluster) ByteArray(voldemort.utils.ByteArray) InvalidMetadataCheckingStore(voldemort.store.invalidmetadata.InvalidMetadataCheckingStore) LoggingStore(voldemort.store.logging.LoggingStore) StoreStatsJmx(voldemort.store.stats.StoreStatsJmx) MBeanServer(javax.management.MBeanServer) ObjectName(javax.management.ObjectName)

Aggregations

StoreStatsJmx (voldemort.store.stats.StoreStatsJmx)6 ByteArray (voldemort.utils.ByteArray)4 StatTrackingStore (voldemort.store.stats.StatTrackingStore)3 StoreStats (voldemort.store.stats.StoreStats)3 MBeanServer (javax.management.MBeanServer)2 ObjectName (javax.management.ObjectName)2 Cluster (voldemort.cluster.Cluster)2 StoreDefinition (voldemort.store.StoreDefinition)2 FileBackedCachingStorageEngine (voldemort.store.configuration.FileBackedCachingStorageEngine)2 InvalidMetadataCheckingStore (voldemort.store.invalidmetadata.InvalidMetadataCheckingStore)2 LoggingStore (voldemort.store.logging.LoggingStore)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1 HashMap (java.util.HashMap)1 List (java.util.List)1 DeleteResponseSender (voldemort.rest.DeleteResponseSender)1 GetAllResponseSender (voldemort.rest.GetAllResponseSender)1 GetResponseSender (voldemort.rest.GetResponseSender)1 GetVersionResponseSender (voldemort.rest.GetVersionResponseSender)1