diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java index 8b859c1cbc14..084330038575 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/DistributedAckRegionCCEDUnitTest.java @@ -41,7 +41,7 @@ import org.apache.geode.distributed.internal.ClusterDistributionManager; import org.apache.geode.distributed.internal.DistributionAdvisor; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberData; import org.apache.geode.internal.cache.DistributedCacheOperation; import org.apache.geode.internal.cache.DistributedRegion; import org.apache.geode.internal.cache.EntryEventImpl; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java index a1b5edb12694..e07b17d1a9c8 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectDUnitTest.java @@ -36,7 +36,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.SECURITY_MANAGER; import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR; import static org.apache.geode.distributed.Locator.getLocator; -import static org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper.getDistribution; +import static org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper.getDistribution; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.apache.geode.test.awaitility.GeodeAwaitility.getTimeout; import static org.apache.geode.test.dunit.Host.getHost; @@ -86,13 +86,12 @@ import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.distributed.DistributedSystemDisconnectedException; import org.apache.geode.distributed.Locator; -import org.apache.geode.distributed.internal.Distribution; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.InternalDistributedSystem.ReconnectListener; import org.apache.geode.distributed.internal.InternalLocator; import org.apache.geode.distributed.internal.ServerLocator; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.examples.SimpleSecurityManager; import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.AvailablePortHelper; @@ -250,9 +249,8 @@ public void testReconnectWithQuorum() throws Exception { locatorVm.invoke(new SerializableRunnable("disable force-disconnect") { @Override public void run() { - Distribution mgr = MembershipManagerHelper - .getDistribution(Locator.getLocator().getDistributedSystem()); - mgr.disableDisconnectOnQuorumLossForTesting(); + MembershipManagerHelper + .disableDisconnectOnQuorumLossForTesting(Locator.getLocator().getDistributedSystem()); } }); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java index 9f71a3978bd6..5ec19b28359a 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithCacheXMLDUnitTest.java @@ -36,7 +36,7 @@ import org.apache.geode.distributed.ServerLauncherParameters; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.MembershipTestHook; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.test.dunit.Invoke; import org.apache.geode.test.dunit.VM; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java index 964383acc336..b51d7f27161b 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/ReconnectWithClusterConfigurationDUnitTest.java @@ -46,7 +46,7 @@ import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService; import org.apache.geode.distributed.internal.InternalLocator; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.test.awaitility.GeodeAwaitility; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/RegionMembershipListenerDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/RegionMembershipListenerDUnitTest.java index a14132305f40..d7bc7d8c691a 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/RegionMembershipListenerDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/RegionMembershipListenerDUnitTest.java @@ -40,7 +40,7 @@ import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.internal.DistributionAdvisor.Profile; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.cache.CacheDistributionAdvisor.CacheProfile; import org.apache.geode.internal.cache.DistributedRegion; import org.apache.geode.test.awaitility.GeodeAwaitility; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/cache30/TXDistributedDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/cache30/TXDistributedDUnitTest.java index d6ad32d9a5e2..afe88f1237b5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/cache30/TXDistributedDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/cache30/TXDistributedDUnitTest.java @@ -65,7 +65,7 @@ import org.apache.geode.distributed.internal.locks.DLockBatch; import org.apache.geode.distributed.internal.locks.DLockService; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.cache.CommitReplyException; import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.InternalRegionArguments; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedMemberDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedMemberDUnitTest.java index 07487e52e91c..ef4ccd4a43e8 100755 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedMemberDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedMemberDUnitTest.java @@ -49,7 +49,8 @@ import org.apache.geode.distributed.internal.HighPriorityAckedMessage; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.gms.GMSMembership; import org.apache.geode.internal.HeapDataOutputStream; import org.apache.geode.test.dunit.Host; import org.apache.geode.test.dunit.SerializableCallable; @@ -306,7 +307,7 @@ public void testPartialIDInMessageReplacedWithFullID() throws Exception { Distribution manager = MembershipManagerHelper.getDistribution(basicGetSystem()); - manager.replacePartialIdentifierInMessage(message); + ((GMSMembership) manager.getMembership()).replacePartialIdentifierInMessage(message); assertFalse(message.getSender().isPartial()); } diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedSystemDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedSystemDUnitTest.java index 4bf80f0dd09e..bde5458fd657 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedSystemDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/DistributedSystemDUnitTest.java @@ -246,7 +246,7 @@ public void testSpecificTcpPort() throws Exception { ClusterDistributionManager dm = (ClusterDistributionManager) system.getDistributionManager(); Distribution mgr = dm.getDistribution(); - assertThat(mgr.getDirectChannelPort()).isEqualTo(this.tcpPort); + assertThat(mgr.getLocalMember().getDirectChannelPort()).isEqualTo(this.tcpPort); } /** diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java index 9aa364d2e125..10c64684a1f0 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/LocatorDUnitTest.java @@ -91,10 +91,10 @@ import org.apache.geode.distributed.internal.MembershipListener; import org.apache.geode.distributed.internal.MembershipTestHook; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipView; import org.apache.geode.internal.AvailablePort; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.tcp.Connection; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java index d3a59bc1e2d9..5cef2bbec976 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/ClusterDistributionManagerDUnitTest.java @@ -61,9 +61,10 @@ import org.apache.geode.distributed.ConfigurationProperties; import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.gms.GMSMembership; import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.test.dunit.Invoke; import org.apache.geode.test.dunit.SerializableRunnable; @@ -171,7 +172,6 @@ public void testSurpriseMemberHandling() { InternalDistributedSystem system = getSystem(); Distribution membershipManager = MembershipManagerHelper.getDistribution(system); - assertThat(membershipManager.isCleanupTimerStarted()).isTrue(); InternalDistributedMember member = new InternalDistributedMember(getIPLiteral(), 12345); @@ -194,7 +194,7 @@ public void testSurpriseMemberHandling() { // now forcibly add it as a surprise member and show that it is reaped long gracePeriod = 5000; long startTime = System.currentTimeMillis(); - long timeout = membershipManager.getSurpriseMemberTimeout(); + long timeout = ((GMSMembership) membershipManager.getMembership()).getSurpriseMemberTimeout(); long birthTime = startTime - timeout + gracePeriod; MembershipManagerHelper.addSurpriseMember(system, member, birthTime); assertThat(membershipManager.isSurpriseMember(member)).as("Member was not a surprise member") diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/RestartOfMemberDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/RestartOfMemberDistributedTest.java index a080a7cab0fc..27b02b460c26 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/RestartOfMemberDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/RestartOfMemberDistributedTest.java @@ -27,7 +27,7 @@ import org.junit.Test; import org.apache.geode.ForcedDisconnectException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; import org.apache.geode.test.dunit.rules.ClusterStartupRule; public class RestartOfMemberDistributedTest { diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentMapOpsDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentMapOpsDUnitTest.java index 6bfbc5a1dca6..c2ef40a9dacb 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentMapOpsDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ConcurrentMapOpsDUnitTest.java @@ -60,8 +60,8 @@ import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.Distribution; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.AvailablePort; import org.apache.geode.test.awaitility.GeodeAwaitility; import org.apache.geode.test.dunit.Host; diff --git a/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java index 8b616fdca542..a1311c6368b5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/internal/metrics/MeterSubregistryReconnectDistributedTest.java @@ -21,7 +21,6 @@ import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT; import static org.apache.geode.distributed.ConfigurationProperties.MEMBER_TIMEOUT; import static org.apache.geode.distributed.ConfigurationProperties.NAME; -import static org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper.getDistribution; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; import static org.apache.geode.test.awaitility.GeodeAwaitility.getTimeout; import static org.apache.geode.test.dunit.IgnoredException.addIgnoredException; @@ -46,9 +45,9 @@ import org.apache.geode.ForcedDisconnectException; import org.apache.geode.cache.CacheFactory; import org.apache.geode.distributed.LocatorLauncher; -import org.apache.geode.distributed.internal.Distribution; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.rules.DistributedRule; @@ -137,9 +136,7 @@ private CompositeMeterRegistry cacheMeterRegistry() { } private void reconnect() throws InterruptedException { - Distribution membershipManager = getDistribution(system); - membershipManager.forceDisconnect("Forcing disconnect in test"); - + MembershipManagerHelper.crashDistributedSystem(system); await().until(() -> system.isReconnecting()); system.waitUntilReconnected(TIMEOUT, MILLISECONDS); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/logging/internal/LoggingWithReconnectDistributedTest.java b/geode-core/src/distributedTest/java/org/apache/geode/logging/internal/LoggingWithReconnectDistributedTest.java index 36b00a5900fc..c61b72d0125d 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/logging/internal/LoggingWithReconnectDistributedTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/logging/internal/LoggingWithReconnectDistributedTest.java @@ -21,7 +21,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; import static org.apache.geode.distributed.ConfigurationProperties.MAX_WAIT_TIME_RECONNECT; import static org.apache.geode.distributed.ConfigurationProperties.MEMBER_TIMEOUT; -import static org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper.getDistribution; +import static org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper.getDistribution; import static org.apache.geode.internal.logging.Banner.BannerHeader.displayValues; import static org.apache.geode.logging.internal.Configuration.STARTUP_CONFIGURATION; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; @@ -48,7 +48,8 @@ import org.apache.geode.distributed.ServerLauncher; import org.apache.geode.distributed.internal.Distribution; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.gms.GMSMembership; import org.apache.geode.test.assertj.LogFileAssert; import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.rules.DistributedRule; @@ -139,7 +140,7 @@ public void logFileContainsBannerOnlyOnce() { server2VM.invoke(() -> { Distribution membershipManager = getDistribution(system); - membershipManager + ((GMSMembership) membershipManager.getMembership()) .forceDisconnect("Forcing disconnect in " + testName.getMethodName()); await().until(() -> system.isReconnecting()); diff --git a/geode-core/src/distributedTest/java/org/apache/geode/security/P2PAuthenticationDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/security/P2PAuthenticationDUnitTest.java index 481826ee1edf..6616d91fc8a5 100644 --- a/geode-core/src/distributedTest/java/org/apache/geode/security/P2PAuthenticationDUnitTest.java +++ b/geode-core/src/distributedTest/java/org/apache/geode/security/P2PAuthenticationDUnitTest.java @@ -44,7 +44,7 @@ import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.Distribution; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.security.generator.CredentialGenerator; import org.apache.geode.security.generator.DummyCredentialGenerator; import org.apache.geode.security.generator.LdapUserCredentialGenerator; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/ClientCacheFactoryJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/ClientCacheFactoryJUnitTest.java index ad4c463dd181..c10453b772c2 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/ClientCacheFactoryJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/ClientCacheFactoryJUnitTest.java @@ -56,7 +56,7 @@ import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.HeapDataOutputStream; import org.apache.geode.internal.cache.GemFireCacheImpl; import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java index db2bd044715e..d8925e6992d7 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImplJUnitTest.java @@ -71,7 +71,7 @@ import org.apache.geode.distributed.internal.PoolStatHelper; import org.apache.geode.distributed.internal.RestartableTcpHandler; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; +import org.apache.geode.distributed.internal.tcpserver.LocatorAddress; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.distributed.internal.tcpserver.TcpServer; import org.apache.geode.internal.AvailablePortHelper; @@ -125,8 +125,8 @@ public void setUp() throws Exception { InetAddress ia = InetAddress.getLocalHost(); InetSocketAddress isa = new InetSocketAddress(ia, port); locators.add(isa); - List la = new ArrayList<>(); - la.add(new HostAddress(isa, ia.getHostName())); + List la = new ArrayList<>(); + la.add(new LocatorAddress(isa, ia.getHostName())); source = new AutoConnectionSourceImpl(la, "", 60 * 1000); source.start(pool); } @@ -187,14 +187,14 @@ public void testLocatorIpChange() { locators.add(floc1); locators.add(floc2); - List la = new ArrayList<>(); - la.add(new HostAddress(floc1, floc1.getHostName())); - la.add(new HostAddress(floc2, floc2.getHostName())); + List la = new ArrayList<>(); + la.add(new LocatorAddress(floc1, floc1.getHostName())); + la.add(new LocatorAddress(floc2, floc2.getHostName())); AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(la, "", 60 * 1000); // This method will create a new InetSocketAddress of floc1 - src.updateLocatorInLocatorList(new HostAddress(floc1, floc1.getHostName())); + src.updateLocatorInLocatorList(new LocatorAddress(floc1, floc1.getHostName())); List cLocList = src.getCurrentLocators(); @@ -218,18 +218,18 @@ public void testAddBadLocator() { InetSocketAddress floc2 = new InetSocketAddress("fakeLocalHost2", port); locators.add(floc1); locators.add(floc2); - List la = new ArrayList<>(); - la.add(new HostAddress(floc1, floc1.getHostName())); - la.add(new HostAddress(floc2, floc2.getHostName())); + List la = new ArrayList<>(); + la.add(new LocatorAddress(floc1, floc1.getHostName())); + la.add(new LocatorAddress(floc2, floc2.getHostName())); AutoConnectionSourceImpl src = new AutoConnectionSourceImpl(la, "", 60 * 1000); InetSocketAddress b1 = new InetSocketAddress("fakeLocalHost1", port); InetSocketAddress b2 = new InetSocketAddress("fakeLocalHost3", port); - Set bla = new HashSet<>(); - bla.add(new HostAddress(b1, b1.getHostName())); - bla.add(new HostAddress(b2, b2.getHostName())); + Set bla = new HashSet<>(); + bla.add(new LocatorAddress(b1, b1.getHostName())); + bla.add(new LocatorAddress(b2, b2.getHostName())); src.addbadLocators(la, bla); @@ -255,7 +255,7 @@ public void testSourceHandlesToDataException() throws IOException, ClassNotFound isA(Integer.class), isA(Boolean.class))).thenThrow(new ToDataException("testing")); try { InetSocketAddress address = new InetSocketAddress(NetworkUtils.getServerHostName(), 1234); - source.queryOneLocatorUsingConnection(new HostAddress(address, "locator[1234]"), mock( + source.queryOneLocatorUsingConnection(new LocatorAddress(address, "locator[1234]"), mock( ServerLocationRequest.class), mockConnection); verify(mockConnection).requestToServer(isA(InetSocketAddress.class), isA(ServerLocationRequest.class), isA(Integer.class), isA(Boolean.class)); diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/LocatorIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/LocatorIntegrationTest.java index cb8252b0555f..31d47a97f7c4 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/LocatorIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/LocatorIntegrationTest.java @@ -50,10 +50,8 @@ import org.junit.runners.Parameterized.Parameters; import org.junit.runners.Parameterized.UseParametersRunnerFactory; -import org.apache.geode.SystemConnectException; import org.apache.geode.distributed.internal.InternalLocator; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.InternalDataSerializer; @@ -100,7 +98,6 @@ public void setUp() throws IOException { @After public void tearDown() { - JGroupsMessenger.THROW_EXCEPTION_ON_START_HOOK = false; if (locator != null) { locator.stop(); } @@ -188,8 +185,6 @@ public void testBasicInfo() throws Exception { @Test public void testNoThreadLeftBehind() throws Exception { - JGroupsMessenger.THROW_EXCEPTION_ON_START_HOOK = true; - Properties configProperties = new Properties(); configProperties.setProperty(MCAST_PORT, "0"); configProperties.setProperty(JMX_MANAGER_START, "false"); @@ -198,9 +193,9 @@ public void testNoThreadLeftBehind() throws Exception { int threadCount = Thread.activeCount(); Throwable thrown = catchThrowable( - () -> locator = Locator.startLocatorAndDS(port, new File(""), configProperties)); + () -> locator = Locator.startLocatorAndDS(-2, new File(""), configProperties)); - assertThat(thrown).isInstanceOf(SystemConnectException.class); + assertThat(thrown).isInstanceOf(IllegalArgumentException.class); for (int i = 0; i < 10; i++) { if (threadCount < Thread.activeCount()) { diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java index 775399e55b98..c752a6d1c3aa 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/DistributionArchUnitTest.java @@ -27,7 +27,7 @@ import org.junit.runner.RunWith; import org.apache.geode.distributed.internal.membership.MembershipJUnitTest; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; +import org.apache.geode.distributed.internal.membership.api.Membership; @RunWith(ArchUnitRunner.class) @AnalyzeClasses(packages = "org.apache.geode", cacheMode = CacheMode.PER_CLASS, @@ -42,6 +42,7 @@ public class DistributionArchUnitTest { .byClassesThat(type(Distribution.class) .or(type(MembershipJUnitTest.class)) // another integrationTest .or(type(DistributionImpl.MyDCReceiver.class)) + .or(resideInAPackage("org.apache.geode.distributed.internal.membership.api..")) .or(resideInAPackage("org.apache.geode.distributed.internal.membership.gms..")) .or(resideInAPackage("org.apache.geode.internal.tcp..")) .or(resideInAPackage("org.apache.geode.distributed.internal.direct..")) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java index 513db626768c..99990bc2e08a 100755 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/MembershipJUnitTest.java @@ -34,6 +34,7 @@ import java.io.File; import java.net.InetAddress; +import java.util.Comparator; import java.util.List; import java.util.Properties; @@ -57,23 +58,17 @@ import org.apache.geode.distributed.internal.SerialAckedMessage; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; import org.apache.geode.distributed.internal.membership.adapter.auth.GMSAuthenticator; -import org.apache.geode.distributed.internal.membership.gms.GMSMemberData; -import org.apache.geode.distributed.internal.membership.gms.GMSMembership; -import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.MemberIdentifierFactoryImpl; -import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifierFactory; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; -import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; -import org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifierFactory; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipBuilder; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.MessageListener; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.InternalDataSerializer; @@ -164,12 +159,7 @@ private List doTestMultipleManagersInSameProcessWithGroups(String groups new RemoteTransportConfig(config, ClusterDistributionManager.NORMAL_DM_TYPE); // start the first membership manager - try { - System.setProperty(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY, "true"); - m1 = createMembershipManager(config, transport).getLeft(); - } finally { - System.getProperties().remove(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY); - } + m1 = createMembershipManager(config, transport).getLeft(); // start the second membership manager final Pair pair = @@ -181,15 +171,15 @@ private List doTestMultipleManagersInSameProcessWithGroups(String groups // manager queues new views for processing through the DM listener, // which is a mock object in this test System.out.println("waiting for views to stabilize"); - JoinLeave jl1 = ((GMSMembership) m1).getServices().getJoinLeave(); - JoinLeave jl2 = ((GMSMembership) m2).getServices().getJoinLeave(); + final Membership mgr1 = m1; + final Membership mgr2 = m2; long giveUp = System.currentTimeMillis() + 15000; for (;;) { try { - assertTrue("view = " + jl2.getView(), jl2.getView().size() == 2); - assertTrue("view = " + jl1.getView(), jl1.getView().size() == 2); - assertTrue(jl1.getView().getCreator().equals(jl2.getView().getCreator())); - assertTrue(jl1.getView().getViewId() == jl2.getView().getViewId()); + assertTrue("view = " + mgr2.getView(), mgr2.getView().size() == 2); + assertTrue("view = " + mgr1.getView(), mgr1.getView().size() == 2); + assertTrue(mgr1.getView().getCreator().equals(mgr2.getView().getCreator())); + assertTrue(mgr1.getView().getViewId() == mgr2.getView().getViewId()); break; } catch (AssertionError e) { if (System.currentTimeMillis() > giveUp) { @@ -198,9 +188,9 @@ private List doTestMultipleManagersInSameProcessWithGroups(String groups } } - GMSMembershipView view = jl1.getView(); + MembershipView view = mgr1.getView(); MemberIdentifier notCreator; - if (view.getCreator().equals(jl1.getMemberID())) { + if (view.getCreator().equals(mgr1.getLocalMember())) { notCreator = view.getMembers().get(1); } else { notCreator = view.getMembers().get(0); @@ -267,10 +257,10 @@ private Pair createMembershipManager( final SecurityService securityService = SecurityServiceFactory.create(); DSFIDSerializer serializer = InternalDataSerializer.getDSFIDSerializer(); final MemberIdentifierFactory memberFactory = mock(MemberIdentifierFactory.class); - when(memberFactory.create(isA(GMSMemberData.class))).thenAnswer(new Answer() { + when(memberFactory.create(isA(MemberData.class))).thenAnswer(new Answer() { @Override public MemberIdentifier answer(InvocationOnMock invocation) throws Throwable { - return new InternalDistributedMember((GMSMemberData) invocation.getArgument(0)); + return new InternalDistributedMember((MemberData) invocation.getArgument(0)); } }); LifecycleListener lifeCycleListener = mock(LifecycleListener.class); @@ -284,7 +274,17 @@ public MemberIdentifier answer(InvocationOnMock invocation) throws Throwable { .setConfig(new ServiceConfig(transport, config)) .setSerializer(serializer) .setLifecycleListener(lifeCycleListener) - .setMemberIDFactory(new MemberIdentifierFactoryImpl()) + .setMemberIDFactory(new MemberIdentifierFactory() { + @Override + public InternalDistributedMember create(MemberData memberInfo) { + return new InternalDistributedMember(memberInfo); + } + + @Override + public Comparator getComparator() { + return Comparator.naturalOrder(); + } + }) .setLocatorClient(new TcpClient( asTcpSocketCreator( SocketCreatorFactory @@ -346,12 +346,7 @@ public void testLocatorAndTwoServersJoinUsingDiffeHellman() throws Exception { new RemoteTransportConfig(config, ClusterDistributionManager.NORMAL_DM_TYPE); // start the first membership manager - try { - System.setProperty(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY, "true"); - m1 = createMembershipManager(config, transport).getLeft(); - } finally { - System.getProperties().remove(GMSJoinLeave.BYPASS_DISCOVERY_PROPERTY); - } + m1 = createMembershipManager(config, transport).getLeft(); // start the second membership manager final Pair pair = @@ -363,15 +358,15 @@ public void testLocatorAndTwoServersJoinUsingDiffeHellman() throws Exception { // manager queues new views for processing through the DM listener, // which is a mock object in this test System.out.println("waiting for views to stabilize"); - JoinLeave jl1 = ((GMSMembership) m1).getServices().getJoinLeave(); - JoinLeave jl2 = ((GMSMembership) m2).getServices().getJoinLeave(); + final Membership mgr1 = m1; + final Membership mgr2 = m2; long giveUp = System.currentTimeMillis() + 15000; for (;;) { try { - assertTrue("view = " + jl2.getView(), jl2.getView().size() == 2); - assertTrue("view = " + jl1.getView(), jl1.getView().size() == 2); - assertTrue(jl1.getView().getCreator().equals(jl2.getView().getCreator())); - assertTrue(jl1.getView().getViewId() == jl2.getView().getViewId()); + assertTrue("view = " + mgr2.getView(), mgr2.getView().size() == 2); + assertTrue("view = " + mgr1.getView(), mgr1.getView().size() == 2); + assertTrue(mgr1.getView().getCreator().equals(mgr2.getView().getCreator())); + assertTrue(mgr1.getView().getViewId() == mgr2.getView().getViewId()); break; } catch (AssertionError e) { if (System.currentTimeMillis() > giveUp) { @@ -469,35 +464,4 @@ public void testJoinTimeoutSetting() throws Exception { } - @Test - public void testMulticastDiscoveryNotAllowed() { - Properties nonDefault = new Properties(); - nonDefault.put(DISABLE_TCP, "true"); - nonDefault.put(MCAST_PORT, "12345"); - nonDefault.put(LOG_FILE, ""); - nonDefault.put(LOG_LEVEL, "fine"); - nonDefault.put(LOCATORS, ""); - DistributionConfigImpl config = new DistributionConfigImpl(nonDefault); - RemoteTransportConfig transport = - new RemoteTransportConfig(config, ClusterDistributionManager.NORMAL_DM_TYPE); - - MembershipConfig membershipConfig = new ServiceConfig(transport, config); - - Services services = mock(Services.class); - when(services.getConfig()).thenReturn(membershipConfig); - - GMSJoinLeave joinLeave = new GMSJoinLeave(new TcpClient( - asTcpSocketCreator( - SocketCreatorFactory.setDistributionConfig(config) - .getSocketCreatorForComponent(SecurableCommunicationChannel.LOCATOR)), - InternalDataSerializer.getDSFIDSerializer().getObjectSerializer(), - InternalDataSerializer.getDSFIDSerializer().getObjectDeserializer())); - try { - joinLeave.init(services); - throw new Error( - "expected a GemFireConfigException to be thrown because no locators are configured"); - } catch (MembershipConfigurationException e) { - // expected - } - } } diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/api/CoreOnlyUsesMembershipAPIArchUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/api/CoreOnlyUsesMembershipAPIArchUnitTest.java new file mode 100644 index 000000000000..43d3cb232952 --- /dev/null +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/api/CoreOnlyUsesMembershipAPIArchUnitTest.java @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.distributed.internal.membership.api; + +import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPackage; +import static com.tngtech.archunit.library.Architectures.layeredArchitecture; + +import com.tngtech.archunit.core.domain.JavaClasses; +import com.tngtech.archunit.core.importer.ClassFileImporter; +import com.tngtech.archunit.lang.ArchRule; +import org.junit.Test; + +/** + * This test ensures that various geode packages do not access membership internals. + * It is broken into multiple tests in order to keep memory use low. Analyzing all + * geode classes in a single test requires 1.5g of heap.
+ * This test class can be removed if and when we create an isolated Java module that does + * not export internal membership classes. + */ +public class CoreOnlyUsesMembershipAPIArchUnitTest { + + @Test + public void distributedAndInternalClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode.distributed..", + "org.apache.geode.internal.."); + + checkMembershipAPIUse(importedClasses); + } + + @Test + public void cacheClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode", + "org.apache.geode.cache..", + "org.apache.geode.distributed.internal.membership.."); + + checkMembershipAPIUse(importedClasses); + } + + @Test + public void managementClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode.management..", + "org.apache.geode.admin..", + "org.apache.geode.distributed.internal.membership.."); + + checkMembershipAPIUse(importedClasses); + } + + @Test + public void securityClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode.security..", + "org.apache.geode.distributed.internal.membership.."); + + checkMembershipAPIUse(importedClasses); + } + + @Test + public void pdxClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode.pdx..", + "org.apache.geode.distributed.internal.membership.."); + + checkMembershipAPIUse(importedClasses); + } + + @Test + public void exampleClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode.examples..", + "org.apache.geode.distributed.internal.membership.."); + + checkMembershipAPIUse(importedClasses); + } + + @Test + public void miscCoreClassesDoNotUseMembershipInternals() { + JavaClasses importedClasses = new ClassFileImporter().importPackages( + "org.apache.geode.alerting..", + "org.apache.geode.compression..", + "org.apache.geode.datasource..", + "org.apache.geode.i18n..", + "org.apache.geode.lang..", + "org.apache.geode.logging..", + "org.apache.geode.metrics..", + "org.apache.geode.ra..", + "org.apache.geode.distributed.internal.membership.."); + + checkMembershipAPIUse(importedClasses); + } + + private void checkMembershipAPIUse(JavaClasses importedClasses) { + ArchRule myRule = layeredArchitecture() + .layer("adapter") + .definedBy(resideInAPackage("org.apache.geode.distributed.internal.membership.adapter")) + .layer("internal") + .definedBy(resideInAPackage("org.apache.geode.distributed.internal.membership.gms..")) + .layer("api").definedBy("org.apache.geode.distributed.internal.membership.api") + .whereLayer("internal").mayOnlyBeAccessedByLayers("api", "adapter"); + + myRule.check(importedClasses); + } +} diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipJUnitTest.java index 95ce3264d3b0..ffe14b882d9d 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipJUnitTest.java @@ -58,18 +58,18 @@ import org.apache.geode.distributed.internal.HighPriorityAckedMessage; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; +import org.apache.geode.distributed.internal.membership.api.Authenticator; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.Message; +import org.apache.geode.distributed.internal.membership.api.MessageListener; import org.apache.geode.distributed.internal.membership.gms.GMSMembership.StartupEvent; import org.apache.geode.distributed.internal.membership.gms.Services.Stopper; -import org.apache.geode.distributed.internal.membership.gms.api.Authenticator; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.Message; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; import org.apache.geode.distributed.internal.membership.gms.interfaces.Messenger; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImpl.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImpl.java index 37f40da2557e..5b6e2e40638d 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImpl.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImpl.java @@ -18,8 +18,8 @@ import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifierFactory; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifierFactory; @VisibleForTesting public class MemberIdentifierFactoryImpl diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImplTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImplTest.java index 72ec14ecbb86..69df6ebca4e4 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImplTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierFactoryImplTest.java @@ -25,9 +25,9 @@ import org.junit.Test; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.inet.LocalHostUtil; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MembershipOnlyTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MembershipOnlyTest.java index 0e70f701bdc1..a8005ce75908 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MembershipOnlyTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/MembershipOnlyTest.java @@ -32,11 +32,11 @@ import org.apache.geode.distributed.internal.InternalLocator; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipBuilder; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator; import org.apache.geode.internal.InternalDataSerializer; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java index 2e63f5b6b1b5..1667379e29d5 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java @@ -77,15 +77,15 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.MemberIdentifierFactoryImpl; import org.apache.geode.distributed.internal.membership.gms.Services; import org.apache.geode.distributed.internal.membership.gms.Services.Stopper; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; import org.apache.geode.distributed.internal.membership.gms.fd.GMSHealthMonitor.ClientSocketHandler; import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; import org.apache.geode.distributed.internal.membership.gms.interfaces.Manager; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorIntegrationTest.java index abf65acbf64c..db62c4af3a17 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorIntegrationTest.java @@ -32,10 +32,10 @@ import org.apache.geode.distributed.internal.DistributionConfigImpl; import org.apache.geode.distributed.internal.LocatorStats; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.GMSMembership; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; import org.apache.geode.distributed.internal.membership.gms.interfaces.Messenger; import org.apache.geode.distributed.internal.tcpserver.TcpClient; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java index be5fc806f9a4..883a223dd7a3 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocatorRecoveryIntegrationTest.java @@ -51,11 +51,11 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.InternalLocator; import org.apache.geode.distributed.internal.LocatorStats; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MessageListener; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.internal.AvailablePortHelper; import org.apache.geode.internal.InternalDataSerializer; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java index fde77dbd6afe..9c49907d70f7 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java @@ -57,16 +57,17 @@ import org.apache.geode.distributed.internal.ClusterDistributionManager; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; +import org.apache.geode.distributed.internal.membership.api.Authenticator; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.GMSUtil; import org.apache.geode.distributed.internal.membership.gms.MemberIdentifierFactoryImpl; import org.apache.geode.distributed.internal.membership.gms.Services; import org.apache.geode.distributed.internal.membership.gms.Services.Stopper; -import org.apache.geode.distributed.internal.membership.gms.api.Authenticator; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; import org.apache.geode.distributed.internal.membership.gms.interfaces.Locator; import org.apache.geode.distributed.internal.membership.gms.interfaces.Manager; @@ -1556,6 +1557,25 @@ public void testLeaveRequestWhileWaitingForFinalResponse() throws Exception { gmsJoinLeave.getViewCreator().getTestFlagForRemovalRequest()); } + @Test + public void testMulticastDiscoveryNotAllowed() { + Services services = mock(Services.class); + MembershipConfig membershipConfig = mock(MembershipConfig.class); + when(membershipConfig.getLocators()).thenReturn(""); + when(membershipConfig.getMcastPort()).thenReturn(1234); + when(membershipConfig.getMcastAddress()).thenReturn("scooby.dooby.doo"); + when(services.getConfig()).thenReturn(membershipConfig); + + GMSJoinLeave joinLeave = new GMSJoinLeave(null); + try { + joinLeave.init(services); + throw new Error( + "expected a GemFireConfigException to be thrown because no locators are configured"); + } catch (MembershipConfigurationException e) { + // expected + } + } + private void installView() throws Exception { final int viewInstallationTime = 15000; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptJUnitTest.java index fd36a0bb3702..318acb55ec82 100755 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptJUnitTest.java @@ -33,10 +33,10 @@ import org.apache.geode.distributed.internal.DistributionConfigImpl; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; import org.apache.geode.internal.admin.remote.RemoteTransportConfig; import org.apache.geode.test.junit.categories.MembershipTest; import org.apache.geode.test.junit.rules.ConcurrencyRule; diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java index ee3e628f2904..54ebc20d6e75 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumCheckerJUnitTest.java @@ -41,8 +41,8 @@ import org.apache.geode.distributed.internal.ClusterDistributionManager; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.test.junit.categories.MembershipTest; @Category({MembershipTest.class}) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java index d9e8f46bd18d..dc1590b2089d 100755 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessengerJUnitTest.java @@ -76,15 +76,15 @@ import org.apache.geode.distributed.internal.DistributionStats; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.Message; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.MemberIdentifierFactoryImpl; import org.apache.geode.distributed.internal.membership.gms.Services; import org.apache.geode.distributed.internal.membership.gms.Services.Stopper; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.Message; import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; import org.apache.geode.distributed.internal.membership.gms.interfaces.Manager; diff --git a/geode-core/src/main/java/org/apache/geode/SystemFailure.java b/geode-core/src/main/java/org/apache/geode/SystemFailure.java index dcbbc493ff9d..e04f59458ace 100644 --- a/geode-core/src/main/java/org/apache/geode/SystemFailure.java +++ b/geode-core/src/main/java/org/apache/geode/SystemFailure.java @@ -356,30 +356,6 @@ private static void runWatchDog() { boolean warned = false; logFine(WATCHDOG_NAME, "Starting"); - try { - basicLoadEmergencyClasses(); - } catch (ExceptionInInitializerError e) { - // Determine if we're shutting down... - boolean noSurprise = false; - Throwable cause = e.getCause(); - if (cause != null) { - if (cause instanceof IllegalStateException) { - String msg = cause.getMessage(); - if (msg.contains("Shutdown in progress")) { - noSurprise = true; - } - } - } - if (!noSurprise) { - logWarning(WATCHDOG_NAME, "Unable to load GemFire classes: ", e); - } - return; - } catch (CancelException e) { - // ignore this because we are shutting down anyway - } catch (Throwable t) { - logWarning(WATCHDOG_NAME, "Unable to initialize watchdog", t); - return; - } while (!stopping) { try { if (isCacheClosing) { @@ -723,12 +699,6 @@ private static void runProctor() { private static final String PROCTOR_NAME = "SystemFailure Proctor"; - /** - * break any potential circularity in {@link #loadEmergencyClasses()} - */ - @MakeNotStatic - private static volatile boolean emergencyClassesLoaded = false; - /** * Since it requires object memory to unpack a jar file, make sure this JVM has loaded the classes * necessary for closure before it becomes necessary to use them. @@ -741,15 +711,6 @@ public static void loadEmergencyClasses() { startThreads(); } - private static void basicLoadEmergencyClasses() { - if (emergencyClassesLoaded) - return; - emergencyClassesLoaded = true; - SystemFailureTestHook.loadEmergencyClasses(); // bug 50516 - GemFireCacheImpl.loadEmergencyClasses(); - RemoteGfManagerAgent.loadEmergencyClasses(); - } - /** * Attempt to close any and all GemFire resources. * diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java index aa83a4566595..f9af55b27f2b 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/AutoConnectionSourceImpl.java @@ -50,7 +50,7 @@ import org.apache.geode.cache.client.internal.locator.ServerLocationRequest; import org.apache.geode.cache.client.internal.locator.ServerLocationResponse; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; +import org.apache.geode.distributed.internal.tcpserver.LocatorAddress; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.internal.InternalDataSerializer; import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID; @@ -75,7 +75,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource { private static final LocatorListRequest LOCATOR_LIST_REQUEST = new LocatorListRequest(); @Immutable - private static final Comparator SOCKET_ADDRESS_COMPARATOR = + private static final Comparator SOCKET_ADDRESS_COMPARATOR = (address, otherAddress) -> { InetSocketAddress inetSocketAddress = address.getSocketInetAddress(); InetSocketAddress otherInetSocketAddress = otherAddress.getSocketInetAddress(); @@ -93,7 +93,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource { return inetSocketAddress.getPort() - otherInetSocketAddress.getPort(); } }; - private final List initialLocators; + private final List initialLocators; private final String serverGroup; private AtomicReference locators = new AtomicReference<>(); private AtomicReference onlineLocators = new AtomicReference<>(); @@ -108,7 +108,7 @@ public class AutoConnectionSourceImpl implements ConnectionSource { */ private final Map locatorState = new HashMap<>(); - public AutoConnectionSourceImpl(List contacts, String serverGroup, + public AutoConnectionSourceImpl(List contacts, String serverGroup, int handshakeTimeout) { this.locators.set(new LocatorList(new ArrayList<>(contacts))); this.onlineLocators.set(new LocatorList(Collections.emptyList())); @@ -197,13 +197,13 @@ public List getOnlineLocators() { } - private ServerLocationResponse queryOneLocator(HostAddress locator, + private ServerLocationResponse queryOneLocator(LocatorAddress locator, ServerLocationRequest request) { return queryOneLocatorUsingConnection(locator, request, tcpClient); } - ServerLocationResponse queryOneLocatorUsingConnection(HostAddress locator, + ServerLocationResponse queryOneLocatorUsingConnection(LocatorAddress locator, ServerLocationRequest request, TcpClient locatorConnection) { Object returnObj = null; @@ -243,16 +243,16 @@ ServerLocationResponse queryOneLocatorUsingConnection(HostAddress locator, * This will cause another DNS lookup, hopefully finding the locator. * */ - protected void updateLocatorInLocatorList(HostAddress locator) { + protected void updateLocatorInLocatorList(LocatorAddress locator) { if (locator.getSocketInetAddressNoLookup().getHostName() != null && !locator.isIpString()) { LocatorList locatorList = locators.get(); - List newLocatorsList = new ArrayList<>(); + List newLocatorsList = new ArrayList<>(); - for (HostAddress tloc : locatorList.getLocatorAddresses()) { + for (LocatorAddress tloc : locatorList.getLocatorAddresses()) { if (tloc.equals(locator)) { InetSocketAddress changeLoc = new InetSocketAddress(locator.getHostName(), locator.getSocketInetAddressNoLookup().getPort()); - HostAddress hostAddress = new HostAddress(changeLoc, locator.getHostName()); + LocatorAddress hostAddress = new LocatorAddress(changeLoc, locator.getHostName()); newLocatorsList.add(hostAddress); } else { newLocatorsList.add(tloc); @@ -277,7 +277,7 @@ private ServerLocationResponse queryLocators(ServerLocationRequest request) { final boolean isDebugEnabled = logger.isDebugEnabled(); do { - HostAddress hostAddress = (HostAddress) controllerItr.next(); + LocatorAddress hostAddress = (LocatorAddress) controllerItr.next(); if (isDebugEnabled) { logger.debug("Sending query to locator {}: {}", hostAddress, request); } @@ -296,13 +296,13 @@ private void updateLocatorList(LocatorListResponse response) { isBalanced = response.isBalanced(); List locatorResponse = response.getLocators(); - List newLocatorAddresses = new ArrayList<>(locatorResponse.size()); - List newOnlineLocators = new ArrayList<>(locatorResponse.size()); + List newLocatorAddresses = new ArrayList<>(locatorResponse.size()); + List newOnlineLocators = new ArrayList<>(locatorResponse.size()); - Set badLocators = new HashSet<>(initialLocators); + Set badLocators = new HashSet<>(initialLocators); for (ServerLocation locator : locatorResponse) { InetSocketAddress address = new InetSocketAddress(locator.getHostName(), locator.getPort()); - HostAddress hostAddress = new HostAddress(address, locator.getHostName()); + LocatorAddress hostAddress = new LocatorAddress(address, locator.getHostName()); newLocatorAddresses.add(hostAddress); newOnlineLocators.add(hostAddress); badLocators.remove(hostAddress); @@ -341,10 +341,10 @@ private void updateLocatorList(LocatorListResponse response) { * This method will add bad locator only when locator with hostname and port is not already in * list. */ - protected void addbadLocators(List newLocators, Set badLocators) { - for (HostAddress badloc : badLocators) { + protected void addbadLocators(List newLocators, Set badLocators) { + for (LocatorAddress badloc : badLocators) { boolean addIt = true; - for (HostAddress goodloc : newLocators) { + for (LocatorAddress goodloc : newLocators) { boolean isSameHost = badloc.getHostName().equals(goodloc.getHostName()); if (isSameHost && badloc.getPort() == goodloc.getPort()) { // ip has been changed so don't add this in current @@ -410,23 +410,23 @@ long getLocatorUpdateInterval() { * A list of locators, which remembers the last known good locator. */ private static class LocatorList { - protected final List locators; + protected final List locators; AtomicInteger currentLocatorIndex = new AtomicInteger(); - LocatorList(List locators) { + LocatorList(List locators) { locators.sort(SOCKET_ADDRESS_COMPARATOR); this.locators = Collections.unmodifiableList(locators); } public List getLocators() { List locs = new ArrayList<>(); - for (HostAddress la : locators) { + for (LocatorAddress la : locators) { locs.add(la.getSocketInetAddress()); } return locs; } - List getLocatorAddresses() { + List getLocatorAddresses() { return locators; } @@ -434,7 +434,7 @@ public int size() { return locators.size(); } - public Iterator iterator() { + public Iterator iterator() { return new LocatorIterator(); } @@ -449,7 +449,7 @@ public String toString() { * controller. * */ - protected class LocatorIterator implements Iterator { + protected class LocatorIterator implements Iterator { private int startLocator = currentLocatorIndex.get(); private int locatorNum = 0; @@ -459,12 +459,12 @@ public boolean hasNext() { } @Override - public HostAddress next() { + public LocatorAddress next() { if (!hasNext()) { return null; } else { int index = (locatorNum + startLocator) % locators.size(); - HostAddress nextLocator = locators.get(index); + LocatorAddress nextLocator = locators.get(index); currentLocatorIndex.set(index); locatorNum++; return nextLocator; diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionImpl.java index b4e04154fb43..c149a7207e7c 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionImpl.java @@ -267,11 +267,6 @@ public Object execute(Op op) throws Exception { } - - public static void loadEmergencyClasses() { - // do nothing - } - @Override public short getWanSiteVersion() { return wanSiteVersion; diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java index 50fc0bdf7188..d41ca20bdc91 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/EndpointManagerImpl.java @@ -207,10 +207,6 @@ public int getConnectedServerCount() { return getEndpointMap().size(); } - public static void loadEmergencyClasses() { - // do nothing - } - protected static class EndpointListenerBroadcaster implements EndpointManager.EndpointListener { private volatile Set endpointListeners = Collections.emptySet(); diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java index df6ac12be69a..862209bd0b39 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java @@ -53,7 +53,7 @@ import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; +import org.apache.geode.distributed.internal.tcpserver.LocatorAddress; import org.apache.geode.internal.admin.ClientStatsManager; import org.apache.geode.internal.cache.EventID; import org.apache.geode.internal.cache.InternalCache; @@ -111,7 +111,7 @@ public class PoolImpl implements InternalPool { private final int subscriptionAckInterval; private final int subscriptionTimeoutMultiplier; private final String serverGroup; - private final List locatorAddresses; + private final List locatorAddresses; private final List locators; private final List servers; private final boolean startDisabled; @@ -156,7 +156,7 @@ public class PoolImpl implements InternalPool { private final ThreadsMonitoring threadMonitoring; public static PoolImpl create(PoolManagerImpl pm, String name, Pool attributes, - List locatorAddresses, InternalDistributedSystem distributedSystem, + List locatorAddresses, InternalDistributedSystem distributedSystem, InternalCache cache, ThreadsMonitoring tMonitoring) { PoolImpl pool = new PoolImpl(pm, name, attributes, locatorAddresses, distributedSystem, cache, tMonitoring); @@ -186,7 +186,7 @@ private void finishCreate(PoolManagerImpl pm) { } protected PoolImpl(PoolManagerImpl pm, String name, Pool attributes, - List locatorAddresses, InternalDistributedSystem distributedSystem, + List locatorAddresses, InternalDistributedSystem distributedSystem, InternalCache cache, ThreadsMonitoring threadMonitoring) { this.pm = pm; this.name = name; @@ -1372,12 +1372,6 @@ public RuntimeException generateCancelledException(Throwable t) { } } - public static void loadEmergencyClasses() { - QueueManagerImpl.loadEmergencyClasses(); - ConnectionManagerImpl.loadEmergencyClasses(); - EndpointManagerImpl.loadEmergencyClasses(); - } - /** * Returns the QueryService, that can be used to execute Query functions on the servers associated * with this pool. diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueConnectionImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueConnectionImpl.java index 132fb976ae26..e50de271adac 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueConnectionImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueConnectionImpl.java @@ -212,10 +212,6 @@ public String toString() { } } - public static void loadEmergencyClasses() { - ConnectionImpl.loadEmergencyClasses(); - } - @Override public short getWanSiteVersion() { throw new UnsupportedOperationException(); diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java index d69a3d11115e..12b7d998f5fc 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/QueueManagerImpl.java @@ -1485,8 +1485,4 @@ public boolean cancel() { } } - - public static void loadEmergencyClasses() { - QueueConnectionImpl.loadEmergencyClasses(); - } } diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImpl.java index 52e168430ea2..b3bffc99eeb1 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/ConnectionManagerImpl.java @@ -613,10 +613,6 @@ private boolean prefillConnection() { return false; } - public static void loadEmergencyClasses() { - PooledConnection.loadEmergencyClasses(); - } - protected class LifetimeExpireConnectionsTask implements Runnable { @Override public void run() { diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/PooledConnection.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/PooledConnection.java index ae7bf5e2f36b..ae5df9df872a 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/PooledConnection.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/pooling/PooledConnection.java @@ -23,7 +23,6 @@ import org.apache.geode.InternalGemFireException; import org.apache.geode.cache.client.internal.Connection; -import org.apache.geode.cache.client.internal.ConnectionImpl; import org.apache.geode.cache.client.internal.ConnectionStats; import org.apache.geode.cache.client.internal.Endpoint; import org.apache.geode.cache.client.internal.Op; @@ -353,10 +352,6 @@ public Object execute(Op op) throws Exception { return getConnection().execute(op); } - public static void loadEmergencyClasses() { - ConnectionImpl.loadEmergencyClasses(); - } - @Override public short getWanSiteVersion() { return getConnection().getWanSiteVersion(); diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java index 3bbbf3b11204..4d765acf8562 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterDistributionManager.java @@ -62,13 +62,13 @@ import org.apache.geode.distributed.Role; import org.apache.geode.distributed.internal.locks.ElderState; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifierFactory; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.Message; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifierFactory; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.Message; import org.apache.geode.internal.Assert; import org.apache.geode.internal.NanoTimer; import org.apache.geode.internal.admin.remote.AdminConsoleDisconnectMessage; @@ -2285,7 +2285,7 @@ public Distribution getDistribution() { * */ private class DMListener implements - org.apache.geode.distributed.internal.membership.gms.api.MembershipListener { + org.apache.geode.distributed.internal.membership.api.MembershipListener { ClusterDistributionManager dm; DMListener(ClusterDistributionManager dm) { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfig.java index 4e0376025e54..fc5cb2052a1e 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfig.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfig.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; /** * Contains the distribution config and internal properties for connecting. diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfigImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfigImpl.java index ff777b7b712b..9b791c5cea6c 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfigImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ConnectionConfigImpl.java @@ -21,7 +21,7 @@ import java.util.Properties; import java.util.function.Supplier; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; public class ConnectionConfigImpl implements ConnectionConfig { private final boolean isReconnecting; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java index b12afb7da82f..0f880b2ef079 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DMStats.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; /** * Defines the interface used to access and modify DM statistics. diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/Distribution.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/Distribution.java index 830135a80301..577dac8d3d52 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/Distribution.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/Distribution.java @@ -20,13 +20,11 @@ import java.util.concurrent.TimeoutException; import java.util.function.Supplier; -import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; public interface Distribution { void start(); @@ -114,32 +112,6 @@ void startupMessageFailed(InternalDistributedMember mbr, Set getMembersNotShuttingDown(); - // TODO - this method is only used by tests - @VisibleForTesting - void forceDisconnect(String reason); - - // TODO - this method is only used by tests - @VisibleForTesting - void replacePartialIdentifierInMessage(DistributionMessage message); - - // TODO - this method is only used by tests - @VisibleForTesting - boolean isCleanupTimerStarted(); - - // TODO - this method is only used by tests - @VisibleForTesting - long getSurpriseMemberTimeout(); - - // TODO - this method is only used by tests - @VisibleForTesting - void installView(GMSMembershipView newView); - - // TODO - this method is only used by tests - @VisibleForTesting - int getDirectChannelPort(); - - void disableDisconnectOnQuorumLossForTesting(); - boolean waitForDeparture(InternalDistributedMember mbr) throws TimeoutException, InterruptedException; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java index 60e82f202b28..cfc3347d1649 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionConfig.java @@ -202,7 +202,7 @@ import org.apache.geode.annotations.internal.MakeImmutable; import org.apache.geode.distributed.ConfigurationProperties; import org.apache.geode.distributed.DistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; import org.apache.geode.internal.Config; import org.apache.geode.internal.ConfigSource; import org.apache.geode.internal.logging.LogWriterImpl; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java index 1df89030909b..d8947d4b2382 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionImpl.java @@ -37,11 +37,9 @@ import org.apache.geode.ForcedDisconnectException; import org.apache.geode.GemFireConfigException; import org.apache.geode.SystemConnectException; -import org.apache.geode.SystemFailure; import org.apache.geode.ToDataException; import org.apache.geode.annotations.Immutable; import org.apache.geode.annotations.VisibleForTesting; -import org.apache.geode.annotations.internal.MakeNotStatic; import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.DistributedSystemDisconnectedException; import org.apache.geode.distributed.Locator; @@ -50,26 +48,21 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.adapter.ServiceConfig; import org.apache.geode.distributed.internal.membership.adapter.auth.GMSAuthenticator; -import org.apache.geode.distributed.internal.membership.gms.GMSMembership; -import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.Message; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; -import org.apache.geode.distributed.internal.membership.gms.fd.GMSHealthMonitor; -import org.apache.geode.distributed.internal.membership.gms.membership.GMSJoinLeave; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipBuilder; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.Message; +import org.apache.geode.distributed.internal.membership.api.MessageListener; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.internal.InternalDataSerializer; import org.apache.geode.internal.admin.remote.RemoteTransportConfig; @@ -82,21 +75,16 @@ import org.apache.geode.internal.tcp.ConnectionException; import org.apache.geode.internal.util.Breadcrumbs; import org.apache.geode.logging.internal.executors.LoggingThread; +import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.security.AuthenticationRequiredException; import org.apache.geode.security.GemFireSecurityException; public class DistributionImpl implements Distribution { - private static final Logger logger = Services.getLogger(); + private static final Logger logger = LogService.getLogger(); @Immutable public static final InternalDistributedMember[] EMPTY_MEMBER_ARRAY = new InternalDistributedMember[0]; - /** - * @see SystemFailure#loadEmergencyClasses() /** break any potential circularity in - * {@link #loadEmergencyClasses()} - */ - @MakeNotStatic - private static volatile boolean emergencyClassesLoaded = false; private final ClusterDistributionManager clusterDistributionManager; private final boolean tcpDisabled; @@ -163,25 +151,11 @@ public DistributionImpl(final ClusterDistributionManager clusterDistributionMana } catch (GemFireSecurityException e) { throw e; } catch (RuntimeException e) { - Services.getLogger().error("Unexpected problem starting up membership services", e); + logger.error("Unexpected problem starting up membership services", e); throw new SystemConnectException("Problem starting up membership services", e); } } - /** - * Ensure that the critical classes from components get loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - if (emergencyClassesLoaded) - return; - emergencyClassesLoaded = true; - DirectChannel.loadEmergencyClasses(); - GMSJoinLeave.loadEmergencyClasses(); - GMSHealthMonitor.loadEmergencyClasses(); - } - public static void connectLocatorToServices(Membership membership) { // see if a locator was started and put it in GMS Services InternalLocator l = (InternalLocator) Locator.getLocator(); @@ -638,49 +612,6 @@ public Set getMembersNotShuttingDown() { return membership.getMembersNotShuttingDown(); } - // TODO - this method is only used by tests - @Override - @VisibleForTesting - public void forceDisconnect(String reason) { - ((GMSMembership) membership).getGMSManager().forceDisconnect(reason); - } - - // TODO - this method is only used by tests - @Override - @VisibleForTesting - public void replacePartialIdentifierInMessage(DistributionMessage message) { - ((GMSMembership) membership).replacePartialIdentifierInMessage(message); - - } - - // TODO - this method is only used by tests - @Override - @VisibleForTesting - public boolean isCleanupTimerStarted() { - return ((GMSMembership) membership).isCleanupTimerStarted(); - } - - // TODO - this method is only used by tests - @Override - @VisibleForTesting - public long getSurpriseMemberTimeout() { - return ((GMSMembership) membership).getSurpriseMemberTimeout(); - } - - // TODO - this method is only used by tests - @Override - @VisibleForTesting - public void installView(GMSMembershipView newView) { - ((GMSMembership) membership).getGMSManager().installView(newView); - } - - // TODO - this method is only used by tests - @Override - @VisibleForTesting - public int getDirectChannelPort() { - return directChannel == null ? 0 : directChannel.getPort(); - } - /** * for mock testing this allows insertion of a DirectChannel mock */ @@ -690,11 +621,6 @@ void setDirectChannel(DirectChannel dc) { this.directChannel = dc; } - @Override - public void disableDisconnectOnQuorumLossForTesting() { - ((GMSMembership) membership).disableDisconnectOnQuorumLossForTesting(); - } - private void startDirectChannel(final MemberIdentifier memberID) { int dcPort = 0; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java index aca74a626f4e..f9550156a25f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionMessage.java @@ -32,7 +32,7 @@ import org.apache.geode.annotations.Immutable; import org.apache.geode.distributed.internal.deadlock.MessageDependencyMonitor; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.Message; +import org.apache.geode.distributed.internal.membership.api.Message; import org.apache.geode.internal.Assert; import org.apache.geode.internal.cache.EventID; import org.apache.geode.internal.logging.log4j.LogMarker; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java index ff5db314e939..4439b2df762b 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java @@ -76,8 +76,8 @@ import org.apache.geode.distributed.DurableClientAttributes; import org.apache.geode.distributed.internal.locks.GrantorRequestProcessor; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipInformation; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.MembershipInformation; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; import org.apache.geode.internal.Assert; import org.apache.geode.internal.InternalDataSerializer; import org.apache.geode.internal.InternalInstantiator; @@ -1438,25 +1438,6 @@ private void doShutdownListeners(HashSet shutdownListeners) { } // for } - /** - * break any potential circularity in {@link #loadEmergencyClasses()} - */ - @MakeNotStatic - private static volatile boolean emergencyClassesLoaded = false; - - /** - * Ensure that the Distribution class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - if (emergencyClassesLoaded) { - return; - } - emergencyClassesLoaded = true; - DistributionImpl.loadEmergencyClasses(); - } - /** * Closes the membership manager * diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java index 18c06e4572e9..3567eaea634a 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalLocator.java @@ -63,7 +63,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem.ConnectListener; import org.apache.geode.distributed.internal.membership.NetLocator; import org.apache.geode.distributed.internal.membership.NetLocatorFactory; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; import org.apache.geode.distributed.internal.membership.gms.locator.PeerLocatorRequest; import org.apache.geode.distributed.internal.tcpserver.InfoRequest; import org.apache.geode.distributed.internal.tcpserver.TcpClient; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java index 3638a25d680b..6f4430aec01a 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/LonerDistributionManager.java @@ -46,7 +46,7 @@ import org.apache.geode.distributed.Role; import org.apache.geode.distributed.internal.locks.ElderState; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; import org.apache.geode.i18n.LogWriterI18n; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.inet.LocalHostUtil; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java index 6fcf53122867..10b010864eb5 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/direct/DirectChannel.java @@ -45,9 +45,9 @@ import org.apache.geode.distributed.internal.DistributionMessage; import org.apache.geode.distributed.internal.ReplyProcessor21; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MessageListener; import org.apache.geode.internal.cache.DirectReplyMessage; import org.apache.geode.internal.inet.LocalHostUtil; import org.apache.geode.internal.logging.log4j.LogMarker; @@ -717,15 +717,6 @@ public void receive(DistributionMessage msg, int bytesRead) throws MemberShunned } } - /** - * Ensure that the TCPConduit class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - TCPConduit.loadEmergencyClasses(); - } - /** * Close the Conduit * diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java index bb47a86e258d..94a91a5c6460 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java @@ -42,9 +42,9 @@ import org.apache.geode.distributed.internal.ClusterDistributionManager; import org.apache.geode.distributed.internal.DistributionAdvisor.ProfileId; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.Assert; import org.apache.geode.internal.InternalDataSerializer; import org.apache.geode.internal.cache.versions.VersionSource; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetLocator.java index 8356735f3eb2..2b50dd9012e8 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetLocator.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetLocator.java @@ -15,7 +15,7 @@ package org.apache.geode.distributed.internal.membership; import org.apache.geode.distributed.internal.RestartableTcpHandler; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; +import org.apache.geode.distributed.internal.membership.api.Membership; public interface NetLocator extends RestartableTcpHandler { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/GMSLocatorAdapter.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/GMSLocatorAdapter.java index ff4bb2481bb5..141dd0a745d7 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/GMSLocatorAdapter.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/GMSLocatorAdapter.java @@ -30,8 +30,8 @@ import org.apache.geode.distributed.internal.RestartableTcpHandler; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.distributed.internal.membership.NetLocator; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.interfaces.Locator; import org.apache.geode.distributed.internal.membership.gms.locator.GMSLocator; import org.apache.geode.distributed.internal.tcpserver.TcpClient; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java index 220b33553def..204dfe6a71ad 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/ServiceConfig.java @@ -18,7 +18,7 @@ import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.InternalLocator; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; import org.apache.geode.internal.admin.remote.RemoteTransportConfig; import org.apache.geode.internal.net.SocketCreator; import org.apache.geode.util.internal.GeodeGlossary; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/auth/GMSAuthenticator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/auth/GMSAuthenticator.java index 08ff0ea72dd1..b79d242668f4 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/auth/GMSAuthenticator.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/adapter/auth/GMSAuthenticator.java @@ -24,8 +24,8 @@ import org.apache.geode.LogWriter; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.Authenticator; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.Authenticator; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.cache.tier.sockets.Handshake; import org.apache.geode.internal.security.CallbackInstantiator; import org.apache.geode.internal.security.SecurityService; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Authenticator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Authenticator.java similarity index 95% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Authenticator.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Authenticator.java index 5ffcca6335e0..8c84a711fc60 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Authenticator.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Authenticator.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.util.Properties; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/LifecycleListener.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/LifecycleListener.java similarity index 95% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/LifecycleListener.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/LifecycleListener.java index c9bbff893385..dbb77da0e59c 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/LifecycleListener.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/LifecycleListener.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; public interface LifecycleListener { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberData.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberData.java similarity index 98% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberData.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberData.java index 04918bfe5f04..2e99535f4ea9 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberData.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberData.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.io.DataOutput; import java.io.IOException; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberDataBuilder.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberDataBuilder.java similarity index 97% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberDataBuilder.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberDataBuilder.java index 0824cd748723..a4c8adaf8e42 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberDataBuilder.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberDataBuilder.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.net.InetAddress; import java.util.ArrayList; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberDisconnectedException.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberDisconnectedException.java similarity index 94% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberDisconnectedException.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberDisconnectedException.java index 9e25f746b853..3aa83f6d15aa 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberDisconnectedException.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberDisconnectedException.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /** * MemberDisconnectedException indicates that we've been kicked out of the cluster. diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberIdentifier.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberIdentifier.java similarity index 98% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberIdentifier.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberIdentifier.java index 26ad626ba968..602d9dd629d9 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberIdentifier.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberIdentifier.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.net.InetAddress; import java.util.List; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberIdentifierFactory.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberIdentifierFactory.java similarity index 95% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberIdentifierFactory.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberIdentifierFactory.java index dd4f01be872f..fe3076699175 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberIdentifierFactory.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberIdentifierFactory.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.util.Comparator; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberShunnedException.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberShunnedException.java similarity index 94% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberShunnedException.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberShunnedException.java index 9bd010d7c394..ccf3ae0d025f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberShunnedException.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberShunnedException.java @@ -13,7 +13,7 @@ * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /** * MemberShunnedException may be thrown to prevent ack-ing a message received from a member that has diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberStartupException.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberStartupException.java similarity index 95% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberStartupException.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberStartupException.java index f9b30e2d2e09..d34f928ca9dc 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MemberStartupException.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MemberStartupException.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /** * MemberStartupException is thrown if there is a problem starting up membership diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Membership.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Membership.java similarity index 99% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Membership.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Membership.java index 6d65289efe28..5b3c4621604d 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Membership.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Membership.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.io.NotSerializableException; import java.util.Map; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipBuilder.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipBuilder.java similarity index 97% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipBuilder.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipBuilder.java index 22e876a2da8a..e0e17efd7cc8 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipBuilder.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipBuilder.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import org.apache.geode.distributed.internal.membership.gms.MembershipBuilderImpl; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipClosedException.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipClosedException.java similarity index 95% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipClosedException.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipClosedException.java index 2d46e9587c5e..c80d18a6311d 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipClosedException.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipClosedException.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /** * MembershipClosedException is thrown if membership services are no longer diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipConfig.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipConfig.java similarity index 98% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipConfig.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipConfig.java index f18a1f7c674f..9d2e2f05a386 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipConfig.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipConfig.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import org.apache.geode.annotations.internal.MakeImmutable; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipConfigurationException.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipConfigurationException.java similarity index 95% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipConfigurationException.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipConfigurationException.java index 2310da8adb68..45cd73dc5f2e 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipConfigurationException.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipConfigurationException.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /** diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipInformation.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipInformation.java similarity index 93% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipInformation.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipInformation.java index b8072191af6a..122b7617ff0a 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipInformation.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipInformation.java @@ -1,4 +1,4 @@ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipListener.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipListener.java similarity index 97% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipListener.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipListener.java index 177c303e2593..1f19c22808ab 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipListener.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipListener.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.util.List; import java.util.Set; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipStatistics.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java similarity index 98% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipStatistics.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java index 6f08b52295f4..99d91e894a13 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipStatistics.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipStatistics.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; public interface MembershipStatistics { long startMsgSerialization(); diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipView.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipView.java similarity index 99% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipView.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipView.java index 90ef5f86316e..85c6b0d124cf 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipView.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipView.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.util.ArrayList; import java.util.Collection; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Message.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Message.java similarity index 98% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Message.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Message.java index 217c686901b4..39e30f1ab129 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/Message.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/Message.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import java.util.Collection; import java.util.List; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MessageListener.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MessageListener.java similarity index 94% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MessageListener.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MessageListener.java index 9c250f9907b7..0aac0e441825 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/MessageListener.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/MessageListener.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; public interface MessageListener { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/QuorumChecker.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/QuorumChecker.java similarity index 96% rename from geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/QuorumChecker.java rename to geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/QuorumChecker.java index c2c124403291..f17dbf09b3b8 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/api/QuorumChecker.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/api/QuorumChecker.java @@ -13,7 +13,7 @@ * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; /** * A QuorumChecker is created after a forced-disconnect in order to probe the network to see if diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/AuthenticatorNoOp.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/AuthenticatorNoOp.java index 28647037ebe5..0f84e714115e 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/AuthenticatorNoOp.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/AuthenticatorNoOp.java @@ -16,8 +16,8 @@ import java.util.Properties; -import org.apache.geode.distributed.internal.membership.gms.api.Authenticator; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.Authenticator; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; public class AuthenticatorNoOp implements Authenticator { @Override diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java index da81cf509ce7..bd057cfdc5fd 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMemberData.java @@ -22,7 +22,7 @@ import org.jgroups.util.UUID; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberData; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.StaticSerialization; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java index 5cf56f50d229..007631821b1c 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembership.java @@ -27,17 +27,11 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.Queue; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.Lock; @@ -50,28 +44,28 @@ import org.apache.geode.GemFireConfigException; import org.apache.geode.SystemFailure; +import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.annotations.internal.MakeNotStatic; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.StartupMessage; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.Message; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.Message; +import org.apache.geode.distributed.internal.membership.api.MessageListener; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; import org.apache.geode.distributed.internal.membership.gms.interfaces.Manager; import org.apache.geode.internal.serialization.Version; import org.apache.geode.logging.internal.executors.LoggingExecutors; import org.apache.geode.logging.internal.executors.LoggingThread; -import org.apache.geode.logging.internal.executors.LoggingThreadFactory; import org.apache.geode.util.internal.GeodeGlossary; public class GMSMembership implements Membership { @@ -661,10 +655,7 @@ public GMSMembership(MembershipListener listener, MessageListener messag this.listener = listener; this.messageListener = messageListener; this.gmsManager = new ManagerImpl(); - LinkedBlockingQueue feed = new LinkedBlockingQueue<>(); - ThreadFactory threadFactory = new LoggingThreadFactory("Geode View Processor"); - this.viewExecutor = new ThreadPoolExecutor(1, 1, 30, - TimeUnit.SECONDS, feed, threadFactory, new ViewExecutorBlockHandler(feed)); + this.viewExecutor = LoggingExecutors.newSingleThreadExecutor("Geode View Processor", true); } public Manager getGMSManager() { @@ -1778,6 +1769,11 @@ public synchronized void playDead() { } } + @VisibleForTesting + public void forceDisconnect(String reason) { + this.gmsManager.forceDisconnect(reason); + } + /** * Test hook - recover health */ @@ -2111,32 +2107,4 @@ public boolean isReconnectingDS() { } } - - - private static class ViewExecutorBlockHandler implements RejectedExecutionHandler { - - private final Queue queue; - - private ViewExecutorBlockHandler(Queue feed) { - queue = feed; - } - - @Override - public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { - if (executor.isShutdown()) { - throw new RejectedExecutionException( - "executor has been shutdown"); - } else { - try { - executor.getQueue().put(r); - } catch (InterruptedException ie) { - Thread.currentThread().interrupt(); - RejectedExecutionException e = new RejectedExecutionException( - "interrupted"); - e.initCause(ie); - } - } - } - } - } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipView.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipView.java index 0f29e4b8fbf4..903cc750e73d 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipView.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipView.java @@ -33,7 +33,7 @@ import org.apache.logging.log4j.Logger; import org.apache.geode.annotations.Immutable; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DataSerializableFixedID; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java index 69edc050a6bc..ff5b4f6ac2ad 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSUtil.java @@ -28,8 +28,8 @@ import org.apache.logging.log4j.Logger; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; import org.apache.geode.internal.inet.LocalHostUtil; import org.apache.geode.internal.serialization.DeserializationContext; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/LifecycleListenerNoOp.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/LifecycleListenerNoOp.java index ca99b813d0e6..e944000f187f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/LifecycleListenerNoOp.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/LifecycleListenerNoOp.java @@ -14,8 +14,8 @@ */ package org.apache.geode.distributed.internal.membership.gms; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; public class LifecycleListenerNoOp implements LifecycleListener { @Override diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImpl.java index b47236b1a5c3..d9ae22dee108 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImpl.java @@ -17,9 +17,9 @@ import java.net.InetAddress; import java.net.UnknownHostException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.Version; public class MemberDataBuilderImpl implements MemberDataBuilder { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipBuilderImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipBuilderImpl.java index a16184516a3e..415d5a932432 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipBuilderImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipBuilderImpl.java @@ -15,17 +15,17 @@ package org.apache.geode.distributed.internal.membership.gms; -import org.apache.geode.distributed.internal.membership.gms.api.Authenticator; -import org.apache.geode.distributed.internal.membership.gms.api.LifecycleListener; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifierFactory; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipBuilder; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; -import org.apache.geode.distributed.internal.membership.gms.api.MessageListener; +import org.apache.geode.distributed.internal.membership.api.Authenticator; +import org.apache.geode.distributed.internal.membership.api.LifecycleListener; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifierFactory; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipBuilder; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; +import org.apache.geode.distributed.internal.membership.api.MessageListener; import org.apache.geode.distributed.internal.tcpserver.TcpClient; import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator; import org.apache.geode.internal.serialization.DSFIDSerializer; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipListenerNoOp.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipListenerNoOp.java index b2a498a43f2d..63b5e8ca7e0a 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipListenerNoOp.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipListenerNoOp.java @@ -17,9 +17,9 @@ import java.util.List; import java.util.Set; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipListener; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipView; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipListener; +import org.apache.geode.distributed.internal.membership.api.MembershipView; public class MembershipListenerNoOp implements MembershipListener { @Override diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipStatisticsNoOp.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipStatisticsNoOp.java index 26fd3ea385c5..975000a99155 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipStatisticsNoOp.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipStatisticsNoOp.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal.membership.gms; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; public class MembershipStatisticsNoOp implements MembershipStatistics { @Override diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java index 451764a1bb68..05158cfadf6f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/Services.java @@ -38,15 +38,15 @@ import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.Authenticator; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifierFactory; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; +import org.apache.geode.distributed.internal.membership.api.Authenticator; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifierFactory; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; import org.apache.geode.distributed.internal.membership.gms.fd.GMSHealthMonitor; import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/SuspectMember.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/SuspectMember.java index bc5a375e704c..6d5625a5cddb 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/SuspectMember.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/SuspectMember.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal.membership.gms; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; /** represents a suspicion raised about a member */ public class SuspectMember { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java index 36f2464d6f89..cdc3872b3ca2 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitor.java @@ -53,14 +53,14 @@ import org.jgroups.util.UUID; import org.apache.geode.GemFireConfigException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; import org.apache.geode.distributed.internal.membership.gms.messages.AbstractGMSMessage; import org.apache.geode.distributed.internal.membership.gms.messages.FinalCheckPassedMessage; @@ -408,9 +408,6 @@ public GMSHealthMonitor(final TcpSocketCreator socketCreator) { this.socketCreator = socketCreator; } - @SuppressWarnings("EmptyMethod") - public static void loadEmergencyClasses() {} - /* * Record the member activity for current time interval. */ diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/HealthMonitor.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/HealthMonitor.java index 127d6c64641d..a119285af3a8 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/HealthMonitor.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/HealthMonitor.java @@ -15,7 +15,7 @@ package org.apache.geode.distributed.internal.membership.gms.interfaces; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; public interface HealthMonitor extends Service { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java index 1e77151cc49e..a4b57ba20169 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/JoinLeave.java @@ -14,9 +14,9 @@ */ package org.apache.geode.distributed.internal.membership.gms.interfaces; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; public interface JoinLeave extends Service { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Locator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Locator.java index db55b6a96c87..528e710681e2 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Locator.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Locator.java @@ -14,8 +14,8 @@ */ package org.apache.geode.distributed.internal.membership.gms.interfaces; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; /** * The Locator interface allows member services to interact with the Locator TcpHandler component of diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java index ba4fe8196e4f..c1e00fa5db0e 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Manager.java @@ -16,11 +16,11 @@ import java.util.Collection; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.Message; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.Message; /** * Manager presents the GMS services to the outside world and handles startup/shutdown race diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java index dcbf6c2af848..f3af78677454 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/MessageHandler.java @@ -15,7 +15,7 @@ package org.apache.geode.distributed.internal.membership.gms.interfaces; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; /** * MessageHandler processes a message received by Messenger. Handlers are registered with Messenger diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Messenger.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Messenger.java index 4bc64bce4436..29818e8237de 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Messenger.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Messenger.java @@ -18,9 +18,9 @@ import java.util.Set; import java.util.concurrent.TimeoutException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.Message; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.Message; import org.apache.geode.distributed.internal.membership.gms.messenger.GMSQuorumChecker; public interface Messenger extends Service { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Service.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Service.java index 3477298635fe..35595a87a7d8 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Service.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/interfaces/Service.java @@ -14,11 +14,11 @@ */ package org.apache.geode.distributed.internal.membership.gms.interfaces; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; /** * Services in GMS all implement this interface diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorRequest.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorRequest.java index 633739dec562..f8e68d1416b1 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorRequest.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorRequest.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.Collection; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.messages.AbstractGMSMessage; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorResponse.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorResponse.java index 2109a99ec6b9..deaa51c35dc1 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorResponse.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/FindCoordinatorResponse.java @@ -22,9 +22,9 @@ import java.util.Objects; import java.util.Set; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.GMSUtil; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.messages.AbstractGMSMessage; import org.apache.geode.internal.serialization.DataSerializableFixedID; import org.apache.geode.internal.serialization.DeserializationContext; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java index c04ad18d91c9..3316f4c05847 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GMSLocator.java @@ -39,13 +39,13 @@ import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.distributed.internal.LocatorStats; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.GMSMembership; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.GMSUtil; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.interfaces.Locator; import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; import org.apache.geode.distributed.internal.membership.gms.messenger.GMSMemberWrapper; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GetViewResponse.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GetViewResponse.java index 7a90b32acf6f..2ce1d269e956 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GetViewResponse.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/locator/GetViewResponse.java @@ -18,8 +18,8 @@ import java.io.DataOutput; import java.io.IOException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.internal.serialization.DataSerializableFixedID; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java index 0959097121e9..9ccf89254654 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave.java @@ -16,7 +16,7 @@ import static org.apache.geode.distributed.ConfigurationProperties.LOCATORS; import static org.apache.geode.distributed.ConfigurationProperties.START_LOCATOR; -import static org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig.MEMBER_REQUEST_COLLECTION_INTERVAL; +import static org.apache.geode.distributed.internal.membership.api.MembershipConfig.MEMBER_REQUEST_COLLECTION_INTERVAL; import static org.apache.geode.internal.serialization.DataSerializableFixedID.JOIN_REQUEST; import static org.apache.geode.internal.serialization.DataSerializableFixedID.LEAVE_REQUEST_MESSAGE; import static org.apache.geode.internal.serialization.DataSerializableFixedID.REMOVE_MEMBER_REQUEST; @@ -46,14 +46,14 @@ import org.apache.geode.annotations.VisibleForTesting; import org.apache.geode.distributed.Locator; import org.apache.geode.distributed.internal.ClusterDistributionManager; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.GMSUtil; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.interfaces.JoinLeave; import org.apache.geode.distributed.internal.membership.gms.locator.FindCoordinatorRequest; import org.apache.geode.distributed.internal.membership.gms.locator.FindCoordinatorResponse; @@ -1652,8 +1652,6 @@ private void startViewBroadcaster() { VIEW_BROADCAST_INTERVAL); } - public static void loadEmergencyClasses() {} - @Override public void emergencyClose() { isStopping = true; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java index 52d14ddc4ee0..3edde3b72088 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/membership/HostAddress.java @@ -16,94 +16,12 @@ import java.net.InetSocketAddress; -import org.apache.commons.validator.routines.InetAddressValidator; +import org.apache.geode.distributed.internal.tcpserver.LocatorAddress; -public class HostAddress { - - private final InetSocketAddress socketInetAddress; - private final String hostname; - private final int port; - private final boolean isIpString; +public class HostAddress extends LocatorAddress { public HostAddress(InetSocketAddress loc, String locStr) { - this.socketInetAddress = loc; - this.hostname = locStr; - this.port = loc.getPort(); - this.isIpString = InetAddressValidator.getInstance().isValid(locStr); - } - - public boolean isIpString() { - return isIpString; - } - - /** - * if host is ipString then it will return the cached InetSocketAddress Otherwise it will create - * the new instance of InetSocketAddress - */ - public InetSocketAddress getSocketInetAddress() { - if (this.isIpString) { - return this.socketInetAddress; - } else { - return new InetSocketAddress(hostname, this.socketInetAddress.getPort()); - } - } - - public String getHostName() { - return hostname; - } - - public int getPort() { - return port; - } - - /** - * If component has retry logic then use this method to get the InetSocketAddress address - * AutoConnectionSourceImpl for client has retry logic; This way client will not make DNS query - * each time - * - */ - public InetSocketAddress getSocketInetAddressNoLookup() { - return this.socketInetAddress; - } - - @Override - public int hashCode() { - int prime = 31; - int result = 1; - result = prime * result + (isIpString ? 1231 : 1237); - result = prime * result + (socketInetAddress == null ? 0 : socketInetAddress.hashCode()); - result = prime * result + (hostname == null ? 0 : hostname.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - HostAddress other = (HostAddress) obj; - if (isIpString != other.isIpString) - return false; - if (socketInetAddress == null) { - if (other.socketInetAddress != null) - return false; - } else if (!socketInetAddress.equals(other.socketInetAddress)) - return false; - if (hostname == null) { - if (other.hostname != null) - return false; - } else if (!hostname.equals(other.hostname)) - return false; - return true; - } - - @Override - public String toString() { - return "LocatorAddress [socketInetAddress=" + socketInetAddress + ", hostname=" + hostname - + ", isIpString=" + isIpString + "]"; + super(loc, locStr); } } diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/AbstractGMSMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/AbstractGMSMessage.java index 8b360910fa90..c0a32f18628f 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/AbstractGMSMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/AbstractGMSMessage.java @@ -19,8 +19,8 @@ import java.util.Collections; import java.util.List; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.Message; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.Message; public abstract class AbstractGMSMessage implements Message { private List recipients; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java index c318bf306f10..dd127f5c3c13 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/FinalCheckPassedMessage.java @@ -18,7 +18,7 @@ import java.io.DataOutput; import java.io.IOException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java index 6680c1bd9799..bb540296e5d0 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HasMemberID.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal.membership.gms.messages; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; public interface HasMemberID { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatMessage.java index de9cb3fbae05..5d85dda2621c 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatMessage.java @@ -18,7 +18,7 @@ import java.io.DataOutput; import java.io.IOException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatRequestMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatRequestMessage.java index 0b3989e4442f..9cd4f9a11162 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatRequestMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/HeartbeatRequestMessage.java @@ -18,7 +18,7 @@ import java.io.DataOutput; import java.io.IOException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/InstallViewMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/InstallViewMessage.java index c15e07b7b541..ad03e7c212e5 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/InstallViewMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/InstallViewMessage.java @@ -19,8 +19,8 @@ import java.io.IOException; import java.util.Objects; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinRequestMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinRequestMessage.java index 362e8ae9ebf0..135f04658064 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinRequestMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinRequestMessage.java @@ -19,7 +19,7 @@ import java.io.IOException; import java.util.Objects; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinResponseMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinResponseMessage.java index ec8890e14f43..445ea797aa0d 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinResponseMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/JoinResponseMessage.java @@ -20,8 +20,8 @@ import java.util.Arrays; import java.util.Objects; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.StaticSerialization; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/LeaveRequestMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/LeaveRequestMessage.java index 85b588bd8ed8..9bc8a494d71f 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/LeaveRequestMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/LeaveRequestMessage.java @@ -19,7 +19,7 @@ import java.io.IOException; import java.util.List; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.StaticSerialization; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/NetworkPartitionMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/NetworkPartitionMessage.java index 27f898f52579..55f70e317ddd 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/NetworkPartitionMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/NetworkPartitionMessage.java @@ -19,7 +19,7 @@ import java.io.IOException; import java.util.List; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/RemoveMemberMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/RemoveMemberMessage.java index 0e095f957a46..e2bce1c0aa20 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/RemoveMemberMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/RemoveMemberMessage.java @@ -19,7 +19,7 @@ import java.io.IOException; import java.util.List; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.StaticSerialization; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectMembersMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectMembersMessage.java index 85a306c59871..2b6955b07e97 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectMembersMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectMembersMessage.java @@ -20,7 +20,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.StaticSerialization; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectRequest.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectRequest.java index ede427375a50..519ea8954b63 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectRequest.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/SuspectRequest.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal.membership.gms.messages; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; public class SuspectRequest { final ID suspectMember; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/ViewAckMessage.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/ViewAckMessage.java index 35cd3fad4480..9744a01ed2e9 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/ViewAckMessage.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messages/ViewAckMessage.java @@ -18,8 +18,8 @@ import java.io.DataOutput; import java.io.IOException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.internal.serialization.DeserializationContext; import org.apache.geode.internal.serialization.SerializationContext; import org.apache.geode.internal.serialization.Version; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncrypt.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncrypt.java index d8fa2043c467..31ca6ef49e27 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncrypt.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncrypt.java @@ -31,9 +31,9 @@ import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.locator.GMSLocator; import org.apache.geode.internal.util.JavaWorkarounds; diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptionCipherPool.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptionCipherPool.java index 895b1e00d7f2..68c2b1dc241b 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptionCipherPool.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSEncryptionCipherPool.java @@ -23,8 +23,8 @@ import org.apache.logging.log4j.Logger; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; public class GMSEncryptionCipherPool { private static final int MAX_CIPHERS_PER_POOL = Integer.getInteger("GMSEncrypt.MAX_ENCRYPTORS", diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSMemberWrapper.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSMemberWrapper.java index 75d2475fa915..578c1e90aafa 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSMemberWrapper.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSMemberWrapper.java @@ -14,7 +14,7 @@ */ package org.apache.geode.distributed.internal.membership.gms.messenger; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; /** * A wrapper for GMSMember objects used in encryption services diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java index e34dea72250c..951c6bb7179e 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/GMSQuorumChecker.java @@ -33,10 +33,10 @@ import org.jgroups.Receiver; import org.jgroups.View; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipInformation; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipInformation; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; import org.apache.geode.logging.internal.log4j.api.LogService; public class GMSQuorumChecker implements QuorumChecker { diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGAddress.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGAddress.java index 01aeccde8328..f9d6fe0d78d0 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGAddress.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGAddress.java @@ -27,8 +27,8 @@ import org.jgroups.stack.IpAddress; import org.jgroups.util.UUID; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.util.internal.GeodeGlossary; /** diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java index 56999b8a9439..eb98e622ee71 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/JGroupsMessenger.java @@ -67,22 +67,21 @@ import org.jgroups.util.Digest; import org.jgroups.util.UUID; -import org.apache.geode.annotations.internal.MutableForTesting; import org.apache.geode.distributed.internal.DistributionConfig; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDisconnectedException; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.MemberStartupException; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; +import org.apache.geode.distributed.internal.membership.api.Message; import org.apache.geode.distributed.internal.membership.gms.GMSMemberData; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; import org.apache.geode.distributed.internal.membership.gms.GMSUtil; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDisconnectedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.MemberStartupException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; -import org.apache.geode.distributed.internal.membership.gms.api.Message; import org.apache.geode.distributed.internal.membership.gms.interfaces.HealthMonitor; import org.apache.geode.distributed.internal.membership.gms.interfaces.MessageHandler; import org.apache.geode.distributed.internal.membership.gms.interfaces.Messenger; @@ -121,9 +120,6 @@ public class JGroupsMessenger implements Messenger< private static final short JGROUPS_TYPE_JGADDRESS = 2000; private static final short JGROUPS_PROTOCOL_TRANSPORT = 1000; - @MutableForTesting - public static boolean THROW_EXCEPTION_ON_START_HOOK; - protected String jgStackConfig; JChannel myChannel; @@ -393,11 +389,6 @@ public void start() throws MemberStartupException { throw new MemberStartupException("unable to create jgroups channel", e); } - if (JGroupsMessenger.THROW_EXCEPTION_ON_START_HOOK) { - JGroupsMessenger.THROW_EXCEPTION_ON_START_HOOK = false; - throw new MemberStartupException("failing for test"); - } - establishLocalAddress(); logger.info("JGroups channel {} (took {}ms)", (reconnecting ? "reinitialized" : "created"), diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/MembershipInformationImpl.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/MembershipInformationImpl.java index d37f5de40e06..85748783dae3 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/MembershipInformationImpl.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/MembershipInformationImpl.java @@ -19,7 +19,7 @@ import org.jgroups.JChannel; import org.jgroups.Message; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipInformation; +import org.apache.geode.distributed.internal.membership.api.MembershipInformation; /** * Class MembershipInformation is used to pass membership data from a GMS that was diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorder.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorder.java index 119ece506e9f..b4b69bda4678 100755 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorder.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorder.java @@ -28,9 +28,9 @@ import org.jgroups.protocols.pbcast.NakAckHeader2; import org.jgroups.stack.Protocol; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; /** * JGroups doesn't capture quite the stats we want so this protocol is inserted into the stack to diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/Transport.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/Transport.java index 10e2f8ac24e9..9c3ae9509280 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/Transport.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/gms/messenger/Transport.java @@ -25,7 +25,7 @@ import org.jgroups.util.DefaultThreadFactory; import org.jgroups.util.LazyThreadFactory; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; public class Transport extends UDP { diff --git a/geode-core/src/main/java/org/apache/geode/internal/SystemFailureTestHook.java b/geode-core/src/main/java/org/apache/geode/internal/SystemFailureTestHook.java index e3907c52a2d1..e2d27cb3302d 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/SystemFailureTestHook.java +++ b/geode-core/src/main/java/org/apache/geode/internal/SystemFailureTestHook.java @@ -41,8 +41,4 @@ public static void setExpectedFailureClass(Class expected) { public static boolean errorIsExpected(Error failure) { return expectedClass != null && expectedClass.isInstance(failure); } - - public static void loadEmergencyClasses() { - // nothing more needed - } } diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java index cc54036457d3..d9a878a6d78a 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteGfManagerAgent.java @@ -205,12 +205,6 @@ public class RemoteGfManagerAgent implements GfManagerAgent { @MakeNotStatic private static volatile List allAgents = new ArrayList<>(); - /** - * break any potential circularity in {@link #loadEmergencyClasses()} - */ - @MakeNotStatic - private static volatile boolean emergencyClassesLoaded; - /** * Is this thread currently sending a message? */ @@ -236,19 +230,6 @@ private static void removeAgent(RemoteGfManagerAgent toRemove) { } } - /** - * Ensure that the InternalDistributedSystem class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - if (emergencyClassesLoaded) { - return; - } - emergencyClassesLoaded = true; - InternalDistributedSystem.loadEmergencyClasses(); - } - /** * Close all of the RemoteGfManagerAgent's. * diff --git a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java index dad00f1fcb28..42aa30696f57 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java +++ b/geode-core/src/main/java/org/apache/geode/internal/admin/remote/RemoteTransportConfig.java @@ -34,7 +34,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.geode.distributed.internal.DistributionConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipInformation; +import org.apache.geode.distributed.internal.membership.api.MembershipInformation; import org.apache.geode.internal.Assert; import org.apache.geode.internal.admin.SSLConfig; import org.apache.geode.internal.admin.TransportConfig; diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java index 6f9dc1d74cd8..3e46a8823166 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/CacheServerImpl.java @@ -57,7 +57,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.ResourceEvent; import org.apache.geode.distributed.internal.ServerLocation; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; import org.apache.geode.internal.Assert; import org.apache.geode.internal.admin.ClientHealthMonitoringRegion; import org.apache.geode.internal.cache.CacheServerAdvisor.CacheServerProfile; diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java index c2a8ca3c98ec..fd0fb730879b 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java @@ -227,7 +227,6 @@ import org.apache.geode.internal.cache.persistence.PersistentMemberManager; import org.apache.geode.internal.cache.snapshot.CacheSnapshotServiceImpl; import org.apache.geode.internal.cache.tier.Acceptor; -import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl; import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier; import org.apache.geode.internal.cache.tier.sockets.CacheClientProxy; import org.apache.geode.internal.cache.tier.sockets.ClientHealthMonitor; @@ -388,12 +387,6 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has private static final Set cacheLifecycleListeners = new CopyOnWriteArraySet<>(); - /** - * Break any potential circularity in {@link #loadEmergencyClasses()}. - */ - @MakeNotStatic - private static volatile boolean emergencyClassesLoaded; - /** * Property set to true if resource manager heap percentage is set and query monitor is required */ @@ -1648,21 +1641,6 @@ public boolean keepDurableSubscriptionsAlive() { return keepAlive; } - /** - * Ensure that all the necessary classes for closing the cache are loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - if (emergencyClassesLoaded) { - return; - } - emergencyClassesLoaded = true; - InternalDistributedSystem.loadEmergencyClasses(); - AcceptorImpl.loadEmergencyClasses(); - PoolManagerImpl.loadEmergencyClasses(); - } - /** * Close the distributed system, cache servers, and gateways. Clears the rootRegions and * partitionedRegions map. Marks the cache as closed. diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java index c01f70650cf1..d0adf2a85501 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java @@ -157,7 +157,7 @@ import org.apache.geode.distributed.internal.locks.DLockRemoteToken; import org.apache.geode.distributed.internal.locks.DLockService; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; import org.apache.geode.internal.Assert; import org.apache.geode.internal.NanoTimer; import org.apache.geode.internal.cache.BucketAdvisor.ServerBucketProfile; diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java index 2cdaba829eb5..3ba48f38005f 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolFactoryImpl.java @@ -39,7 +39,7 @@ import org.apache.geode.cache.query.QueryService; import org.apache.geode.cache.wan.GatewaySender; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; +import org.apache.geode.distributed.internal.tcpserver.LocatorAddress; import org.apache.geode.internal.monitoring.ThreadsMonitoring; import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.pdx.internal.TypeRegistry; @@ -57,7 +57,7 @@ public class PoolFactoryImpl implements PoolFactory { */ private PoolAttributes attributes = new PoolAttributes(); - private final List locatorAddresses = new ArrayList<>(); + private final List locatorAddresses = new ArrayList<>(); /** * The cache that created this factory @@ -287,7 +287,7 @@ public PoolFactory addLocator(String host, int port) { } InetSocketAddress isa = getInetSocketAddress(host, port); attributes.locators.add(isa); - locatorAddresses.add(new HostAddress(isa, host)); + locatorAddresses.add(new LocatorAddress(isa, host)); return this; } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolManagerImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolManagerImpl.java index 67488ee9e1fa..38acffbe413b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/PoolManagerImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PoolManagerImpl.java @@ -300,10 +300,6 @@ public static void emergencyClose() { }); } - public static void loadEmergencyClasses() { - PoolImpl.loadEmergencyClasses(); - } - public Pool find(Region region) { return find(region.getAttributes().getPoolName()); } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java index 7d8ce3994865..18c549d3bd24 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java @@ -15,7 +15,6 @@ package org.apache.geode.internal.cache.tier; import org.apache.geode.CancelException; -import org.apache.geode.SystemFailure; import org.apache.geode.cache.Region; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.InternalCacheForClientAccess; @@ -68,13 +67,4 @@ public void close() { // cache = null; } - /** - * Just ensure that this class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - // nothing needed, just make sure this class gets loaded - } - } diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java index 831c08c7df07..b4a475e4f939 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java @@ -860,26 +860,6 @@ private void drainSelectorQueue() { } } - /** - * break any potential circularity in {@link #loadEmergencyClasses()} - */ - @MakeNotStatic - private static volatile boolean emergencyClassesLoaded; - - /** - * Ensure that the CachedRegionHelper and ServerConnection classes get loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - if (emergencyClassesLoaded) { - return; - } - emergencyClassesLoaded = true; - CachedRegionHelper.loadEmergencyClasses(); - ServerConnection.loadEmergencyClasses(); - } - /** * @see SystemFailure#emergencyClose() */ diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java index bfe7acd95fc9..230e5a95ff3e 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/ServerConnection.java @@ -1448,15 +1448,6 @@ private void releaseCommBuffer() { } } - /** - * Just ensure that this class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - // nothing needed, just make sure this class gets loaded. - } - /** * @see SystemFailure#emergencyClose() */ diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java index 3465311ee3d3..e91b1fa850f3 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java +++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java @@ -72,8 +72,8 @@ import org.apache.geode.distributed.internal.ReplySender; import org.apache.geode.distributed.internal.direct.DirectChannel; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.Membership; import org.apache.geode.internal.Assert; import org.apache.geode.internal.DSFIDFactory; import org.apache.geode.internal.InternalDataSerializer; diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java index dfd723d95d9f..bcb2602a3cd7 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java +++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/ConnectionTable.java @@ -43,8 +43,8 @@ import org.apache.geode.distributed.internal.DistributionManager; import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; +import org.apache.geode.distributed.internal.membership.api.Membership; import org.apache.geode.internal.Assert; import org.apache.geode.internal.SystemTimer; import org.apache.geode.internal.logging.CoreLoggingExecutors; @@ -917,15 +917,6 @@ void removeSharedConnection(String reason, DistributedMember stub, boolean order } } - /** - * Just ensure that this class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - // don't go any further, Frodo! - } - /** * Clears lastInstance. Does not yet close underlying sockets, but probably not strictly * necessary. diff --git a/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java b/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java index 0639bc1d8d2c..e10b41d42a3b 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java +++ b/geode-core/src/main/java/org/apache/geode/internal/tcp/TCPConduit.java @@ -48,8 +48,8 @@ import org.apache.geode.distributed.internal.LonerDistributionManager; import org.apache.geode.distributed.internal.direct.DirectChannel; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.api.MemberShunnedException; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MemberShunnedException; +import org.apache.geode.distributed.internal.membership.api.Membership; import org.apache.geode.internal.inet.LocalHostUtil; import org.apache.geode.internal.logging.log4j.LogMarker; import org.apache.geode.internal.net.BufferPool; @@ -384,15 +384,6 @@ private void createServerSocket() { } } - /** - * Ensure that the ConnectionTable class gets loaded. - * - * @see SystemFailure#loadEmergencyClasses() - */ - public static void loadEmergencyClasses() { - ConnectionTable.loadEmergencyClasses(); - } - /** * Close the ServerSocketChannel, ServerSocket, and the ConnectionTable. * diff --git a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt index 5fefafae0b39..0d39616ef4be 100644 --- a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt +++ b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt @@ -259,11 +259,11 @@ org/apache/geode/distributed/internal/deadlock/MessageDependencyMonitor$MessageK org/apache/geode/distributed/internal/direct/ShunnedMemberException,true,-6455664684151074915 org/apache/geode/distributed/internal/locks/DistributedMemberLock$LockReentryPolicy,false org/apache/geode/distributed/internal/locks/LockGrantorDestroyedException,true,-3540124531032570817 -org/apache/geode/distributed/internal/membership/gms/api/MemberDisconnectedException,true,-3649273301807236514 -org/apache/geode/distributed/internal/membership/gms/api/MemberShunnedException,true,-8453126202477831557 -org/apache/geode/distributed/internal/membership/gms/api/MemberStartupException,true,6610743861046044144 -org/apache/geode/distributed/internal/membership/gms/api/MembershipClosedException,true,6112938405434046127 -org/apache/geode/distributed/internal/membership/gms/api/MembershipConfigurationException,true,5633602142465129621 +org/apache/geode/distributed/internal/membership/api/MemberDisconnectedException,true,-3649273301807236514 +org/apache/geode/distributed/internal/membership/api/MemberShunnedException,true,-8453126202477831557 +org/apache/geode/distributed/internal/membership/api/MemberStartupException,true,6610743861046044144 +org/apache/geode/distributed/internal/membership/api/MembershipClosedException,true,6112938405434046127 +org/apache/geode/distributed/internal/membership/api/MembershipConfigurationException,true,5633602142465129621 org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeave$ViewAbandonedException,false org/apache/geode/distributed/internal/membership/gms/messages/InstallViewMessage$messageType,false org/apache/geode/internal/ConfigSource,true,-4097017272431018553,description:java/lang/String,type:org/apache/geode/internal/ConfigSource$Type diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/PoolImplTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/PoolImplTest.java index b3921bf2e4b2..5487f427ec7b 100644 --- a/geode-core/src/test/java/org/apache/geode/cache/client/internal/PoolImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/PoolImplTest.java @@ -37,7 +37,7 @@ import org.apache.geode.cache.client.internal.pooling.ConnectionManagerImpl; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; +import org.apache.geode.distributed.internal.tcpserver.LocatorAddress; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.PoolFactoryImpl; import org.apache.geode.internal.cache.PoolManagerImpl; @@ -154,7 +154,7 @@ private PoolImpl getPool(int retryAttemptsAttribute) { final ThreadsMonitoring tMonitoring = mock(ThreadsMonitoring.class); - return PoolImpl.create(poolManager, "pool", poolAttributes, new LinkedList(), + return PoolImpl.create(poolManager, "pool", poolAttributes, new LinkedList(), internalDistributedSystem, internalCache, tMonitoring); } diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/ConnectionConfigImplTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/ConnectionConfigImplTest.java index f00ab6d86953..fd1a69a7fae2 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/ConnectionConfigImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/ConnectionConfigImplTest.java @@ -24,7 +24,7 @@ import org.junit.Test; -import org.apache.geode.distributed.internal.membership.gms.api.QuorumChecker; +import org.apache.geode.distributed.internal.membership.api.QuorumChecker; /** * Unit tests for {@link ConnectionConfigImpl}. diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionTest.java index 73ce133b6495..7fda90baf6b1 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/DistributionTest.java @@ -42,10 +42,10 @@ import org.apache.geode.distributed.DistributedSystemDisconnectedException; import org.apache.geode.distributed.internal.direct.DirectChannel; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.Membership; +import org.apache.geode.distributed.internal.membership.api.MembershipClosedException; import org.apache.geode.distributed.internal.membership.gms.GMSMemberData; import org.apache.geode.distributed.internal.membership.gms.GMSMembership; -import org.apache.geode.distributed.internal.membership.gms.api.Membership; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipClosedException; import org.apache.geode.internal.admin.remote.AlertListenerMessage; import org.apache.geode.internal.admin.remote.RemoteTransportConfig; import org.apache.geode.internal.tcp.ConnectExceptions; diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipViewJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/GMSMembershipViewJUnitTest.java similarity index 92% rename from geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipViewJUnitTest.java rename to geode-core/src/test/java/org/apache/geode/distributed/internal/membership/GMSMembershipViewJUnitTest.java index 997ae145a3c1..f17a8c2747e8 100755 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipViewJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/GMSMembershipViewJUnitTest.java @@ -30,14 +30,13 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import org.apache.geode.distributed.internal.ClusterDistributionManager; +import org.apache.geode.distributed.internal.membership.api.MemberIdentifier; import org.apache.geode.distributed.internal.membership.gms.GMSMembershipView; -import org.apache.geode.distributed.internal.membership.gms.api.MemberIdentifier; import org.apache.geode.internal.inet.LocalHostUtil; import org.apache.geode.test.junit.categories.MembershipTest; @Category({MembershipTest.class}) -public class MembershipViewJUnitTest { +public class GMSMembershipViewJUnitTest { private List members; @@ -49,21 +48,21 @@ public void initMembers() throws Exception { members.add(new InternalDistributedMember(LocalHostUtil.getLocalHost(), 1000 + i)); } // view creator is a locator - members.get(0).setVmKind(ClusterDistributionManager.LOCATOR_DM_TYPE); + members.get(0).setVmKind(MemberIdentifier.LOCATOR_DM_TYPE); members.get(0).setVmViewId(0); members.get(0).setPreferredForCoordinator(true); // members who joined in view #1 for (int i = 1; i < (numMembers - 1); i++) { members.get(i).setVmViewId(1); - members.get(i).setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); + members.get(i).setVmKind(MemberIdentifier.NORMAL_DM_TYPE); members.get(i).setPreferredForCoordinator(false); } // member joining in this view members.get(numMembers - 1).setVmViewId(2); members.get(numMembers - 1).getMemberData() - .setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); + .setVmKind(MemberIdentifier.NORMAL_DM_TYPE); } private void setFailureDetectionPorts(GMSMembershipView view) { @@ -184,7 +183,7 @@ public void testAddLotsOfMembers() throws Exception { int oldSize = view.size(); for (int i = 0; i < 100; i++) { MemberIdentifier mbr = new InternalDistributedMember(LocalHostUtil.getLocalHost(), 2000 + i); - mbr.setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); + mbr.setVmKind(MemberIdentifier.NORMAL_DM_TYPE); mbr.setVmViewId(2); view.add(mbr); view.setFailureDetectionPort(mbr, 2000 + i); @@ -233,22 +232,22 @@ public void testFailedWeight() throws Exception { new InternalDistributedMember("localhost", 6)}; int i = 0; // weight 3 - members[i].setVmKind(ClusterDistributionManager.LOCATOR_DM_TYPE); + members[i].setVmKind(MemberIdentifier.LOCATOR_DM_TYPE); members[i++].setPreferredForCoordinator(true); // weight 3 - members[i].setVmKind(ClusterDistributionManager.LOCATOR_DM_TYPE); + members[i].setVmKind(MemberIdentifier.LOCATOR_DM_TYPE); members[i++].setPreferredForCoordinator(true); // weight 15 (cache+leader) - members[i].setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); + members[i].setVmKind(MemberIdentifier.NORMAL_DM_TYPE); members[i++].setPreferredForCoordinator(false); // weight 0 - members[i].setVmKind(ClusterDistributionManager.ADMIN_ONLY_DM_TYPE); + members[i].setVmKind(MemberIdentifier.ADMIN_ONLY_DM_TYPE); members[i++].setPreferredForCoordinator(false); // weight 0 - members[i].setVmKind(ClusterDistributionManager.ADMIN_ONLY_DM_TYPE); + members[i].setVmKind(MemberIdentifier.ADMIN_ONLY_DM_TYPE); members[i++].setPreferredForCoordinator(false); // weight 10 - members[i].setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); + members[i].setVmKind(MemberIdentifier.NORMAL_DM_TYPE); members[i++].setPreferredForCoordinator(false); List vmbrs = new ArrayList<>(members.length); @@ -262,7 +261,7 @@ public void testFailedWeight() throws Exception { assertTrue(!leader.preferredForCoordinator()); MemberIdentifier joiningMember = new InternalDistributedMember("localhost", 7); - joiningMember.setVmKind(ClusterDistributionManager.NORMAL_DM_TYPE); + joiningMember.setVmKind(MemberIdentifier.NORMAL_DM_TYPE); joiningMember.setPreferredForCoordinator(false); // have the joining member and another cache process (weight 10) in the failed members @@ -287,4 +286,5 @@ public void testFailedWeight() throws Exception { Set actual = newView.getActualCrashedMembers(lastView); assertTrue(!actual.contains(members[members.length - 2])); } + } diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/InternalDistributedMemberTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/InternalDistributedMemberTest.java index 0f2afa89b2d2..81dd12d57059 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/InternalDistributedMemberTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/InternalDistributedMemberTest.java @@ -24,7 +24,7 @@ import org.junit.Test; import org.junit.experimental.categories.Category; -import org.apache.geode.distributed.internal.membership.gms.GMSMemberData; +import org.apache.geode.distributed.internal.membership.api.MemberData; import org.apache.geode.test.junit.categories.MembershipTest; /** @@ -73,9 +73,9 @@ public void equalsReturnsFalseIfPortsDiffer() { @Test public void equalsReturnsTrueIfNullInetAddress() throws UnknownHostException { InetAddress localHost = InetAddress.getLocalHost(); - GMSMemberData netMember1 = mock(GMSMemberData.class); + MemberData netMember1 = mock(MemberData.class); when(netMember1.getInetAddress()).thenReturn(localHost).thenReturn(null); - GMSMemberData netMember2 = mock(GMSMemberData.class); + MemberData netMember2 = mock(MemberData.class); when(netMember2.getInetAddress()).thenReturn(localHost).thenReturn(null); InternalDistributedMember member = new InternalDistributedMember(netMember1); InternalDistributedMember other = new InternalDistributedMember(netMember2); @@ -89,9 +89,9 @@ public void equalsReturnsTrueIfNullInetAddress() throws UnknownHostException { public void equalsReturnsFalseIfInetAddressDiffer() throws UnknownHostException { InetAddress host1 = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); InetAddress host2 = InetAddress.getByAddress(new byte[] {127, 0, 0, 2}); - GMSMemberData netMember1 = mock(GMSMemberData.class); + MemberData netMember1 = mock(MemberData.class); when(netMember1.getInetAddress()).thenReturn(host1); - GMSMemberData netMember2 = mock(GMSMemberData.class); + MemberData netMember2 = mock(MemberData.class); when(netMember2.getInetAddress()).thenReturn(host2); InternalDistributedMember member = new InternalDistributedMember(netMember1); InternalDistributedMember other = new InternalDistributedMember(netMember2); @@ -104,9 +104,9 @@ public void equalsReturnsFalseIfInetAddressDiffer() throws UnknownHostException @Test public void equalsReturnsFalseIfGetViewIdDiffer() throws UnknownHostException { InetAddress host1 = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); - GMSMemberData netMember1 = mock(GMSMemberData.class); + MemberData netMember1 = mock(MemberData.class); when(netMember1.getInetAddress()).thenReturn(host1); - GMSMemberData netMember2 = mock(GMSMemberData.class); + MemberData netMember2 = mock(MemberData.class); when(netMember2.getInetAddress()).thenReturn(host1); when(netMember1.getVmViewId()).thenReturn(1); when(netMember2.getVmViewId()).thenReturn(2); @@ -121,9 +121,9 @@ public void equalsReturnsFalseIfGetViewIdDiffer() throws UnknownHostException { @Test public void equalsReturnsFalseIfUniqueTagsDiffer() throws UnknownHostException { InetAddress host1 = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); - GMSMemberData netMember1 = mock(GMSMemberData.class); + MemberData netMember1 = mock(MemberData.class); when(netMember1.getInetAddress()).thenReturn(host1); - GMSMemberData netMember2 = mock(GMSMemberData.class); + MemberData netMember2 = mock(MemberData.class); when(netMember2.getInetAddress()).thenReturn(host1); InternalDistributedMember member = new InternalDistributedMember(netMember1); member.setUniqueTag("tag1"); @@ -138,10 +138,10 @@ public void equalsReturnsFalseIfUniqueTagsDiffer() throws UnknownHostException { @Test public void equalsReturnsFalseIfNotPartialAndNamesDiffer() throws UnknownHostException { InetAddress host1 = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); - GMSMemberData netMember1 = mock(GMSMemberData.class); + MemberData netMember1 = mock(MemberData.class); when(netMember1.getInetAddress()).thenReturn(host1); when(netMember1.getName()).thenReturn("name1"); - GMSMemberData netMember2 = mock(GMSMemberData.class); + MemberData netMember2 = mock(MemberData.class); when(netMember2.getInetAddress()).thenReturn(host1); when(netMember2.getName()).thenReturn("name2"); InternalDistributedMember member = new InternalDistributedMember(netMember1); @@ -157,9 +157,9 @@ public void equalsReturnsFalseIfNotPartialAndNamesDiffer() throws UnknownHostExc @Test public void equalsReturnsFalseIfCompareAdditionalDataDiffer() throws UnknownHostException { InetAddress host1 = InetAddress.getByAddress(new byte[] {127, 0, 0, 1}); - GMSMemberData netMember1 = mock(GMSMemberData.class); + MemberData netMember1 = mock(MemberData.class); when(netMember1.getInetAddress()).thenReturn(host1); - GMSMemberData netMember2 = mock(GMSMemberData.class); + MemberData netMember2 = mock(MemberData.class); when(netMember2.getInetAddress()).thenReturn(host1); when(netMember1.compareAdditionalData(netMember2)).thenReturn(1); when(netMember2.compareAdditionalData(netMember1)).thenReturn(-1); diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java index 9360518c19e1..044bf1d45052 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/MembershipDependenciesJUnitTest.java @@ -62,6 +62,7 @@ public class MembershipDependenciesJUnitTest { .should() .onlyDependOnClassesThat( resideInAPackage("org.apache.geode.distributed.internal.membership.gms..") + .or(resideInAPackage("org.apache.geode.distributed.internal.membership.api..")) // OK to depend on these "leaf" dependencies .or(resideInAPackage("org.apache.geode.internal.serialization..")) @@ -86,6 +87,7 @@ public class MembershipDependenciesJUnitTest { .should() .onlyDependOnClassesThat( resideInAPackage("org.apache.geode.distributed.internal.membership.gms..") + .or(resideInAPackage("org.apache.geode.distributed.internal.membership.api..")) // OK to depend on these "leaf" dependencies .or(resideInAPackage("org.apache.geode.internal.serialization..")) diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/adapter/auth/AbstractGMSAuthenticatorTestCase.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/adapter/auth/AbstractGMSAuthenticatorTestCase.java index b2e7c537f992..66ea8ecb4e64 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/adapter/auth/AbstractGMSAuthenticatorTestCase.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/adapter/auth/AbstractGMSAuthenticatorTestCase.java @@ -29,8 +29,8 @@ import org.apache.geode.distributed.DistributedMember; import org.apache.geode.distributed.internal.DistributionConfig; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; import org.apache.geode.internal.inet.LocalHostUtil; import org.apache.geode.internal.security.SecurityService; import org.apache.geode.security.AuthInitialize; diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/api/MembershipAPIArchUnitTest.java similarity index 95% rename from geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java rename to geode-core/src/test/java/org/apache/geode/distributed/internal/membership/api/MembershipAPIArchUnitTest.java index c1470d6dec40..a4ef7f6a4871 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/api/MembershipAPIArchUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/api/MembershipAPIArchUnitTest.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms.api; +package org.apache.geode.distributed.internal.membership.api; import static com.tngtech.archunit.base.DescribedPredicate.not; import static com.tngtech.archunit.core.domain.JavaClass.Predicates.resideInAPackage; @@ -31,7 +31,7 @@ import org.apache.geode.distributed.internal.membership.gms.MembershipBuilderImpl; @RunWith(ArchUnitRunner.class) -@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.membership.gms.api", +@AnalyzeClasses(packages = "org.apache.geode.distributed.internal.membership.api", cacheMode = CacheMode.PER_CLASS, importOptions = ImportOption.DoNotIncludeArchives.class) public class MembershipAPIArchUnitTest { @@ -39,10 +39,10 @@ public class MembershipAPIArchUnitTest { @ArchTest public static final ArchRule membershipAPIDoesntDependOnMembershipORCore = classes() .that() - .resideInAPackage("org.apache.geode.distributed.internal.membership.gms.api") + .resideInAPackage("org.apache.geode.distributed.internal.membership.api") .should() .onlyDependOnClassesThat( - resideInAPackage("org.apache.geode.distributed.internal.membership.gms.api") + resideInAPackage("org.apache.geode.distributed.internal.membership.api") .or(not(resideInAPackage("org.apache.geode.."))) // Serialization is a dependency of membership .or(resideInAPackage("org.apache.geode.internal.serialization..")) diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/GMSUtilTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/GMSUtilTest.java index 6c6c3ddf8831..fb3ec544297e 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/GMSUtilTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/GMSUtilTest.java @@ -27,7 +27,7 @@ import org.junit.Test; import org.junit.runner.RunWith; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfigurationException; +import org.apache.geode.distributed.internal.membership.api.MembershipConfigurationException; import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; @RunWith(JUnitParamsRunner.class) diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImplTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImplTest.java index 1461400ae67b..8a3cb67bd8d7 100644 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImplTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/MemberDataBuilderImplTest.java @@ -22,8 +22,8 @@ import org.junit.Test; -import org.apache.geode.distributed.internal.membership.gms.api.MemberData; -import org.apache.geode.distributed.internal.membership.gms.api.MemberDataBuilder; +import org.apache.geode.distributed.internal.membership.api.MemberData; +import org.apache.geode.distributed.internal.membership.api.MemberDataBuilder; import org.apache.geode.internal.serialization.Version; public class MemberDataBuilderImplTest { diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorderJUnitTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorderJUnitTest.java index 661af2b67014..fc356ab75eea 100755 --- a/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorderJUnitTest.java +++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/membership/gms/messenger/StatRecorderJUnitTest.java @@ -38,9 +38,9 @@ import org.junit.Test; import org.junit.experimental.categories.Category; +import org.apache.geode.distributed.internal.membership.api.MembershipConfig; +import org.apache.geode.distributed.internal.membership.api.MembershipStatistics; import org.apache.geode.distributed.internal.membership.gms.Services; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipConfig; -import org.apache.geode.distributed.internal.membership.gms.api.MembershipStatistics; import org.apache.geode.distributed.internal.membership.gms.interfaces.Manager; import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator; import org.apache.geode.test.junit.categories.MembershipTest; diff --git a/geode-dunit/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipManagerHelper.java b/geode-dunit/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipManagerHelper.java similarity index 90% rename from geode-dunit/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipManagerHelper.java rename to geode-dunit/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipManagerHelper.java index df306ca265f2..3e196acaa9fc 100644 --- a/geode-dunit/src/main/java/org/apache/geode/distributed/internal/membership/gms/MembershipManagerHelper.java +++ b/geode-dunit/src/main/java/org/apache/geode/distributed/internal/membership/api/MembershipManagerHelper.java @@ -12,7 +12,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package org.apache.geode.distributed.internal.membership.gms; +package org.apache.geode.distributed.internal.membership.api; import static org.apache.geode.test.awaitility.GeodeAwaitility.await; @@ -26,6 +26,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.MembershipTestHook; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; +import org.apache.geode.distributed.internal.membership.gms.GMSMembership; import org.apache.geode.test.awaitility.GeodeAwaitility; import org.apache.geode.test.dunit.WaitCriterion; @@ -126,14 +127,19 @@ public String description() { // this method is only used for testing. Should be extract to a test helper instead public static void crashDistributedSystem(final DistributedSystem msys) { msys.getLogWriter().info("crashing distributed system: " + msys); - Distribution mgr = ((Distribution) getDistribution(msys)); + Distribution mgr = getDistribution(msys); MembershipManagerHelper.inhibitForcedDisconnectLogging(true); MembershipManagerHelper.beSickMember(msys); MembershipManagerHelper.playDead(msys); - mgr.forceDisconnect("for testing"); + ((GMSMembership) mgr.getMembership()).getGMSManager().forceDisconnect("for testing"); // wait at most 10 seconds for system to be disconnected await().until(() -> !msys.isConnected()); MembershipManagerHelper.inhibitForcedDisconnectLogging(false); } + public static void disableDisconnectOnQuorumLossForTesting(DistributedSystem msys) { + msys.getLogWriter().info("crashing distributed system: " + msys); + Distribution mgr = getDistribution(msys); + ((GMSMembership) mgr.getMembership()).disableDisconnectOnQuorumLossForTesting(); + } } diff --git a/geode-dunit/src/main/java/org/apache/geode/test/dunit/DistributedTestUtils.java b/geode-dunit/src/main/java/org/apache/geode/test/dunit/DistributedTestUtils.java index f08ea78358af..087d25ee6339 100755 --- a/geode-dunit/src/main/java/org/apache/geode/test/dunit/DistributedTestUtils.java +++ b/geode-dunit/src/main/java/org/apache/geode/test/dunit/DistributedTestUtils.java @@ -26,7 +26,7 @@ import org.apache.geode.distributed.ConfigurationProperties; import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.InternalDataSerializer; import org.apache.geode.internal.InternalInstantiator; diff --git a/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/MemberStarterRule.java b/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/MemberStarterRule.java index 68d1ae7573fc..163a8b0e9395 100644 --- a/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/MemberStarterRule.java +++ b/geode-dunit/src/main/java/org/apache/geode/test/junit/rules/MemberStarterRule.java @@ -61,7 +61,7 @@ import org.apache.geode.cache.ssl.CertificateMaterial; import org.apache.geode.distributed.DistributedSystem; import org.apache.geode.distributed.internal.InternalDistributedSystem; -import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper; +import org.apache.geode.distributed.internal.membership.api.MembershipManagerHelper; import org.apache.geode.internal.UniquePortSupplier; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier; diff --git a/geode-tcp-server/build.gradle b/geode-tcp-server/build.gradle index 294ae8885589..7b2a3d659d1d 100644 --- a/geode-tcp-server/build.gradle +++ b/geode-tcp-server/build.gradle @@ -25,6 +25,10 @@ dependencies { implementation('org.apache.logging.log4j:log4j-api') + //Commons validator is used to validate inet addresses + implementation('commons-validator:commons-validator') + + testImplementation('com.tngtech.archunit:archunit-junit4') integrationTestImplementation('com.tngtech.archunit:archunit-junit4') diff --git a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/LocatorAddress.java b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/LocatorAddress.java new file mode 100644 index 000000000000..cf073580dc75 --- /dev/null +++ b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/LocatorAddress.java @@ -0,0 +1,110 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional information regarding + * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the License. You may obtain a + * copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.apache.geode.distributed.internal.tcpserver; + +import java.net.InetSocketAddress; + +import org.apache.commons.validator.routines.InetAddressValidator; + +public class LocatorAddress { + + private final InetSocketAddress socketInetAddress; + private final String hostname; + private final int port; + private final boolean isIpString; + + public LocatorAddress(InetSocketAddress loc, String locStr) { + this.socketInetAddress = loc; + this.hostname = locStr; + this.port = loc.getPort(); + this.isIpString = InetAddressValidator.getInstance().isValid(locStr); + } + + public boolean isIpString() { + return isIpString; + } + + /** + * if host is ipString then it will return the cached InetSocketAddress Otherwise it will create + * the new instance of InetSocketAddress + */ + public InetSocketAddress getSocketInetAddress() { + if (this.isIpString) { + return this.socketInetAddress; + } else { + return new InetSocketAddress(hostname, this.socketInetAddress.getPort()); + } + } + + public String getHostName() { + return hostname; + } + + public int getPort() { + return port; + } + + /** + * If component has retry logic then use this method to get the InetSocketAddress address + * AutoConnectionSourceImpl for client has retry logic; This way client will not make DNS query + * each time + * + */ + public InetSocketAddress getSocketInetAddressNoLookup() { + return this.socketInetAddress; + } + + @Override + public int hashCode() { + int prime = 31; + int result = 1; + result = prime * result + (isIpString ? 1231 : 1237); + result = prime * result + (socketInetAddress == null ? 0 : socketInetAddress.hashCode()); + result = prime * result + (hostname == null ? 0 : hostname.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + LocatorAddress other = (LocatorAddress) obj; + if (isIpString != other.isIpString) + return false; + if (socketInetAddress == null) { + if (other.socketInetAddress != null) + return false; + } else if (!socketInetAddress.equals(other.socketInetAddress)) + return false; + if (hostname == null) { + if (other.hostname != null) + return false; + } else if (!hostname.equals(other.hostname)) + return false; + return true; + } + + @Override + public String toString() { + return getClass().getSimpleName() + + " [socketInetAddress=" + socketInetAddress + ", hostname=" + hostname + + ", isIpString=" + isIpString + "]"; + } + +} diff --git a/geode-tcp-server/src/test/resources/expected-pom.xml b/geode-tcp-server/src/test/resources/expected-pom.xml index cfb724cdc5e8..0bed10528a1b 100644 --- a/geode-tcp-server/src/test/resources/expected-pom.xml +++ b/geode-tcp-server/src/test/resources/expected-pom.xml @@ -61,5 +61,10 @@ log4j-api runtime + + commons-validator + commons-validator + runtime + diff --git a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcherIntegrationTest.java b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcherIntegrationTest.java index e734a1d5397b..f564b0814bff 100644 --- a/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcherIntegrationTest.java +++ b/geode-wan/src/test/java/org/apache/geode/internal/cache/wan/GatewaySenderEventRemoteDispatcherIntegrationTest.java @@ -41,7 +41,6 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem; import org.apache.geode.distributed.internal.ServerLocation; import org.apache.geode.distributed.internal.membership.InternalDistributedMember; -import org.apache.geode.distributed.internal.membership.gms.membership.HostAddress; import org.apache.geode.internal.cache.InternalCache; import org.apache.geode.internal.cache.PoolFactoryImpl; import org.apache.geode.internal.cache.PoolManagerImpl; @@ -150,7 +149,7 @@ private PoolImpl getPool() { final ThreadsMonitoring tMonitoring = mock(ThreadsMonitoring.class); - return PoolImpl.create(poolManager, "pool", poolAttributes, new LinkedList(), + return PoolImpl.create(poolManager, "pool", poolAttributes, new LinkedList<>(), internalDistributedSystem, internalCache, tMonitoring); }