/** * Return the time in sec to wait before sending an alert while * waiting for ack replies. Note that the ack wait threshold may * change at runtime, so we have to consult the system every time. */ protected int getAckWaitThreshold() { return this.system.getConfig().getAckWaitThreshold(); }
/** * Return the time in sec to wait before sending an alert while * waiting for ack replies. Note that the ack wait threshold may * change at runtime, so we have to consult the system every time. */ protected int getAckWaitThreshold() { return this.system.getConfig().getAckWaitThreshold(); }
/** * Return the time in sec to wait before sending an alert while * waiting for ack replies. Note that the ack wait threshold may * change at runtime, so we have to consult the system every time. */ private int getAckWaitThreshold() { return dm.getConfig().getAckWaitThreshold(); }
/** * Return the time in sec to wait before sending an alert while * waiting for ack replies. Note that the ack wait threshold may * change at runtime, so we have to consult the system every time. */ private int getAckWaitThreshold() { return dm.getConfig().getAckWaitThreshold(); }
@Override public int getAckWaitThreshold() { return jgmm.getDistributionConfig().getAckWaitThreshold(); }
public MembershipChangeListener() { long waitThreshold = advisor.getDistributionManager().getConfig().getAckWaitThreshold(); warningTime = System.nanoTime() + TimeUnit.SECONDS.toNanos(waitThreshold); }
/** * @deprecated This test cannot be run because the * gemfire.ack-wait-threshold system property is set on this VM, * thus overriding the value passed into the API. */ public void _test014GetAckWaitThreshold() { String time = String.valueOf(DistributionConfig.MIN_ACK_WAIT_THRESHOLD); Properties props = new Properties(); // int unusedPort = AvailablePort.getRandomAvailablePort(AvailablePort.JGROUPS); // props.setProperty("mcast-port", String.valueOf(unusedPort)); // a loner is all this test needs props.setProperty("mcast-port", "0"); props.setProperty("locators", ""); props.put(DistributionConfig.ACK_WAIT_THRESHOLD_NAME, time); DistributionConfig config = createSystem(props).getConfig(); assertEquals(Integer.parseInt(time), config.getAckWaitThreshold()); }
private static int getDSTimeoutSecs() { final InternalDistributedSystem dsys = InternalDistributedSystem .getConnectedInstance(); if (dsys != null) { final int timeoutSecs = dsys.getConfig().getAckWaitThreshold(); if (timeoutSecs > 0) { return timeoutSecs; } return WAIT_INFINITE; } return DS_NOTFOUND; }
private static int getDSTimeoutSecs() { final InternalDistributedSystem dsys = InternalDistributedSystem .getConnectedInstance(); if (dsys != null) { final int timeoutSecs = dsys.getConfig().getAckWaitThreshold(); if (timeoutSecs > 0) { return timeoutSecs; } return WAIT_INFINITE; } return DS_NOTFOUND; }
private static int getDSTimeoutSecs() { final InternalDistributedSystem dsys = InternalDistributedSystem .getConnectedInstance(); if (dsys != null) { final int timeoutSecs = dsys.getConfig().getAckWaitThreshold(); if (timeoutSecs > 0) { return timeoutSecs; } return WAIT_INFINITE; } return DS_NOTFOUND; }
public static void waitForSamplerInitialization() { InternalDistributedSystem system = getDistributedSystem(); final GemFireStatSampler sampler = system.getStatSampler(); if (sampler != null) { try { sampler.waitForInitialization(system.getConfig().getAckWaitThreshold() * 1000L); } catch (InterruptedException ie) { checkIfCacheClosing(ie); Thread.currentThread().interrupt(); } } }
public void waitForCurrentOperations() { long timeout = 1000L * this.getDistributionManager().getSystem() .getConfig().getAckWaitThreshold(); waitForCurrentOperations(timeout); }
public void waitForCurrentOperations(LogWriterI18n logger) { long timeout = 1000L * this.getDistributionManager().getSystem() .getConfig().getAckWaitThreshold(); waitForCurrentOperations(logger, timeout); }
protected final InternalDistributedSystem refreshCachedDS() { InternalDistributedSystem sys = DSYS; if (sys == null || !sys.isConnected()) { sys = InternalDistributedSystem.getConnectedInstance(); // still not connected? if (sys == null) { throw InternalDistributedSystem.newDisconnectedException(null); } final int timeoutSecs = sys.getConfig().getAckWaitThreshold(); if (timeoutSecs > 0) { WAIT_THRESHOLD = timeoutSecs; } else { WAIT_THRESHOLD = -1; } DSYS = sys; } return sys; }
public void waitForMembershipChange() throws InterruptedException { long waitThreshold = advisor.getDistributionManager().getConfig().getAckWaitThreshold(); // reduce the first log time from 15secs so that higher layers can report // sooner to user if (waitThreshold >= 5) { waitThreshold = waitThreshold / 5; } final long warningTime = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(waitThreshold); boolean warned = false; synchronized (this) { try { while (!membershipChanged && !isClosed && !doNotWait) { checkInterruptedByShutdownAll(); advisor.getAdvisee().getCancelCriterion().checkCancelInProgress(null); this.wait(100); if (!warned && System.currentTimeMillis() > warningTime) { //logWaitingForMember(allMembersToWaitFor, offlineMembersToWaitFor); advisor.getLogWriter().info(LocalizedStrings.DEBUG, "Waiting for atleast one server to come up."); //logWaitingForMember(); warned = true; } } this.membershipChanged = false; doNotWait = false; } finally { } } } }
/** * Return the {@link InternalDistributedSystem} of this VM. */ protected static final InternalDistributedSystem getDistributedSystem( boolean throwDisconnectException) { InternalDistributedSystem sys = DSYS; if (sys == null || !sys.isConnected()) { sys = InternalDistributedSystem.getConnectedInstance(); // still not connected? if (sys == null) { if (throwDisconnectException) { throw InternalDistributedSystem.newDisconnectedException(null); } else { return null; } } final int timeoutSecs = sys.getConfig().getAckWaitThreshold(); if (timeoutSecs > 0) { WAIT_THRESHOLD = timeoutSecs; } else { WAIT_THRESHOLD = -1; } DSYS = sys; } return sys; }
public void waitForChange(Set<PersistentMemberID> allMembersToWaitFor, Set<PersistentMemberID> offlineMembersToWaitFor) throws InterruptedException { long waitThreshold = advisor.getDistributionManager().getConfig().getAckWaitThreshold();
executor.execute(() -> { long current = System.currentTimeMillis(); long end = current + system.getConfig().getAckWaitThreshold() * 1000L; while (GemFireStore.getBootingInstance() == null && end > current) { try {
long timeout = 1000L * getCache().getDistributedSystem().getConfig().getAckWaitThreshold(); Boolean flushOnClose = !Boolean.getBoolean("gemfire.no-flush-on-close"); // test hook if (!this.cache.forcedDisconnect() &&
long timeout = 1000L * getCache().getDistributedSystem().getConfig().getAckWaitThreshold(); Boolean flushOnClose = !Boolean.getBoolean("gemfire.no-flush-on-close"); // test hook if (!this.cache.forcedDisconnect() &&