Skip to content

Commit

Permalink
GEODE-6883: New module for Membership (apache#4579)
Browse files Browse the repository at this point in the history
- includes a few more dependency cleanups as well.
- pom updates
- JGroups unitt use InternalDataSerializer directly.
  • Loading branch information
Ernie Burghardt authored Jan 13, 2020
1 parent daa7efd commit bbecffc
Show file tree
Hide file tree
Showing 108 changed files with 257 additions and 30 deletions.
6 changes: 6 additions & 0 deletions boms/geode-all-bom/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,12 @@
<version>1.12.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-membership</artifactId>
<version>1.12.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-memcached</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ SESSION_JAR="${LIB_DIR}/geode-modules-session-${VERSION}.jar"
declare -a OTHER_JARS
OTHER_JARS=(${GEODE}/lib/geode-core-${VERSION}.jar \
${GEODE}/lib/geode-logging-${VERSION}.jar \
${GEODE}/lib/geode-membership-${VERSION}.jar \
${GEODE}/lib/geode-serialization-${VERSION}.jar \
${GEODE}/lib/geode-tcp-server-${VERSION}.jar \
${GEODE}/lib/geode-common-${VERSION}.jar \
Expand Down
1 change: 1 addition & 0 deletions extensions/geode-modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ evaluationDependsOn(":geode-core")
dependencies {
compile(platform(project(':boms:geode-all-bom')))
implementation(project(':geode-logging'))
implementation(project(':geode-membership'))
implementation(project(':geode-serialization'))
compile(project(':geode-core'))
integrationTestCompile(project(':extensions:geode-modules-test')) {
Expand Down
1 change: 1 addition & 0 deletions geode-assembly/geode-assembly-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
compileOnly(project(':geode-core'))
compileOnly(project(':geode-pulse'))
implementation(project(':geode-logging'))
implementation(project(':geode-membership'))
compileOnly('com.fasterxml.jackson.core:jackson-databind')
compileOnly('commons-io:commons-io')
compileOnly('junit:junit')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public String jarSkipPropertyName() {
*/
private static final String[] tomcatRequiredJars =
{"antlr", "commons-io", "commons-lang", "commons-validator", "fastutil", "geode-common",
"geode-core", "geode-log4j", "geode-logging", "geode-management", "geode-serialization",
"geode-core", "geode-log4j", "geode-logging", "geode-membership", "geode-management",
"geode-serialization",
"geode-tcp-server", "javax.transaction-api", "jgroups", "log4j-api", "log4j-core",
"log4j-jul", "micrometer", "shiro-core", "jetty-server", "jetty-util", "jetty-http",
"jetty-io"};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -963,10 +963,12 @@ lib/commons-digester-2.1.jar
lib/commons-io-2.6.jar
lib/commons-lang3-3.9.jar
lib/commons-logging-1.2.jar
lib/geode-membership-0.0.0.jar
lib/commons-math3-3.2.jar
lib/commons-modeler-2.0.1.jar
lib/commons-validator-1.6.jar
lib/fastutil-8.3.0.jar
lib/findbugs-annotations-1.3.9-1.jar
lib/geo-0.7.1.jar
lib/geode-common-0.0.0.jar
lib/geode-connectors-0.0.0.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ geode-cq-0.0.0.jar
geode-gfsh-0.0.0.jar
geode-log4j-0.0.0.jar
geode-logging-0.0.0.jar
geode-membership-0.0.0.jar
geode-lucene-0.0.0.jar
geode-management-0.0.0.jar
geode-memcached-0.0.0.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ commons-validator
error_prone_annotations
failureaccess
fastutil
findbugs-annotations
geo
gfsh-dependencies.jar
grumpy-core
Expand Down Expand Up @@ -117,6 +118,5 @@ springfox-spring-web
springfox-swagger
springfox-swagger-common
springfox-swagger-ui
spring-jcl
swagger-annotations
swagger-models
1 change: 1 addition & 0 deletions geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ dependencies {
//Geode-common has annotations and other pieces used geode-core
api(project(':geode-common'))
implementation(project(':geode-logging'))
implementation(project(':geode-membership'))
implementation(project(':geode-unsafe'))
implementation(project(':geode-serialization'))
implementation(project(':geode-tcp-server'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@
import org.apache.geode.distributed.internal.membership.gms.messenger.JGroupsMessenger.JGroupsReceiver;
import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreator;
import org.apache.geode.internal.AvailablePortHelper;
import org.apache.geode.internal.InternalDataSerializer;
import org.apache.geode.internal.admin.remote.RemoteTransportConfig;
import org.apache.geode.internal.net.SocketCreatorFactory;
import org.apache.geode.internal.security.SecurableCommunicationChannel;
import org.apache.geode.internal.serialization.BufferDataOutputStream;
import org.apache.geode.internal.serialization.DSFIDSerializer;
import org.apache.geode.internal.serialization.DSFIDSerializerImpl;
import org.apache.geode.internal.serialization.DataSerializableFixedID;
import org.apache.geode.internal.serialization.DeserializationContext;
import org.apache.geode.internal.serialization.SerializationContext;
Expand Down Expand Up @@ -172,7 +172,7 @@ private void initMocks(boolean enableMcast, Properties addProp) throws Exception
when(services.getHealthMonitor()).thenReturn(healthMonitor);
when(services.getManager()).thenReturn(manager);
when(services.getJoinLeave()).thenReturn(joinLeave);
DSFIDSerializer serializer = new DSFIDSerializerImpl();
DSFIDSerializer serializer = InternalDataSerializer.getDSFIDSerializer();
Services.registerSerializables(serializer);
when(services.getSerializer()).thenReturn(serializer);
Version current = Version.CURRENT; // force Version static initialization to set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

package org.apache.geode.distributed;

import org.apache.geode.distributed.internal.membership.api.MembershipConfig;

/**
* This interface defines all the configuration properties that can be used. <U>Since</U>: Geode 1.0
*/
Expand Down Expand Up @@ -1188,7 +1190,7 @@ public interface ConfigurationProperties {
* <p>
* <U>Default</U>: ""
*/
String LOCATORS = "locators";
String LOCATORS = MembershipConfig.LOCATORS;
/**
* The static String definition of the <i>"log-disk-space-limit"</i> property <a
* name="log-disk-space-limit"/a>
Expand Down Expand Up @@ -1767,7 +1769,7 @@ public interface ConfigurationProperties {
* <p>
* <U>Default</U>: "" (doesn't start a locator)
*/
String START_LOCATOR = "start-locator";
String START_LOCATOR = MembershipConfig.START_LOCATOR;
/**
* The static String definition of the <i>"statistic-archive-file"</i> property <a
* name="statistic-archive-file"/a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1607,12 +1607,6 @@ static InetAddress _getDefaultMcastAddress() {
*/
int DEFAULT_UDP_RECV_BUFFER_SIZE = MembershipConfig.DEFAULT_UDP_RECV_BUFFER_SIZE;

/**
* The default size of the {@link ConfigurationProperties#UDP_RECV_BUFFER_SIZE} if tcp/ip sockets
* are enabled and multicast is disabled
*/
int DEFAULT_UDP_RECV_BUFFER_SIZE_REDUCED = 65535;

/**
* The minimum size of the {@link ConfigurationProperties#UDP_RECV_BUFFER_SIZE}, in bytes.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.apache.geode.distributed.internal.ReplySender;
import org.apache.geode.distributed.internal.SerialDistributionMessage;
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
import org.apache.geode.distributed.internal.membership.api.CacheOperationMessageMarker;
import org.apache.geode.internal.Assert;
import org.apache.geode.internal.CopyOnWriteHashSet;
import org.apache.geode.internal.InternalDataSerializer;
Expand Down Expand Up @@ -901,7 +902,8 @@ public static void setBeforePutOutgoing(Runnable beforePutOutgoing) {
}

public abstract static class CacheOperationMessage extends SerialDistributionMessage
implements MessageWithReply, DirectReplyMessage, OldValueImporter {
implements MessageWithReply, DirectReplyMessage, OldValueImporter,
CacheOperationMessageMarker {

protected static final short POSSIBLE_DUPLICATE_MASK = POS_DUP;
protected static final short OLD_VALUE_MASK = DistributionMessage.UNRESERVED_FLAGS_START;
Expand Down
5 changes: 5 additions & 0 deletions geode-core/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@
<artifactId>geode-logging</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-membership</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-unsafe</artifactId>
Expand Down
1 change: 1 addition & 0 deletions geode-cq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {
compile(platform(project(':boms:geode-all-bom')))
compile(project(':geode-core'))
implementation(project(':geode-logging'))
implementation(project(':geode-membership'))
implementation(project(':geode-serialization'))
testCompile(project(':geode-junit')) {
exclude module: 'geode-core'
Expand Down
5 changes: 5 additions & 0 deletions geode-cq/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<artifactId>geode-logging</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-membership</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-serialization</artifactId>
Expand Down
1 change: 1 addition & 0 deletions geode-gfsh/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
api(platform(project(':boms:geode-all-bom')))
compile(project(':geode-core'))
compile(project(':geode-logging'))
compile(project(':geode-membership'))
compile(project(':geode-serialization'))
compile(project(':geode-unsafe'))

Expand Down
5 changes: 5 additions & 0 deletions geode-gfsh/src/test/resources/expected-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
<artifactId>geode-logging</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-membership</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.geode</groupId>
<artifactId>geode-serialization</artifactId>
Expand Down
76 changes: 76 additions & 0 deletions geode-membership/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* 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.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish-java.gradle"

dependencies {
compile(platform(project(':boms:geode-all-bom')))

// Geode-common has annotations and other pieces used by geode-logging
api(project(':geode-common'))
implementation(project(':geode-logging'))
implementation('org.apache.logging.log4j:log4j-api')
implementation('org.jgroups:jgroups')
implementation('org.apache.commons:commons-lang3')
implementation('it.unimi.dsi:fastutil')
implementation('com.github.stephenc.findbugs:findbugs-annotations')

implementation(project(':geode-serialization'))
implementation(project(':geode-tcp-server'))
//Jgroups is a core component of our membership system.
implementation('org.jgroups:jgroups')

testCompile(project(':geode-junit')) {
exclude module: 'geode-logging'
}
testCompile(project(':geode-concurrency-test'))

testCompile('org.mockito:mockito-core')
testCompile('junit:junit')
testCompile('org.assertj:assertj-core')

testRuntime(project(path: ':geode-old-versions', configuration: 'testOutput'))

integrationTestCompile(project(':geode-junit')) {
exclude module: 'geode-logging'
}
integrationTestCompile(project(':geode-dunit')) {
exclude module: 'geode-logging'
}
integrationTestCompile('pl.pragmatists:JUnitParams')
distributedTestCompile(project(':geode-junit')) {
exclude module: 'geode-logging'
}
distributedTestCompile(project(':geode-dunit')) {
exclude module: 'geode-logging'
}
distributedTestCompile('pl.pragmatists:JUnitParams')
distributedTestRuntime(project(path: ':geode-old-versions', configuration: 'testOutput'))
upgradeTestRuntime(project(path: ':geode-old-versions', configuration: 'testOutput'))

testImplementation('com.tngtech.archunit:archunit-junit4')

}

distributedTest {
// Some tests have inner tests that should be ignored
exclude "**/*\$*.class"
}


Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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;

/**
* This interface in implemented by message classes performing cache
* operations and is used to check for message type internally.
*/
public interface CacheOperationMessageMarker {
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public interface MembershipConfig {
int DEFAULT_MCAST_RECV_BUFFER_SIZE = 1048576;
int DEFAULT_UDP_RECV_BUFFER_SIZE = 1048576;
int DEFAULT_UDP_SEND_BUFFER_SIZE = 65535;
int DEFAULT_UDP_RECV_BUFFER_SIZE_REDUCED = 65535;
int DEFAULT_MCAST_BYTE_ALLOWANCE = 1048576;
float DEFAULT_MCAST_RECHARGE_THRESHOLD = (float) 0.25;
int DEFAULT_MCAST_RECHARGE_BLOCKING_MS = 5000;
Expand All @@ -68,6 +69,9 @@ public interface MembershipConfig {
boolean DEFAULT_IS_RECONNECTING_DS = false;
int DEFAULT_JOIN_TIMEOUT = 24000;

String LOCATORS = "locators";
String START_LOCATOR = "start-locator";

default boolean isReconnecting() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*/
package org.apache.geode.distributed.internal.membership.gms;

import static org.apache.geode.internal.serialization.DataSerializableFixedID.DISTRIBUTED_MEMBER;
import static org.apache.geode.internal.serialization.DataSerializableFixedID.FINAL_CHECK_PASSED_MESSAGE;
import static org.apache.geode.internal.serialization.DataSerializableFixedID.FIND_COORDINATOR_REQ;
import static org.apache.geode.internal.serialization.DataSerializableFixedID.FIND_COORDINATOR_RESP;
Expand All @@ -37,7 +36,6 @@
import org.apache.logging.log4j.Logger;

import org.apache.geode.annotations.VisibleForTesting;
import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
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;
Expand Down Expand Up @@ -168,7 +166,6 @@ public static void registerSerializables(DSFIDSerializer serializer) {
serializer.registerDSFID(LEAVE_REQUEST_MESSAGE, LeaveRequestMessage.class);
serializer.registerDSFID(VIEW_ACK_MESSAGE, ViewAckMessage.class);
serializer.registerDSFID(INSTALL_VIEW_MESSAGE, InstallViewMessage.class);
serializer.registerDSFID(DISTRIBUTED_MEMBER, InternalDistributedMember.class);
serializer.registerDSFID(NETVIEW, GMSMembershipView.class);
serializer.registerDSFID(GET_VIEW_REQ, GetViewRequest.class);
serializer.registerDSFID(GET_VIEW_RESP, GetViewResponse.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.apache.logging.log4j.Logger;
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;
Expand Down Expand Up @@ -582,7 +581,7 @@ boolean doTCPCheckMember(ID suspectMember, int port,
} catch (IOException e) {
// this is expected if it is a connection-timeout or other failure
// to connect
} catch (IllegalStateException | GemFireConfigException e) {
} catch (IllegalStateException e) {
if (!isStopping) {
logger.trace("Unexpected exception", e);
}
Expand Down
Loading

0 comments on commit bbecffc

Please sign in to comment.