Search in sources :

Example 6 with PersistentMemberPattern

use of org.apache.geode.internal.cache.persistence.PersistentMemberPattern in project geode by apache.

the class RevokePersistentIDRequest method fromData.

@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
    super.fromData(in);
    this.pattern = new PersistentMemberPattern();
    InternalDataSerializer.invokeFromData(this.pattern, in);
}
Also used : PersistentMemberPattern(org.apache.geode.internal.cache.persistence.PersistentMemberPattern)

Example 7 with PersistentMemberPattern

use of org.apache.geode.internal.cache.persistence.PersistentMemberPattern in project geode by apache.

the class MissingPersistentIDsResponse method fromData.

@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
    super.fromData(in);
    int size = in.readInt();
    missingIds = new HashSet<PersistentID>(size);
    for (int i = 0; i < size; i++) {
        PersistentMemberPattern pattern = new PersistentMemberPattern();
        InternalDataSerializer.invokeFromData(pattern, in);
        missingIds.add(pattern);
    }
    size = in.readInt();
    localIds = new HashSet<PersistentID>(size);
    for (int i = 0; i < size; i++) {
        PersistentMemberPattern pattern = new PersistentMemberPattern();
        InternalDataSerializer.invokeFromData(pattern, in);
        localIds.add(pattern);
    }
}
Also used : PersistentMemberPattern(org.apache.geode.internal.cache.persistence.PersistentMemberPattern) PersistentID(org.apache.geode.cache.persistence.PersistentID)

Example 8 with PersistentMemberPattern

use of org.apache.geode.internal.cache.persistence.PersistentMemberPattern in project geode by apache.

the class PrepareRevokePersistentIDRequest method fromData.

@Override
public void fromData(DataInput in) throws IOException, ClassNotFoundException {
    super.fromData(in);
    this.pattern = new PersistentMemberPattern();
    InternalDataSerializer.invokeFromData(this.pattern, in);
    this.cancel = in.readBoolean();
}
Also used : PersistentMemberPattern(org.apache.geode.internal.cache.persistence.PersistentMemberPattern)

Example 9 with PersistentMemberPattern

use of org.apache.geode.internal.cache.persistence.PersistentMemberPattern in project geode by apache.

the class DiskStoreImpl method getPersistentID.

public PersistentID getPersistentID() {
    InetAddress host = cache.getInternalDistributedSystem().getDistributedMember().getInetAddress();
    String dir = getDiskDirs()[0].getAbsolutePath();
    return new PersistentMemberPattern(host, dir, this.diskStoreID.toUUID(), 0);
}
Also used : PersistentMemberPattern(org.apache.geode.internal.cache.persistence.PersistentMemberPattern) InetAddress(java.net.InetAddress)

Example 10 with PersistentMemberPattern

use of org.apache.geode.internal.cache.persistence.PersistentMemberPattern 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)

Aggregations

PersistentMemberPattern (org.apache.geode.internal.cache.persistence.PersistentMemberPattern)14 HashSet (java.util.HashSet)5 Set (java.util.Set)5 PersistentMemberID (org.apache.geode.internal.cache.persistence.PersistentMemberID)5 PersistentID (org.apache.geode.cache.persistence.PersistentID)3 ColocatedRegionDetails (org.apache.geode.internal.cache.partitioned.ColocatedRegionDetails)3 PersistentMemberManager (org.apache.geode.internal.cache.persistence.PersistentMemberManager)3 InetAddress (java.net.InetAddress)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 InternalCache (org.apache.geode.internal.cache.InternalCache)2 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)2 DiskStoreID (org.apache.geode.internal.cache.persistence.DiskStoreID)2 UnitTest (org.apache.geode.test.junit.categories.UnitTest)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 InetSocketAddress (java.net.InetSocketAddress)1 Map (java.util.Map)1 TreeSet (java.util.TreeSet)1 DistributedMember (org.apache.geode.distributed.DistributedMember)1