use of org.apache.geode.management.ClientQueueDetail in project geode by apache.
the class CacheServerBridge method getClientQueueDetails.
/**
* @return Client Queue Details for all clients
*/
public ClientQueueDetail[] getClientQueueDetails() throws Exception {
List<ClientQueueDetail> clientQueueDetailList = null;
try {
if (acceptor != null && acceptor.getCacheClientNotifier() != null) {
Collection<CacheClientProxy> clientProxies = acceptor.getCacheClientNotifier().getClientProxies();
if (clientProxies.size() > 0) {
clientQueueDetailList = new ArrayList<ClientQueueDetail>();
} else {
return new ClientQueueDetail[0];
}
for (CacheClientProxy p : clientProxies) {
ClientQueueDetail status = getClientQueueDetail(p);
if (status != null) {
clientQueueDetailList.add(status);
}
}
ClientQueueDetail[] queueDetailArr = new ClientQueueDetail[clientQueueDetailList.size()];
return clientQueueDetailList.toArray(queueDetailArr);
}
return new ClientQueueDetail[0];
} catch (Exception e) {
throw new Exception(e.getMessage());
}
}
use of org.apache.geode.management.ClientQueueDetail 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;
}
Aggregations