use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class CacheServerBridge method getClientQueueDetail.
private ClientQueueDetail getClientQueueDetail(CacheClientProxy p) {
ClientQueueDetail queueDetail = new ClientQueueDetail();
ClientProxyMembershipID proxyID = p.getProxyID();
if (!p.isConnected() && !proxyID.isDurable()) {
return null;
}
queueDetail.setClientId(CliUtil.getClientIdFromCacheClientProxy(p));
HARegionQueue queue = p.getHARegionQueue();
if (queue == null) {
return queueDetail;
}
queueDetail.setQueueSize(p.getQueueSizeStat());
queueDetail.setEventsConflated(queue.getStatistics().getEventsConflated());
queueDetail.setEventsEnqued(queue.getStatistics().getEventsEnqued());
queueDetail.setEventsExpired(queue.getStatistics().getEventsExpired());
queueDetail.setEventsRemoved(queue.getStatistics().getEventsRemoved());
queueDetail.setEventsRemovedByQrm(queue.getStatistics().getEventsRemovedByQrm());
queueDetail.setEventsTaken(queue.getStatistics().getEventsTaken());
queueDetail.setMarkerEventsConflated(queue.getStatistics().getMarkerEventsConflated());
queueDetail.setNumVoidRemovals(queue.getStatistics().getNumVoidRemovals());
return queueDetail;
}
use of org.apache.geode.internal.cache.ha.HARegionQueue in project geode by apache.
the class Bug37210DUnitTest method closeCacheClientProxyAndVerifyStats.
/**
* Close the CacheClientProxy of the client on the server and verify that ha-stats are closed and
* the entry for the region is removed from dispatchedMessagesMap.
*
*/
public static void closeCacheClientProxyAndVerifyStats() {
assertEquals("More than one BridgeServers found ", 1, cache.getCacheServers().size());
CacheServerImpl bs = (CacheServerImpl) cache.getCacheServers().iterator().next();
assertNotNull(bs);
assertNotNull(bs.getAcceptor());
assertNotNull(bs.getAcceptor().getCacheClientNotifier());
Iterator proxies = bs.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();
assertTrue("No proxy found", proxies.hasNext());
CacheClientProxy proxy = (CacheClientProxy) proxies.next();
Map dispatchedMsgMap = HARegionQueue.getDispatchedMessagesMapForTesting();
HARegionQueue rq = proxy.getHARegionQueue();
Object value = dispatchedMsgMap.get(rq.getRegion().getName());
proxy.close();
assertTrue("HARegionQueue stats were not closed on proxy.close()", rq.getStatistics().isClosed());
}
Aggregations