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;
}
}
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());
}
}
}
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());
}
}
}
Aggregations