/** * Return the time in sec to wait before removing unresponsive members * from the distributed system. This period starts after the ack-wait-threshold * period has elapsed */ protected int getSevereAlertThreshold() { return this.system.getConfig().getAckSevereAlertThreshold(); }
public DistributionConfig getConfig() { DistributionConfig result = null; InternalDistributedSystem sys = getSystem(); if (sys != null) { result = system.getConfig(); } return result; }
/** * 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(); }
/** * Returns the distribution configuration for this test. This is * needed primarily for starting the JMX agent. * * @since 4.0 */ public DistributionConfig getDistributionConfig() { return this.getSystem().getConfig(); }
public static void connect( ) throws Exception { ds = DistributedSystem.connect( new Properties() ); InternalDistributedSystem ids = (InternalDistributedSystem) ds; DistributionConfig dc = ids.getConfig(); System.out.println( "DistributionConfig : " + dc ); if ( ! ds.isConnected() ) { throw new Exception( "DistributedSystem is not connected." ); } }
public static void connect( ) throws Exception { ds = DistributedSystem.connect( new Properties() ); InternalDistributedSystem ids = (InternalDistributedSystem) ds; DistributionConfig dc = ids.getConfig(); System.out.println( "DistributionConfig : " + dc ); if ( ! ds.isConnected() ) { throw new Exception( "DistributedSystem is not connected." ); } }
@Override public final long getArchiveFileSizeLimit() { if (fileSizeLimitInKB()) { // use KB instead of MB to speed up rolling for testing return ((long)this.con.getConfig().getArchiveFileSizeLimit()) * (1024); } else { return ((long)this.con.getConfig().getArchiveFileSizeLimit()) * (1024*1024); } }
@Override public final long getArchiveDiskSpaceLimit() { if (fileSizeLimitInKB()) { // use KB instead of MB to speed up removal for testing return ((long)this.con.getConfig().getArchiveDiskSpaceLimit()) * (1024); } else { return ((long)this.con.getConfig().getArchiveDiskSpaceLimit()) * (1024*1024); } }
@Override public final long getArchiveDiskSpaceLimit() { if (fileSizeLimitInKB()) { // use KB instead of MB to speed up removal for testing return ((long)this.con.getConfig().getArchiveDiskSpaceLimit()) * (1024); } else { return ((long)this.con.getConfig().getArchiveDiskSpaceLimit()) * (1024*1024); } }
public boolean isDurableClient() { boolean isDurable = false; InternalDistributedSystem system = InternalDistributedSystem.getAnyInstance(); DistributionConfig config = system.getConfig(); String durableClientId = config.getDurableClientId(); isDurable = durableClientId != null && durableClientId.length() > 0; return isDurable; }
public void test009GetStatisticSamplingEnabled() { 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.STATISTIC_SAMPLING_ENABLED_NAME, "true"); DistributionConfig config = createSystem(props).getConfig(); assertEquals(true, config.getStatisticSamplingEnabled()); }
/** * Redirects the standard out and standard err to the configured log file as specified in the GemFire distributed * system properties. * * @param distributedSystem the GemFire model for a distributed system. * @throws IOException if the standard out and err redirection was unsuccessful. */ protected void redirectOutput(final DistributedSystem distributedSystem) throws IOException { if (distributedSystem instanceof InternalDistributedSystem) { OSProcess.redirectOutput(((InternalDistributedSystem) distributedSystem).getConfig().getLogFile()); } }
protected void redirectOutputToLogFile(InternalDistributedSystem system) throws Exception { DistributionConfig config = system.getConfig(); OSProcess.redirectOutput(config.getLogFile()); }
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; }
/** * Gets the name of the member in the GemFire distributed system as determined by the 'name' GemFire property. * Note, this call only works if the API is used in-process. * * @return a String value indicating the name of the member in the GemFire distributed system. */ public String getMemberName() { final InternalDistributedSystem distributedSystem = InternalDistributedSystem.getConnectedInstance(); return (distributedSystem != null ? distributedSystem.getConfig().getName() : null); }
private void stopMemcachedServer() { if (this.memcachedServer != null) { logger.info(LocalizedMessage.create(LocalizedStrings.GemFireCacheImpl_MEMCACHED_SERVER_ON_PORT_0_IS_SHUTTING_DOWN, new Object[] { this.system.getConfig().getMemcachedPort() })); this.memcachedServer.shutdown(); } }
public void test011MembershipPortRange() { Properties props = new Properties(); props.setProperty("mcast-port", "0"); props.setProperty("locators", ""); props.setProperty(DistributionConfig.MEMBERSHIP_PORT_RANGE_NAME, "5100-5200"); DistributionConfig config = createSystem(props).getConfig(); assertEquals(5100, config.getMembershipPortRange()[0]); assertEquals(5200, config.getMembershipPortRange()[1]); }
public void run() { // validate config level of LogWriter InternalDistributedSystem sys = getSystem(); Config conf = sys.getConfig(); Object value = conf.getAttributeObject("log-level"); assertEquals(oldLogLevel, value); // validate runtime level of LogWriter (requires bugfix 35320) LogWriter logWriter = sys.getLogWriter(); assertTrue(logWriter.warningEnabled()); assertTrue(logWriter.infoEnabled()); } });
@Override public void execute(FunctionContext context) { Log.getLogWriter().info( opPrefix + "Invoking fire and forget onMembers() function"); ArrayList list = new ArrayList(); DistributionConfig dc = ((InternalDistributedSystem) InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); Log.getLogWriter().info(opPrefix + "Updating the BB list"); } });
public void execute(FunctionContext context) { Log.getLogWriter().info( "Invoking fire and forget onServers() function"); ArrayList list = new ArrayList(); DistributionConfig dc = ((InternalDistributedSystem)InternalDistributedSystem .getAnyInstance()).getConfig(); list.add(dc.getCacheXmlFile()); Log.getLogWriter().info("Updating the BB list"); InitImageBB.getBB().getSharedMap().put("List", list); }