this.name = other.getName(); this.tcpPort = other.getTcpPort(); this.mcastPort = other.getMcastPort(); this.mcastTtl = other.getMcastTtl(); this.socketLeaseTime = other.getSocketLeaseTime(); this.socketBufferSize = other.getSocketBufferSize(); this.conserveSockets = other.getConserveSockets(); this.roles = other.getRoles(); this.mcastAddress = other.getMcastAddress(); this.bindAddress = other.getBindAddress(); this.serverBindAddress = other.getServerBindAddress(); this.locators = ((DistributionConfigImpl)other).locators; this.locatorWaitTime = other.getLocatorWaitTime(); this.remoteLocators = other.getRemoteLocators(); this.startLocator = other.getStartLocator(); this.startLocatorPort = ((DistributionConfigImpl)other).startLocatorPort; this.deployWorkingDir = other.getDeployWorkingDir(); this.logFile = other.getLogFile(); this.logLevel = other.getLogLevel(); this.statisticSamplingEnabled = other.getStatisticSamplingEnabled(); this.statisticSampleRate = other.getStatisticSampleRate(); this.statisticArchiveFile = other.getStatisticArchiveFile(); this.ackWaitThreshold = other.getAckWaitThreshold(); this.ackForceDisconnectThreshold = other.getAckSevereAlertThreshold(); this.cacheXmlFile = other.getCacheXmlFile(); this.archiveDiskSpaceLimit = other.getArchiveDiskSpaceLimit(); this.archiveFileSizeLimit = other.getArchiveFileSizeLimit(); this.logDiskSpaceLimit = other.getLogDiskSpaceLimit(); this.logFileSizeLimit = other.getLogFileSizeLimit();
gemFirePropertyData.setMemberName(config.getName()); gemFirePropertyData.setMemberGroups(memberGroups); gemFirePropertyData.setMcastPort(config.getMcastPort()); gemFirePropertyData.setMcastAddress(config.getMcastAddress() .getHostAddress()); gemFirePropertyData.setBindAddress(config.getBindAddress()); gemFirePropertyData.setTcpPort(config.getTcpPort()); gemFirePropertyData.setCacheXMLFile(config.getCacheXmlFile() .getAbsolutePath()); gemFirePropertyData.setConfigFile(configFile); gemFirePropertyData.setMcastTTL(config.getMcastTtl()); gemFirePropertyData.setServerBindAddress(config.getServerBindAddress()); gemFirePropertyData.setLocators(config.getLocators()); gemFirePropertyData.setStartLocator(config.getStartLocator()); gemFirePropertyData.setLogFile(config.getLogFile().getAbsolutePath()); gemFirePropertyData.setLogLevel(config.getLogLevel()); gemFirePropertyData.setStatisticSamplingEnabled(config .getStatisticSamplingEnabled()); .getStatisticArchiveFile().getAbsolutePath()); gemFirePropertyData.setIncludeFile(includeFile); gemFirePropertyData.setAckWaitThreshold(config.getAckWaitThreshold()); .getAckSevereAlertThreshold()); .getArchiveFileSizeLimit()); .getArchiveDiskSpaceLimit()); gemFirePropertyData.setLogFileSizeLimit(config.getLogFileSizeLimit());
this.name = other.getName(); this.tcpPort = other.getTcpPort(); this.mcastPort = other.getMcastPort(); this.mcastTtl = other.getMcastTtl(); this.socketLeaseTime = other.getSocketLeaseTime(); this.socketBufferSize = other.getSocketBufferSize(); this.conserveSockets = other.getConserveSockets(); this.roles = other.getRoles(); this.mcastAddress = other.getMcastAddress(); this.bindAddress = other.getBindAddress(); this.serverBindAddress = other.getServerBindAddress(); this.locators = ((DistributionConfigImpl)other).locators; this.remoteLocators = other.getRemoteLocators(); this.startLocator = other.getStartLocator(); this.startLocatorPort = ((DistributionConfigImpl)other).startLocatorPort; this.deployWorkingDir = other.getDeployWorkingDir(); this.logFile = other.getLogFile(); this.logLevel = other.getLogLevel(); this.statisticSamplingEnabled = other.getStatisticSamplingEnabled(); this.statisticSampleRate = other.getStatisticSampleRate(); this.statisticArchiveFile = other.getStatisticArchiveFile(); this.ackWaitThreshold = other.getAckWaitThreshold(); this.ackForceDisconnectThreshold = other.getAckSevereAlertThreshold(); this.cacheXmlFile = other.getCacheXmlFile(); this.archiveDiskSpaceLimit = other.getArchiveDiskSpaceLimit(); this.archiveFileSizeLimit = other.getArchiveFileSizeLimit(); this.logDiskSpaceLimit = other.getLogDiskSpaceLimit(); this.logFileSizeLimit = other.getLogFileSizeLimit(); this.sslEnabled = other.getSSLEnabled();
this.mcastAddress = InetAddressUtil.toString(distConfig.getMcastAddress()); this.mcastPort = distConfig.getMcastPort(); this.locators = distConfig.getLocators(); this.membershipPortRange = getMembershipPortRangeString(distConfig.getMembershipPortRange()); this.systemName = distConfig.getName(); this.sslEnabled = distConfig.getSSLEnabled(); this.sslCiphers = distConfig.getSSLCiphers(); this.sslProtocols = distConfig.getSSLProtocols(); this.sslAuthenticationRequired = distConfig.getSSLRequireAuthentication(); this.logFile = distConfig.getLogFile().getPath(); this.logLevel = LogWriterImpl.levelToString(distConfig.getLogLevel()); this.logDiskSpaceLimit = distConfig.getLogDiskSpaceLimit(); this.logFileSizeLimit = distConfig.getLogFileSizeLimit(); basicSetBindAddress(distConfig.getBindAddress()); this.tcpPort = distConfig.getTcpPort(); this.disableTcp = distConfig.getDisableTcp(); this.serverBindAddress = distConfig.getServerBindAddress(); this.enableNetworkPartitionDetection = distConfig.getEnableNetworkPartitionDetection(); this.memberTimeout = distConfig.getMemberTimeout(); this.refreshInterval = DistributedSystemConfig.DEFAULT_REFRESH_INTERVAL; this.gfSecurityProperties = (Properties) distConfig.getSSLProperties().clone();
assertEquals(DistributionConfig.DEFAULT_NAME, config.getName()); assertEquals(0, config.getMcastPort()); assertEquals(DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[0], config.getMembershipPortRange()[0]); assertEquals(DistributionConfig.DEFAULT_MEMBERSHIP_PORT_RANGE[1], config.getMembershipPortRange()[1]); assertEquals(DistributionConfig.DEFAULT_MCAST_ADDRESS, config.getMcastAddress()); assertEquals(DistributionConfig.DEFAULT_BIND_ADDRESS, config.getBindAddress()); assertEquals(DistributionConfig.DEFAULT_LOG_FILE, config.getLogFile()); config.getStatisticSamplingEnabled()); config.getStatisticSampleRate()); config.getStatisticArchiveFile()); assertEquals(DistributionConfig.DEFAULT_ACK_SEVERE_ALERT_THRESHOLD, config.getAckSevereAlertThreshold()); assertEquals(DistributionConfig.DEFAULT_CACHE_XML_FILE, config.getCacheXmlFile()); assertEquals(DistributionConfig.DEFAULT_ARCHIVE_DISK_SPACE_LIMIT, config.getArchiveDiskSpaceLimit()); assertEquals(DistributionConfig.DEFAULT_ARCHIVE_FILE_SIZE_LIMIT, config.getArchiveFileSizeLimit()); assertEquals(DistributionConfig.DEFAULT_LOG_DISK_SPACE_LIMIT, config.getLogDiskSpaceLimit()); assertEquals(DistributionConfig.DEFAULT_LOG_FILE_SIZE_LIMIT, config.getLogFileSizeLimit()); assertEquals(DistributionConfig.DEFAULT_ENABLE_NETWORK_PARTITION_DETECTION, config.getEnableNetworkPartitionDetection());
DistributionConfig me = this.getConfig(); if (!me.getBindAddress().equals(other.getBindAddress())) { return false; if (me.getMcastPort() != 0) { return me.getMcastPort() == other.getMcastPort() && me.getMcastAddress().equals(other.getMcastAddress()); String myLocators = me.getLocators(); String otherLocators = other.getLocators();
String locators = dsc.getLocators(); if (locators == null || locators.equals("")) { sb.append("using multicast "); sb.append(dsc.getMcastAddress()); sb.append(":"); sb.append(dsc.getMcastPort());
if (dc.getMcastPort() != 0 && dc.getLocators().trim().isEmpty() && dc.getStartLocator().trim().isEmpty()) { throw new GemFireConfigException( "Multicast cannot be configured for a non-distributed cache." + " Please configure the locator services for this cache using " services.getMessenger().addHandler(NetworkPartitionMessage.class, this); int ackCollectionTimeout = dc.getMemberTimeout() * 2 * 12437 / 10000; if (ackCollectionTimeout < 1500) { ackCollectionTimeout = 1500; this.viewAckTimeout = ackCollectionTimeout; this.quorumRequired = services.getConfig().getDistributionConfig().getEnableNetworkPartitionDetection(); String bindAddr = dconfig.getBindAddress(); locators = GMSUtil.parseLocators(dconfig.getLocators(), bindAddr);
if (this.originalConfig.getLocators().equals("")) { if (this.originalConfig.getMcastPort() != 0) { throw new GemFireConfigException("The " + DistributionConfig.LOCATORS_NAME final boolean hasLogFile = this.config.getLogFile() != null && !this.config.getLogFile().equals(new File("")); final boolean hasSecurityLogFile = this.config.getSecurityLogFile() != null && !this.config.getSecurityLogFile().equals(new File("")); LogService.configureLoggers(hasLogFile, hasSecurityLogFile); if (hasLogFile || hasSecurityLogFile) { HandShake.initCertsMap(this.config.getSecurityProps()); HandShake.initPrivateKey(this.config.getSecurityProps()); HandShake.initDHKeys(this.config); final long offHeapMemorySize = OffHeapStorage.parseOffHeapMemorySize(getConfig().getOffHeapMemorySize()); if (getConfig().getLockMemory()) { this.config.close(); throw ex;
if (this.originalConfig.getMcastPort() == 0 && this.originalConfig.getLocators().equals("")) { this.logger.fine("LogWriter is created."); File securityLogFile = config.getSecurityLogFile(); if (securityLogFile == null || securityLogFile.equals(new File(""))) { this.securityLogger = new SecurityLogWriter(config .getSecurityLogLevel(), this.logger); HandShake.initCertsMap(this.config.getSecurityProps()); HandShake.initPrivateKey(this.config.getSecurityProps()); HandShake.initDHKeys(this.config); final long offHeapMemorySize = OffHeapStorage.parseOffHeapMemorySize(getConfig().getOffHeapMemorySize()); if (getConfig().getLockMemory()) { File securityLogFile = config.getSecurityLogFile(); if (this.securityLogger instanceof ManagerLogWriter && securityLogFile != null && !securityLogFile.equals(new File(""))) { this.config.close(); throw ex;
String serverBindAddress = config.getServerBindAddress(); MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean(); memberInfo.setGroups(config.getGroups()); memberInfo.setLogFilePath(config.getLogFile().getCanonicalPath()); memberInfo.setStatArchiveFilePath(config.getStatisticArchiveFile().getCanonicalPath()); memberInfo.setWorkingDirPath(System.getProperty("user.dir")); memberInfo.setCacheXmlFilePath(config.getCacheXmlFile().getCanonicalPath()); memberInfo.setLocators(config.getLocators()); memberInfo.setServerBindAddress(serverBindAddress); memberInfo.setOffHeapMemorySize(config.getOffHeapMemorySize());
/** * 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(); }
protected static void connectAdminSystem() throws Exception { assertTrue(!system.getConfig().getLocators().equals("")); DistributedSystemConfig config = AdminDistributedSystemFactory.defineDistributedSystem(system, null); assertEquals(system.getConfig().getLocators(), config.getLocators()); assertEquals(system.getConfig().getMcastPort(), config.getMcastPort()); getLogWriter().info("Locators are: " + config.getLocators() + ", mcast port is: " + config.getMcastPort()); AdminDistributedSystem admin = AdminDistributedSystemFactory.getDistributedSystem(config); admin.connect(); assertTrue(admin.waitToBeConnected(5 * 1000)); }
final long msAW = this.owner.getDM().getConfig().getAckWaitThreshold() * 1000; final long msSA = this.owner.getDM().getConfig().getAckSevereAlertThreshold() * 1000; ackTimeoutTask = new SystemTimer.SystemTimerTask() { @Override
@Override public boolean getDisableAutoReconnect() { return jgmm.getDistributionConfig().getDisableAutoReconnect(); }
private InetAddress initAddress(DistributionConfig dc) { String bindAddress = dc.getBindAddress(); try { /* note: had to change the following to make sure the prop wasn't empty in addition to not null for admin.DistributedSystemFactory */ if (bindAddress != null && bindAddress.length() > 0) { return InetAddress.getByName(bindAddress); } else { return SocketCreator.getLocalHost(); } } catch (java.net.UnknownHostException unhe) { throw new RuntimeException(unhe); } }
/** * Creates a new local distribution manager * * @param system * The distributed system to which this distribution manager * will send messages. * */ public LonerDistributionManager(InternalDistributedSystem system, InternalLogWriter logger) { this.system = system; this.logger = logger; this.id = generateMemberId(); this.allIds = Collections.singleton(id); this.viewMembers = new ArrayList<InternalDistributedMember>(allIds); DistributionStats.enableClockStats = this.system.getConfig().getEnableTimeStatistics(); }
/** * Returns whether or not the given configuration properties refer * to the same distributed system as this * <code>InternalDistributedSystem</code> connection. * * @since 4.0 */ public boolean sameSystemAs(Properties props) { DistributionConfig other = DistributionConfigImpl.produce(props); DistributionConfig me = this.getConfig(); if (!me.getBindAddress().equals(other.getBindAddress())) { return false; } // @todo Do we need to compare SSL properties? // locators String myLocators = me.getLocators(); String otherLocators = other.getLocators(); // quick check if (myLocators.equals(otherLocators)) { return true; } else { myLocators = canonicalizeLocators(myLocators); otherLocators = canonicalizeLocators(otherLocators); return myLocators.equals(otherLocators); } }
String serverBindAddress = config.getServerBindAddress(); if (serverBindAddress != null && serverBindAddress.length() > 0) { hostName = serverBindAddress; } else { String bindAddress = config.getBindAddress(); if (bindAddress != null && bindAddress.length() > 0) { hostName = bindAddress;
CachePerfStats.enableClockStats = this.system.getConfig().getEnableTimeStatistics(); String memorySizeStr = getSystem().getConfig().getMemorySize(); long memorySize = ClientSharedUtils.parseMemorySize(memorySizeStr, 0L, 0); boolean usingDefaultMemorySize = false; Properties userProps = this.system.getConfig().getUserDefinedProps(); if (userProps != null && !userProps.isEmpty()) { resolver = new CacheXmlPropertyResolver(false,