@CliCommand(value = CliStrings.REVOKE_MISSING_DISK_STORE, help = CliStrings.REVOKE_MISSING_DISK_STORE__HELP) @CliMetaData(relatedTopic = { CliStrings.TOPIC_GEMFIRE_DISKSTORE }) public Result revokeMissingDiskStore( @CliOption(key = CliStrings.REVOKE_MISSING_DISK_STORE__ID, mandatory = true, help = CliStrings.REVOKE_MISSING_DISK_STORE__ID__HELP) String id) { try { DistributedSystemMXBean dsMXBean = ManagementService.getManagementService(CacheFactory.getAnyInstance()) .getDistributedSystemMXBean(); if (dsMXBean.revokeMissingDiskStores(id)) { return ResultBuilder.createInfoResult("Missing disk store successfully revoked"); } return ResultBuilder.createUserErrorResult("Unable to find missing disk store to revoke"); } catch (VirtualMachineError e) { SystemFailure.initiateFailure(e); throw e; } catch (Throwable th) { SystemFailure.checkFailure(); if (th.getMessage() == null) { return ResultBuilder.createGemFireErrorResult("An error occurred while revoking missing disk stores: " + th); } return ResultBuilder.createGemFireErrorResult("An error occurred while revoking missing disk stores: " + th.getMessage()); } }
@CliCommand(value = CliStrings.REVOKE_MISSING_DISK_STORE, help = CliStrings.REVOKE_MISSING_DISK_STORE__HELP) @CliMetaData(relatedTopic = { CliStrings.TOPIC_GEMFIRE_DISKSTORE }) public Result revokeMissingDiskStore( @CliOption(key = CliStrings.REVOKE_MISSING_DISK_STORE__ID, mandatory = true, help = CliStrings.REVOKE_MISSING_DISK_STORE__ID__HELP) String id) { try { DistributedSystemMXBean dsMXBean = ManagementService.getManagementService(CacheFactory.getAnyInstance()) .getDistributedSystemMXBean(); if (dsMXBean.revokeMissingDiskStores(id)) { return ResultBuilder.createInfoResult("Missing disk store successfully revoked"); } return ResultBuilder.createUserErrorResult("Unable to find missing disk store to revoke"); } catch (VirtualMachineError e) { SystemFailure.initiateFailure(e); throw e; } catch (Throwable th) { SystemFailure.checkFailure(); if (th.getMessage() == null) { return ResultBuilder.createGemFireErrorResult("An error occurred while revoking missing disk stores: " + th); } return ResultBuilder.createGemFireErrorResult("An error occurred while revoking missing disk stores: " + th.getMessage()); } }
public void run() { Cache cache = getCache(); GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache; ManagementService service = getManagementService(); DistributedSystemMXBean bean = service.getDistributedSystemMXBean(); PersistentMemberDetails[] missingDiskStores = bean .listMissingDiskStores(); getLogWriter().info("waiting members=" + missingDiskStores); assertNotNull(missingDiskStores); assertEquals(1, missingDiskStores.length); for (PersistentMemberDetails id : missingDiskStores) { getLogWriter().info("Missing DiskStoreID is =" + id.getDiskStoreId()); getLogWriter().info("Missing Host is =" + id.getHost()); getLogWriter().info("Missing Directory is =" + id.getDirectory()); try { bean.revokeMissingDiskStores(id.getDiskStoreId()); } catch (Exception e) { fail("revokeMissingDiskStores failed with exception " + e); } } } });