use of org.apache.geode.management.DistributedSystemMXBean in project geode by apache.
the class DiskStoreCommands method diskStoreExists.
private boolean diskStoreExists(String diskStoreName) {
InternalCache cache = getCache();
ManagementService managementService = ManagementService.getExistingManagementService(cache);
DistributedSystemMXBean dsMXBean = managementService.getDistributedSystemMXBean();
Map<String, String[]> diskstore = dsMXBean.listMemberDiskstore();
Set<Entry<String, String[]>> entrySet = diskstore.entrySet();
for (Entry<String, String[]> entry : entrySet) {
String[] value = entry.getValue();
if (CliUtil.contains(value, diskStoreName)) {
return true;
}
}
return false;
}
use of org.apache.geode.management.DistributedSystemMXBean in project geode by apache.
the class TestRemoteClusterDUnitTest method checkRemoteClusterStatus.
/**
* Checks Proxy GatewaySender
*
* @param vm reference to VM
*/
@SuppressWarnings("serial")
protected void checkRemoteClusterStatus(final VM vm, final DistributedMember senderMember) {
SerializableRunnable checkProxySender = new SerializableRunnable("DS Map Size") {
public void run() {
Cache cache = GemFireCacheImpl.getInstance();
final WaitCriterion waitCriteria2 = new WaitCriterion() {
@Override
public boolean done() {
Cache cache = GemFireCacheImpl.getInstance();
final ManagementService service = ManagementService.getManagementService(cache);
final DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
if (dsBean != null) {
return true;
}
return false;
}
@Override
public String description() {
return "wait for getDistributedSystemMXBean to complete and get results";
}
};
Wait.waitForCriterion(waitCriteria2, 2 * 60 * 1000, 5000, true);
ManagementService service = ManagementService.getManagementService(cache);
final DistributedSystemMXBean dsBean = service.getDistributedSystemMXBean();
assertNotNull(dsBean);
Map<String, Boolean> dsMap = dsBean.viewRemoteClusterStatus();
LogWriterUtils.getLogWriter().info("Ds Map is: " + dsMap.size());
assertNotNull(dsMap);
assertEquals(true, dsMap.size() > 0 ? true : false);
}
};
vm.invoke(checkProxySender);
}
Aggregations