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);
}
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);
}
}
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();
}
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);
}
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;
}
Aggregations