/** * @return distribution stats, or null if there is no distributed system available */ public static DMStats getDMStats() { InternalDistributedSystem sys = getAnyInstance(); if (sys != null && sys.dm != null) { return sys.dm.getStats(); } return null; }
/** * Returns null if no stats available. */ public DMStats getDMStats() { DM dm = getDM(); if (dm != null) { return dm.getStats(); // fix for bug#34004 } else { return null; } }
/** * Returns null if no stats available. */ public DMStats getDMStats() { DM dm = getDM(); if (dm != null) { return dm.getStats(); // fix for bug#34004 } else { return null; } }
/** * @return distribution stats, or null if there is no distributed system * available */ public static DMStats getDMStats() { InternalDistributedSystem sys = getAnyInstance(); if (sys != null && sys.dm != null) { return sys.dm.getStats(); } return null; }
private void incMessagesInFlight(int val) { dm.getStats().incInitialImageMessagesInFlight(val); }
private void incMessagesInFlight(int val) { dm.getStats().incInitialImageMessagesInFlight(val); }
@Override public Thread newThread(@Nonnull final Runnable command) { final DM dm = Misc.getDistributedSystem().getDistributionManager(); dm.getStats().incThriftProcessingThreadStarts(); Runnable r = () -> { dm.getStats().incNumThriftProcessingThreads(1); try { command.run(); } finally { dm.getStats().incNumThriftProcessingThreads(-1); ConnectionTable.releaseThreadsSockets(); } }; Thread thread = new Thread(interruptibleGroup, r, "ThriftProcessor-" + threadNum.getAndIncrement()); thread.setDaemon(true); return thread; } };
@Override public void commit() throws CommitConflictException { if (logger.isDebugEnabled()) { logger.debug("DistPeerTXStateStub.commit target=" + target); } // [DISTTX] TODO Handle Stats this.dm.getStats().incSentCommitMessages(1L); final Set<DistributedMember> recipients = Collections.singleton(target); this.commitDistTxMsg.setRecipients(recipients); this.dm.putOutgoing(this.commitDistTxMsg); this.commitDistTxMsg.resetRecipients(); }
public static DMStats getDMStats(GemFireCacheImpl gfc) { if (gfc != null) { return gfc.getDistributionManager().getStats(); } else { DMStats result = InternalDistributedSystem.getDMStats(); if (result == null) { result = new LonerDistributionManager.DummyDMStats(); } return result; } }
public static DMStats getDMStats(GemFireCacheImpl gfc) { if (gfc != null) { return gfc.getDistributionManager().getStats(); } else { DMStats result = InternalDistributedSystem.getDMStats(); if (result == null) { result = new LonerDistributionManager.DummyDMStats(); } return result; } }
/** * Gets the DMStats for the vm's DM */ private DMStats getDMStats() { return ((InternalDistributedSystem)getCache().getDistributedSystem()) .getDistributionManager().getStats(); } /**
private void forceQueueFlush() { Connection.FORCE_ASYNC_QUEUE=false; final DMStats stats = getSystem().getDistributionManager().getStats(); WaitCriterion ev = new WaitCriterion() { public boolean done() { return stats.getAsyncThreads() == 0; } public String description() { return "Waiting for async threads to disappear"; } }; DistributedTestCase.waitForCriterion(ev, 10 * 1000, 200, true); }
@Override public void process(DM dm, ReplyProcessor21 processor) { final long startTime = getTimestamp(); if (logger.isTraceEnabled(LogMarker.DM)) { logger.debug("BatchRemovalReplyMessage process invoking reply processor with processorId: {}", this.processorId); } if (processor == null) { if (logger.isTraceEnabled(LogMarker.DM)) { logger.debug("BatchRemovalReplyMessage processor not found"); } return; } processor.process(this); if (logger.isDebugEnabled()) { logger.debug("{} processed {}", processor, this); } dm.getStats().incReplyMessageTime(NanoTimer.getTime() - startTime); }
@Override protected void preWait() { this.waiting = true; DM mgr = getDistributionManager(); this.statStart = mgr.getStats().startReplyWait(); // Note we do not use addMembershipListenerAndGetDistributionManagerIds // because this is the startup message and we do not yet have any // members in the dm's list. mgr.addMembershipListener(this); // Set activeMembers = mgr.addMembershipListenerAndGetDistributionManagerIds(this); // synchronized (this.members) { // for (int i = 0; i < getMembers().length; i++) { // if (!activeMembers.contains(getMembers()[i])) { // memberDeparted(getMembers()[i], false); // } // } // } }
protected void preWait() { waiting = true; DM mgr = getDistributionManager(); statStart = mgr.getStats().startReplyWait(); synchronized (this.members) { Set activeMembers = addListenerAndGetMembers(); processActiveMembers(activeMembers); } }
protected void postWait() { startedWaiting = false; if (this.listenerAdded) { removeListener(); this.listenerAdded = false; } final DM mgr = getDistributionManager(); mgr.getStats().endReplyWait(this.statStart, this.initTime); checkCancellationInPostWait(mgr); }
@Override public void process(final DM dm, final ReplyProcessor21 processor) { final long startTime = getTimestamp(); if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "MoveBucketReplyMessage process invoking reply processor with processorId: {}", this.processorId); } if (processor == null) { if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "MoveBucketReplyMessage processor not found"); } return; } processor.process(this); if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "{} processed {}", processor, this); } dm.getStats().incReplyMessageTime(NanoTimer.getTime() - startTime); }
private void forceQueuing(final Region r) throws CacheException { Connection.FORCE_ASYNC_QUEUE=true; final DMStats stats = getSystem().getDistributionManager().getStats(); r.put("forcekey", "forcevalue"); // wait for the flusher to get its first flush in progress WaitCriterion ev = new WaitCriterion() { public boolean done() { return stats.getAsyncQueueFlushesInProgress() != 0; } public String description() { return "waiting for flushes to start"; } }; DistributedTestCase.waitForCriterion(ev, 2 * 1000, 200, true); }
protected void postWait() { waiting = false; removeListener(); final DM mgr = getDistributionManager(); mgr.getStats().endReplyWait(this.statStart, this.initTime); // Make sure that a cancellation check occurs. // TODO there may be a more elegant place to put this... mgr.getCancelCriterion().checkCancelInProgress(null); }
@Override public final boolean waitForProcessedReplies() throws InterruptedException { try { waitForReplies(0L); } catch (ReplyException re) { final Throwable cause = re.getCause(); re.fixUpRemoteEx(cause); if (cause instanceof TransactionException) { throw (TransactionException)cause; } else { throw re; } } finally { getDistributionManager().getStats().incCommitPhase1Waits(); } return true; }