use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class CacheClientProxy method destroyRQ.
private void destroyRQ() {
if (this._messageDispatcher == null) {
return;
}
try {
// Using Destroy Region bcoz this method is modified in HARegion so as
// not to distribute.
// For normal Regions , even the localDestroyRegion actually propagates
HARegionQueue rq = this._messageDispatcher._messageQueue;
rq.destroy();
// if (!rq.getRegion().isDestroyed()) {
// rq.getRegion().destroyRegion();
// }
} catch (RegionDestroyedException rde) {
// throw rde;
} catch (CancelException e) {
// throw e;
} catch (Exception warning) {
logger.warn(LocalizedMessage.create(LocalizedStrings.CacheClientProxy_0_EXCEPTION_IN_CLOSING_THE_UNDERLYING_HAREGION_OF_THE_HAREGIONQUEUE, this), warning);
}
}
use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class CacheClientNotifier method processDispatchedMessage.
/**
* Adds or updates entry in the dispatched message map when client sends an ack.
*
* @return success
*/
public boolean processDispatchedMessage(ClientProxyMembershipID proxyId, EventID eid) {
boolean success = false;
CacheClientProxy proxy = getClientProxy(proxyId);
if (proxy != null) {
HARegionQueue harq = proxy.getHARegionQueue();
harq.addDispatchedMessage(new ThreadIdentifier(eid.getMembershipID(), eid.getThreadID()), eid.getSequenceID());
success = true;
}
return success;
}
use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class ConflationDUnitTest method getStatsOnServer.
/**
* getting conflation Stats on server
*
*/
public static void getStatsOnServer() {
Cache cache = GemFireCacheImpl.getInstance();
Iterator itr = cache.getCacheServers().iterator();
CacheServerImpl server = (CacheServerImpl) itr.next();
Iterator iter_prox = server.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();
int ccpCount = 0;
while (iter_prox.hasNext()) {
ccpCount++;
CacheClientProxy proxy = (CacheClientProxy) iter_prox.next();
if (HaHelper.checkPrimary(proxy)) {
HARegion region = (HARegion) proxy.getHARegion();
assertNotNull(region);
HARegionQueue haRegionQueue = HAHelper.getRegionQueue(region);
statMap.put("eventsConflated", new Long(HAHelper.getRegionQueueStats(haRegionQueue).getEventsConflated()));
LogWriterUtils.getLogWriter().info("new Stats Map : " + statMap.toString());
}
}
assertTrue("CCP Count is not 1 ", ccpCount == 1);
// }
}
use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class DurableClientSimpleDUnitTest method waitForEventsRemovedByQueueRemovalMessage.
private static void waitForEventsRemovedByQueueRemovalMessage(String durableClientId, final int numEvents) {
CacheClientNotifier ccn = CacheClientNotifier.getInstance();
CacheClientProxy ccp = ccn.getClientProxy(durableClientId);
HARegionQueue harq = ccp.getHARegionQueue();
HARegionQueueStats harqStats = harq.getStatistics();
Awaitility.await().atMost(10, TimeUnit.SECONDS).until(() -> assertEquals("Expected queue removal messages: " + numEvents + " but actual messages: " + harqStats.getEventsRemovedByQrm(), numEvents, harqStats.getEventsRemovedByQrm()));
}
use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class CacheClientProxy method registerClientInterest.
/*
* protected void addFilterRegisteredClients(String regionName, Object keyOfInterest) { try {
* this._cacheClientNotifier.addFilterRegisteredClients(regionName, this.proxyID); } catch
* (RegionDestroyedException e) {
* logger.warn(LocalizedStrings.CacheClientProxy_0_INTEREST_REG_FOR_0_FAILED, regionName + "->" +
* keyOfInterest, e); } }
*/
/**
* Registers interest in the input region name and key
*
* @param regionName The fully-qualified name of the region in which to register interest
* @param keyOfInterest The key in which to register interest
*/
protected void registerClientInterest(String regionName, Object keyOfInterest, int interestType, boolean isDurable, boolean sendUpdatesAsInvalidates, boolean flushState) {
ClientInterestList cil = this.cils[RegisterInterestTracker.getInterestLookupIndex(isDurable, false)];
cil.registerClientInterest(regionName, keyOfInterest, interestType, sendUpdatesAsInvalidates);
if (flushState) {
flushForInterestRegistration(regionName, this._cache.getDistributedSystem().getDistributedMember());
}
HARegionQueue queue = getHARegionQueue();
if (queue != null) {
// queue is null during initialization
queue.setHasRegisteredInterest(true);
}
}
Aggregations