Search in sources :

Example 1 with DirectoryHolder

use of org.apache.geode.internal.cache.DirectoryHolder in project geode by apache.

the class RegionMBeanBridge method getInstance.

public static <K, V> RegionMBeanBridge<K, V> getInstance(Region<K, V> region) {
    if (region.getAttributes().getPartitionAttributes() != null) {
        RegionMBeanBridge<K, V> bridge = PartitionedRegionBridge.getInstance(region);
        PartitionedRegion parRegion = ((PartitionedRegion) region);
        DiskStoreImpl dsi = parRegion.getDiskStore();
        if (dsi != null) {
            DiskRegionStats stats = parRegion.getDiskRegionStats();
            DiskRegionBridge diskRegionBridge = new DiskRegionBridge(stats);
            bridge.addDiskRegionBridge(diskRegionBridge);
            for (DirectoryHolder dh : dsi.getDirectoryHolders()) {
                diskRegionBridge.addDirectoryStats(dh.getDiskDirectoryStats());
            }
            bridge.addDiskRegionBridge(diskRegionBridge);
        }
        return bridge;
    } else {
        RegionMBeanBridge<K, V> bridge = new RegionMBeanBridge<K, V>(region);
        LocalRegion localRegion = ((LocalRegion) region);
        DiskStoreImpl dsi = localRegion.getDiskStore();
        if (dsi != null) {
            DiskRegionBridge diskRegionBridge = new DiskRegionBridge(localRegion.getDiskRegion().getStats());
            bridge.addDiskRegionBridge(diskRegionBridge);
            for (DirectoryHolder dh : dsi.getDirectoryHolders()) {
                diskRegionBridge.addDirectoryStats(dh.getDiskDirectoryStats());
            }
        }
        return bridge;
    }
}
Also used : DiskRegionStats(org.apache.geode.internal.cache.DiskRegionStats) PartitionedRegion(org.apache.geode.internal.cache.PartitionedRegion) DiskStoreImpl(org.apache.geode.internal.cache.DiskStoreImpl) LocalRegion(org.apache.geode.internal.cache.LocalRegion) DirectoryHolder(org.apache.geode.internal.cache.DirectoryHolder)

Example 2 with DirectoryHolder

use of org.apache.geode.internal.cache.DirectoryHolder in project geode by apache.

the class MemberMBeanBridge method addRegion.

public void addRegion(Region region) {
    if (region.getAttributes().getPartitionAttributes() != null) {
        addPartionRegionStats(((PartitionedRegion) region).getPrStats());
    }
    LocalRegion l = (LocalRegion) region;
    if (l.getEvictionController() != null) {
        LRUStatistics stats = l.getEvictionController().getLRUHelper().getStats();
        if (stats != null) {
            addLRUStats(stats);
        }
    }
    DiskRegion dr = l.getDiskRegion();
    if (dr != null) {
        for (DirectoryHolder dh : dr.getDirectories()) {
            addDirectoryStats(dh.getDiskDirectoryStats());
        }
    }
}
Also used : DiskRegion(org.apache.geode.internal.cache.DiskRegion) LRUStatistics(org.apache.geode.internal.cache.lru.LRUStatistics) LocalRegion(org.apache.geode.internal.cache.LocalRegion) DirectoryHolder(org.apache.geode.internal.cache.DirectoryHolder)

Example 3 with DirectoryHolder

use of org.apache.geode.internal.cache.DirectoryHolder in project geode by apache.

the class MemberMBeanBridge method removeRegion.

public void removeRegion(Region region) {
    if (region.getAttributes().getPartitionAttributes() != null) {
        removePartionRegionStats(((PartitionedRegion) region).getPrStats());
    }
    LocalRegion l = (LocalRegion) region;
    if (l.getEvictionController() != null) {
        LRUStatistics stats = l.getEvictionController().getLRUHelper().getStats();
        if (stats != null) {
            removeLRUStats(stats);
        }
    }
    DiskRegion dr = l.getDiskRegion();
    if (dr != null) {
        for (DirectoryHolder dh : dr.getDirectories()) {
            removeDirectoryStats(dh.getDiskDirectoryStats());
        }
    }
}
Also used : DiskRegion(org.apache.geode.internal.cache.DiskRegion) LRUStatistics(org.apache.geode.internal.cache.lru.LRUStatistics) LocalRegion(org.apache.geode.internal.cache.LocalRegion) DirectoryHolder(org.apache.geode.internal.cache.DirectoryHolder)

Aggregations

DirectoryHolder (org.apache.geode.internal.cache.DirectoryHolder)3 LocalRegion (org.apache.geode.internal.cache.LocalRegion)3 DiskRegion (org.apache.geode.internal.cache.DiskRegion)2 LRUStatistics (org.apache.geode.internal.cache.lru.LRUStatistics)2 DiskRegionStats (org.apache.geode.internal.cache.DiskRegionStats)1 DiskStoreImpl (org.apache.geode.internal.cache.DiskStoreImpl)1 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)1