Search in sources :

Example 1 with PersistentMemberDetails

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;
}
Also used : PersistentMemberPattern(org.apache.geode.internal.cache.persistence.PersistentMemberPattern) PersistentMemberDetails(org.apache.geode.management.PersistentMemberDetails)

Example 2 with PersistentMemberDetails

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;
}
Also used : PersistentMemberDetails(org.apache.geode.management.PersistentMemberDetails) PersistentID(org.apache.geode.cache.persistence.PersistentID)

Aggregations

PersistentMemberDetails (org.apache.geode.management.PersistentMemberDetails)2 PersistentID (org.apache.geode.cache.persistence.PersistentID)1 PersistentMemberPattern (org.apache.geode.internal.cache.persistence.PersistentMemberPattern)1