use of org.apache.geode.internal.cache.RemoteFetchVersionMessage.FetchVersionResponse in project geode by apache.
the class DistributedRegion method fetchRemoteVersionTag.
/**
* Fetch Version for the given key from a remote replicate member.
*
* @throws EntryNotFoundException if the entry is not found on replicate member
* @return VersionTag for the key
*/
protected VersionTag fetchRemoteVersionTag(Object key) {
VersionTag tag = null;
assert this.dataPolicy != DataPolicy.REPLICATE;
final TXStateProxy tx = cache.getTXMgr().internalSuspend();
try {
boolean retry = true;
InternalDistributedMember member = getRandomReplicate();
while (retry) {
try {
if (member == null) {
break;
}
FetchVersionResponse response = RemoteFetchVersionMessage.send(member, this, key);
tag = response.waitForResponse();
retry = false;
} catch (RemoteOperationException e) {
member = getRandomReplicate();
if (member != null) {
if (logger.isDebugEnabled()) {
logger.debug("Retrying RemoteFetchVersionMessage on member:{}", member);
}
}
}
}
} finally {
if (tx != null) {
cache.getTXMgr().internalResume(tx);
}
}
return tag;
}
Aggregations