/** * This method returns the CacheClientStatus for all the clients that are connected to this * server. This method returns all clients irrespective of whether subscription is enabled or not. * * @return Map of ClientProxyMembershipID against CacheClientStatus objects. */ public static Map getStatusForAllClientsIgnoreSubscriptionStatus() { Map result = new HashMap(); if (ClientHealthMonitor.getInstance() != null) result = ClientHealthMonitor.getInstance().getStatusForAllClients(); return result; }
public static Map getConnectedIncomingGateways() { Map connectedIncomingGateways = null; ClientHealthMonitor chMon = ClientHealthMonitor.getInstance(); if (chMon == null) { connectedIncomingGateways = new HashMap(); } else { connectedIncomingGateways = chMon.getConnectedIncomingGateways(); } return connectedIncomingGateways; }
/** * Caller must synchronize on cache.allClientServersLock * * @return all the clients */ public static Map getConnectedClients(InternalCache cache) { // Get all clients Map allClients = new HashMap(); for (Iterator bsii = cache.getCacheServers().iterator(); bsii.hasNext();) { CacheServerImpl bsi = (CacheServerImpl) bsii.next(); AcceptorImpl ai = bsi.getAcceptor(); if (ai != null && ai.getCacheClientNotifier() != null) { allClients.putAll(ai.getCacheClientNotifier().getAllClients()); } } // Fill in the missing info, if HealthMonitor started if (ClientHealthMonitor.getInstance() != null) ClientHealthMonitor.getInstance().fillInClientInfo(allClients); return allClients; }
@Before public void setUp() { System.setProperty(ClientHealthMonitor.CLIENT_HEALTH_MONITOR_INTERVAL_PROPERTY, Integer.toString(monitorIntervalMillis)); InternalCache mockCache = mock(InternalCache.class); CacheClientNotifierStats mockStats = mock(CacheClientNotifierStats.class); clientHealthMonitor = ClientHealthMonitor.getInstance(mockCache, pingIntervalMillis, mockStats); }
ClientHealthMonitor chMon = ClientHealthMonitor.getInstance(); Set filterProxyIDs = null; if (onlyClientsNotifiedByThisServer) {
/** * Removes an existing <code>CacheClientProxy</code> from the list of known client proxies * * @param proxy The <code>CacheClientProxy</code> to remove */ protected void removeClientProxy(CacheClientProxy proxy) { // this._logger.info(String.format("%s", "removing client proxy " + proxy, new // Exception("stack trace"))); ClientProxyMembershipID client = proxy.getProxyID(); this._clientProxies.remove(client); this._connectionListener.queueRemoved(); this.getCache().cleanupForClient(this, client); if (!(proxy.clientConflation == Handshake.CONFLATION_ON)) { ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); if (chm != null) { chm.numOfClientsPerVersion.decrementAndGet(proxy.getVersion().ordinal()); } } }
@Override public void cmdExecute(final Message clientMessage, final ServerConnection serverConnection, final SecurityService securityService, long start) throws IOException { final boolean isDebugEnabled = logger.isDebugEnabled(); if (isDebugEnabled) { logger.debug("{}: rcv tx: {} from {} rcvTime: {}", serverConnection.getName(), clientMessage.getTransactionId(), serverConnection.getSocketString(), (DistributionStats.getStatTime() - start)); } ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); if (chm != null) chm.receivedPing(serverConnection.getProxyID()); CachedRegionHelper crHelper = serverConnection.getCachedRegionHelper(); writeReply(clientMessage, serverConnection); serverConnection.setAsTrue(RESPONDED); if (isDebugEnabled) { logger.debug("{}: Sent ping reply to {}", serverConnection.getName(), serverConnection.getSocketString()); } }
/** * Adds a new <code>CacheClientProxy</code> to the list of known client proxies * * @param proxy The <code>CacheClientProxy</code> to add */ protected void addClientProxy(CacheClientProxy proxy) throws IOException { // this._logger.info(String.format("%s", "adding client proxy " + proxy)); getCache(); // ensure cache reference is up to date so firstclient state is correct this._clientProxies.put(proxy.getProxyID(), proxy); // Remove this proxy from the init proxy list. removeClientInitProxy(proxy); this._connectionListener.queueAdded(proxy.getProxyID()); if (!(proxy.clientConflation == Handshake.CONFLATION_ON)) { // Delta not supported with conflation ON ClientHealthMonitor chm = ClientHealthMonitor.getInstance(); /* * #41788 - If the client connection init starts while cache/member is shutting down, * ClientHealthMonitor.getInstance() might return null. */ if (chm != null) { chm.numOfClientsPerVersion.incrementAndGet(proxy.getVersion().ordinal()); } } this.timedOutDurableClientProxies.remove(proxy.getProxyID()); }
this.healthMonitor = ClientHealthMonitor.getInstance(internalCache, maximumTimeBetweenPings, this.clientNotifier.getStats());
ClientHealthMonitor chm = ClientHealthMonitor.getInstance();
extractDelta = true; if (!extractDelta && ClientHealthMonitor.getInstance() != null) { extractDelta = ClientHealthMonitor.getInstance().hasDeltaClients();