public void run2() throws CacheException { final CacheClientNotifier ccnInstance = CacheClientNotifier .getInstance(); final CacheClientProxy clientProxy = ccnInstance .getClientProxy(durableClientId); ClientProxyMembershipID proxyId = clientProxy.getProxyID(); try { ccnInstance.closeClientCq(durableClientId, "All"); ccnInstance.closeClientCq(durableClientId, "GreaterThan5"); ccnInstance.closeClientCq(durableClientId, "LessThan5"); } catch (CqException e) { throw new CacheException(e){}; } } });
public void run2() throws CacheException { final CacheClientNotifier ccnInstance = CacheClientNotifier .getInstance(); final CacheClientProxy clientProxy = ccnInstance .getClientProxy(durableClientId); ClientProxyMembershipID proxyId = clientProxy.getProxyID(); ccnInstance.closeDurableClientProxy(durableClientId); } });
public boolean done() { return ccn.getClientProxies().size() > 0; } public String description() {
public void run2() throws CacheException { long compiledQueryUsedCount = CacheClientNotifier.getInstance().getStats().getCompiledQueryUsedCount(); int numTimesUsed = (useMaintainedCompiledQueries + 1) * queryString.length; assertEquals(numTimesUsed, compiledQueryUsedCount); } });
CacheClientNotifier ccn = CacheClientNotifier.getInstance(); CacheClientProxy proxy = ((HAContainerWrapper)ccn.getHaContainer()).getProxy( region.getName()); logger.debug("Processing FilterInfo for proxy: {} : {}", proxy, msg);
@Override protected final boolean operateOnPartitionedRegion( final DistributionManager dm, PartitionedRegion r, long startTime) throws ForceReattemptException { if (logger.isTraceEnabled(LogMarker.DM)) { logger.debug("PRTombstoneMessage operateOnRegion: {}", r.getFullPath()); } FilterProfile fp = r.getFilterProfile(); if (this.keys != null && this.keys.size() > 0) { // sanity check if (fp != null && CacheClientNotifier.getInstance() != null && this.eventID != null) { RegionEventImpl regionEvent = new RegionEventImpl(r, Operation.REGION_DESTROY, null, true, r.getGemFireCache().getMyId()); regionEvent.setLocalFilterInfo(fp.getLocalFilterRouting(regionEvent)); ClientUpdateMessage clientMessage = ClientTombstoneMessage.gc(r, this.keys, this.eventID); CacheClientNotifier.notifyClients(regionEvent, clientMessage); } } return true; }
CacheClientNotifier ccn = CacheClientNotifier.getInstance(); if (ccn == null || ccn.getHaContainer() == null) { logger.info("HA Container not found during HA Region GII for {}", haReg); return; ClientProxyMembershipID clientID = ((HAContainerWrapper)ccn.getHaContainer()).getProxyID(haReg.getName()); if (clientID == null) { throw new ReplyException("Client proxy ID not found for queue " + haReg.getName()); clientProxy = ccn.getClientProxy(clientID); if (clientProxy == null) { throw new ReplyException("Client proxy not found for queue " + haReg.getName());
public boolean done() { try { // Get the clientMessagesRegion and check the size. Region region = cache.getRegion("/" + regionName); int sz = region.size(); if (regionSize.intValue() != sz) { excuse = "Expected regionSize = " + regionSize.intValue() + ", actual = " + sz; return false; } Iterator iter = cache.getBridgeServers().iterator(); if (!iter.hasNext()) { return true; } BridgeServerImpl server = (BridgeServerImpl)iter.next(); sz = server.getAcceptor().getCacheClientNotifier().getHaContainer().size(); if (sz != msgsRegionsize.intValue()) { excuse = "Expected msgsRegionsize = " + msgsRegionsize.intValue() + ", actual = " + sz; return false; } return true; } catch (Exception e) { excuse = "failed due to " + e; return false; } } public String description() {
private boolean initializeProxy(CacheClientProxy l_proxy) throws IOException, CacheException { boolean status = false; if (!this.isProxyInInitializationMode(l_proxy)){ if (logger.isDebugEnabled()) { logger.debug("Initializing proxy: {}", l_proxy); } try { // Add client proxy to initialization list. This has to be done before // the queue is created so that events can be buffered here for delivery // to the queue once it's initialized (bug #41681 and others) addClientInitProxy(l_proxy); l_proxy.initializeMessageDispatcher(); // Initialization success. Add to client proxy list. addClientProxy(l_proxy); return true; } catch (RegionExistsException ree) { if (logger.isDebugEnabled()) { String name = ree.getRegion() != null ? ree.getRegion().getFullPath() : "null region"; logger.debug("Found RegionExistsException while initializing proxy. Region name: {}", name); } // This will return false; } finally { removeClientInitProxy(l_proxy); } } return status; }
/** * Returns the <code>CacheClientProxy</code> associated to the * durableClientId * * @return the <code>CacheClientProxy</code> associated to the * durableClientId */ public CacheClientProxy getClientProxy(String durableClientId) { return getClientProxy(durableClientId, false); }
HAContainerWrapper haContainer = (HAContainerWrapper)ccn.getHaContainer(); if (haContainer == null) { String reason = " was not found during get event value request"; ccn.getClientProxy(servConn.getProxyID()).getStatistics().incDeltaFullMessagesSent(); if (logger.isDebugEnabled()) { logger.debug("{}: Wrote get event value response back to {} for ha container {}", servConn.getName(), servConn.getSocketString(), haContainer.getName());
public void run2() throws CacheException { try { final CacheClientNotifier ccnInstance = CacheClientNotifier .getInstance(); final CacheClientProxy clientProxy = ccnInstance .getClientProxy(durableClientId); ClientProxyMembershipID proxyId = clientProxy.getProxyID(); CqService cqService = CqService.getCqService(CacheServerTestUtil.getCache()); List<String> cqNames = cqService.getAllDurableClientCqs(proxyId); assertEquals(expectedNumber, cqNames.size()); } catch (Exception e) { throw new CacheException(e){}; } } });
public static synchronized void updateBBWithServerVMNames() { int myVMid = RemoteTestModule.getMyVmid(); ClientVmInfo myInfo = new ClientVmInfo(new Integer(myVMid), RemoteTestModule.getMyClientName(), null); Collection<CacheClientProxy> coll = CacheClientNotifier.getInstance() .getClientProxies(); if (coll.size() > 0) { VMotionBB.getBB().getSharedMap().put(myInfo.getClientName(), myInfo); Log.getLogWriter().info("server vm name is ::" + myInfo.getClientName()); } }
query = ccn.getCompiledQuery(queryString); if (query == null) { ccn.addCompiledQuery((DefaultQuery)query); ccn.getStats().incCompiledQueryUsedCount(1); ((DefaultQuery)query).setLastUsed(true); } else {
/** queue a tombstone GC message for the client. See bug #46832 */ public static void tombstonegc() throws Exception { LocalRegion r = (LocalRegion)cache.getRegion("/"+REGION_NAME); assertNotNull(r); DistributedMember id = r.getCache().getDistributedSystem().getDistributedMember(); RegionEventImpl regionEvent = new RegionEventImpl(r, Operation.REGION_DESTROY, null, true, id); FilterInfo clientRouting = r.getFilterProfile().getLocalFilterRouting(regionEvent); assertTrue(clientRouting.getInterestedClients().size() > 0); regionEvent.setLocalFilterInfo(clientRouting); Map<VersionSource, Long> map = Collections.emptyMap(); ClientTombstoneMessage message = ClientTombstoneMessage.gc( r, map, new EventID(r.getCache().getDistributedSystem())); CacheClientNotifier.notifyClients(regionEvent, message); }
public void run2() throws CacheException { for (Iterator bi = getCache().getCacheServers().iterator(); bi.hasNext(); ) { BridgeServerImpl bsi = (BridgeServerImpl) bi.next(); final CacheClientNotifierStats ccnStats = bsi.getAcceptor().getCacheClientNotifier().getStats(); WaitCriterion ev = new WaitCriterion() { public boolean done() { return ccnStats.getClientRegisterRequests() == ccnStats.getClientUnRegisterRequests(); } public String description() { return null; } }; DistributedTestCase.waitForCriterion(ev, 62 * 1000, 200, true); assertEquals("HealthMonitor Client Register/UnRegister mismatch.", ccnStats.getClientRegisterRequests(), ccnStats.getClientUnRegisterRequests()); } } };
ccnSingleton = new CacheClientNotifier(cache, acceptorStats, maximumMessageCount, messageTimeToLive, transactionTimeToLive, listener, overflowAttributesList, isGatewayReceiver);
public void run2() throws CacheException { long compiledQueryCount = CacheClientNotifier.getInstance().getStats().getCompiledQueryCount(); assertEquals(queryString.length, compiledQueryCount); } });
CacheClientNotifier ccn = CacheClientNotifier.getInstance(); CacheClientProxy proxy; try { proxy = ((HAContainerWrapper)ccn.getHaContainer()).getProxy( region.getName()); } catch (Exception ex) {
@Override protected void notifyClientsOfTombstoneGC(Map<VersionSource, Long> regionGCVersions, Set<Object>removedKeys, EventID eventID, FilterInfo routing) { if (CacheClientNotifier.getInstance() != null) { // Only route the event to clients interested in the partitioned region. // We do this by constructing a region-level event and then use it to // have the filter profile ferret out all of the clients that have interest // in this region FilterProfile fp = getFilterProfile(); if ((removedKeys != null && removedKeys.size() > 0) // bug #51877 - NPE in clients && (routing != null || fp != null)) { // fix for bug #46309 - don't send null/empty key set to clients RegionEventImpl regionEvent = new RegionEventImpl(getPartitionedRegion(), Operation.REGION_DESTROY, null, true, getMyId()); FilterInfo clientRouting = routing; if (clientRouting == null) { clientRouting = fp.getLocalFilterRouting(regionEvent); } regionEvent.setLocalFilterInfo(clientRouting); ClientUpdateMessage clientMessage = ClientTombstoneMessage.gc(getPartitionedRegion(), removedKeys, eventID); CacheClientNotifier.notifyClients(regionEvent, clientMessage); } } }