public boolean done() { return fproxy.getHARegionQueue().size() == 0; } public String description() {
/** * Registers interest in the input region name and list of keys * * @param regionName * The fully-qualified name of the region in which to register * interest * @param keysOfInterest * The list of keys in which to register interest */ protected void registerClientInterestList(String regionName, List keysOfInterest, boolean isDurable, boolean sendUpdatesAsInvalidates, boolean flushState) { // we only use two interest lists to map the non-durable and durable // identifiers to their interest settings ClientInterestList cil = this.cils[RegisterInterestTracker.getInterestLookupIndex( isDurable, false/*sendUpdatesAsInvalidates*/)]; cil.registerClientInterestList(regionName, keysOfInterest, sendUpdatesAsInvalidates); if (getHARegionQueue() != null) { if (flushState) { flushForInterestRegistration(regionName, this._cache.getDistributedSystem().getDistributedMember()); } getHARegionQueue().setHasRegisteredInterest(true); } }
/** * Registers interest in the input region name and list of keys * * @param regionName * The fully-qualified name of the region in which to register * interest * @param keysOfInterest * The list of keys in which to register interest */ protected void registerClientInterestList(String regionName, List keysOfInterest, boolean isDurable, boolean sendUpdatesAsInvalidates, boolean flushState) { // we only use two interest lists to map the non-durable and durable // identifiers to their interest settings ClientInterestList cil = this.cils[RegisterInterestTracker.getInterestLookupIndex( isDurable, false/*sendUpdatesAsInvalidates*/)]; cil.registerClientInterestList(regionName, keysOfInterest, sendUpdatesAsInvalidates); if (getHARegionQueue() != null) { if (flushState) { flushForInterestRegistration(regionName, this._cache.getDistributedSystem().getDistributedMember()); } getHARegionQueue().setHasRegisteredInterest(true); } }
private void blackListSlowReciever(CacheClientProxy clientProxy){ final CacheClientProxy proxy = clientProxy; if ((proxy.getHARegionQueue() != null && proxy.getHARegionQueue().isClientSlowReciever()) && !blackListedClients.contains(proxy.getProxyID())) {
private void blackListSlowReciever(CacheClientProxy clientProxy){ final CacheClientProxy proxy = clientProxy; if ((proxy.getHARegionQueue() != null && proxy.getHARegionQueue().isClientSlowReciever()) && !blackListedClients.contains(proxy.getProxyID())) {
/** * 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); } }
/** * 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); } }
/** * Adds or updates entry in the dispatched message map when client sends an ack. * * @param proxyId * @param eid * @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; }
/** * Adds or updates entry in the dispatched message map when client sends an ack. * * @param proxyId * @param eid * @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; }
/** * 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 .getBridgeServers().size()); BridgeServerImpl bs = (BridgeServerImpl)cache.getBridgeServers().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(); proxy.close(); HARegionQueue rq = proxy.getHARegionQueue(); Map dispatchedMsgMap = HARegionQueue.getDispatchedMessagesMapForTesting(); assertTrue("HARegionQueue stats were not closed on proxy.close()", rq .getStatistics().isClosed()); assertFalse( "HARegionQueue.dispatchedMessagesMap contains entry for the region even after proxy.close()", dispatchedMsgMap.containsKey(rq.getRegion().getName())); }
CacheClientProxy proxy = ccn.getClientProxy(servConn.getProxyID()); if (proxy != null) { proxy.getHARegionQueue().createAckedEventsMap(); for (int i = 0; i < numEvents; i++) { Part eventIdPart = msg.getPart(i); proxy.getHARegionQueue().setAckedEvents(); writeReply(msg, servConn); servConn.setAsTrue(RESPONDED);
public void run() { CacheDistributionAdvisor advisor = ((DistributedRegion)proxy .getHARegionQueue().getRegion()).getCacheDistributionAdvisor(); Set members = advisor.adviseCacheOp(); // Send client blacklist message ClientBlacklistProcessor.sendBlacklistedClient(proxy.getProxyID(), dm, members); // close the proxy for slow receiver. proxy.close(false, false); removeClientProxy(proxy); if (PoolImpl.AFTER_QUEUE_DESTROY_MESSAGE_FLAG) { ClientServerObserver bo = ClientServerObserverHolder.getInstance(); bo.afterQueueDestroyMessage(); } // send remove from blacklist. RemoveClientFromBlacklistMessage rcm = new RemoveClientFromBlacklistMessage(); rcm.setProxyID(proxy.getProxyID()); dm.putOutgoing(rcm); blackListedClients.remove(proxy.getProxyID()); } });
public void run() { CacheDistributionAdvisor advisor = ((DistributedRegion)proxy .getHARegionQueue().getRegion()).getCacheDistributionAdvisor(); Set members = advisor.adviseCacheOp(); // Send client blacklist message ClientBlacklistProcessor.sendBlacklistedClient(proxy.getProxyID(), dm, members); // close the proxy for slow receiver. proxy.close(false, false); removeClientProxy(proxy); if (PoolImpl.AFTER_QUEUE_DESTROY_MESSAGE_FLAG) { BridgeObserver bo = BridgeObserverHolder.getInstance(); bo.afterQueueDestroyMessage(); } // send remove from blacklist. RemoveClientFromBlacklistMessage rcm = new RemoveClientFromBlacklistMessage(); rcm.setProxyID(proxy.getProxyID()); dm.putOutgoing(rcm); blackListedClients.remove(proxy.getProxyID()); } });
CacheClientProxy proxy = ccn.getClientProxy(servConn.getProxyID()); if (proxy != null) { proxy.getHARegionQueue().createAckedEventsMap(); for (int i = 0; i < numEvents; i++) { EventID eid = (EventID)msg.getPart(i).getObject(); proxy.getHARegionQueue().setAckedEvents(); writeReply(msg, servConn); servConn.setAsTrue(RESPONDED);
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; }