use of org.apache.geode.management.PersistentMemberDetails in project geode by apache.
the class DistributedSystemBridge method revokeMissingDiskStores.
/**
* Revokes or ignores the missing diskStore for which the region Initialization is stopped
*
* @param diskStoreId UUID of the disk store to revoke
* @return successful or failure
*/
public boolean revokeMissingDiskStores(final String diskStoreId) {
// make sure that the disk store we're revoking is actually missing
boolean found = false;
PersistentMemberDetails[] details = listMissingDiskStores();
if (details != null) {
for (PersistentMemberDetails member : details) {
if (member.getDiskStoreId().equalsIgnoreCase(diskStoreId)) {
found = true;
break;
}
}
}
if (!found) {
return false;
}
PersistentMemberPattern pattern = new PersistentMemberPattern(UUID.fromString(diskStoreId));
boolean success = false;
try {
PrepareRevokePersistentIDRequest.send(dm, pattern);
success = true;
} finally {
if (success) {
// revoke the persistent member if were able to prepare the revoke
RevokePersistentIDRequest.send(dm, pattern);
} else {
// otherwise, cancel the revoke.
PrepareRevokePersistentIDRequest.cancel(dm, pattern);
}
}
return success;
}
use of org.apache.geode.management.PersistentMemberDetails in project geode by apache.
the class DistributedSystemBridge method listMissingDiskStores.
/**
* In case of replicated region during recovery all region recovery will wait till all the
* replicated region member are up and running so that the recovered data from the disk will be in
* sync;
*
* @return Array of PersistentMemberDetails (which contains host, directory and disk store id)
*/
public PersistentMemberDetails[] listMissingDiskStores() {
PersistentMemberDetails[] missingDiskStores = null;
Set<PersistentID> persistentMemberSet = MissingPersistentIDsRequest.send(dm);
if (persistentMemberSet != null && persistentMemberSet.size() > 0) {
missingDiskStores = new PersistentMemberDetails[persistentMemberSet.size()];
int j = 0;
for (PersistentID id : persistentMemberSet) {
missingDiskStores[j] = new PersistentMemberDetails(id.getHost().getCanonicalHostName(), id.getDirectory(), id.getUUID().toString());
j++;
}
}
return missingDiskStores;
}
Aggregations