You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by kl...@apache.org on 2017/04/07 19:34:18 UTC
[19/19] geode git commit: Reformatted
Reformatted
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/eb89fe28
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/eb89fe28
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/eb89fe28
Branch: refs/heads/feature/GEODE-2632
Commit: eb89fe281d598d57e8768059ca7cae15493da9b4
Parents: a071d0c
Author: Kirk Lund <kl...@apache.org>
Authored: Wed Apr 5 12:48:28 2017 -0700
Committer: Kirk Lund <kl...@apache.org>
Committed: Wed Apr 5 12:49:42 2017 -0700
----------------------------------------------------------------------
.../cache/tier/sockets/AcceptorImpl.java | 22 +++---
.../cache/tier/sockets/CacheClientNotifier.java | 64 ++++++++--------
.../cache/tier/sockets/CacheClientProxy.java | 69 +++++++----------
.../internal/cache/tier/sockets/HandShake.java | 6 +-
.../tier/sockets/AcceptorImplJUnitTest.java | 12 ++-
.../cache/tier/sockets/AcceptorImplTest.java | 80 ++++++++------------
.../tier/sockets/ClientServerMiscDUnitTest.java | 3 +-
.../cache/tier/sockets/HAInterestTestCase.java | 22 ++++--
.../sockets/InterestListRecoveryDUnitTest.java | 4 +-
.../tier/sockets/RedundancyLevelTestBase.java | 11 ++-
.../tier/sockets/command/Put65BenchTest.java | 4 +-
.../sockets/command/Put65RealBenchTest.java | 16 ++--
12 files changed, 144 insertions(+), 169 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java
----------------------------------------------------------------------
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 47749f8..d8c64f4 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
@@ -293,14 +293,11 @@ public class AcceptorImpl implements Acceptor, Runnable {
* @since GemFire 5.7
*/
public AcceptorImpl(int port, String bindHostName, boolean notifyBySubscription,
- int socketBufferSize, int maximumTimeBetweenPings,
- InternalCache internalCache,
- int maxConnections, int maxThreads, int maximumMessageCount,
- int messageTimeToLive,
- ConnectionListener listener, List overflowAttributesList,
- boolean isGatewayReceiver,
- List<GatewayTransportFilter> transportFilter, boolean tcpNoDelay,
- final CancelCriterion cancelCriterion) throws IOException {
+ int socketBufferSize, int maximumTimeBetweenPings, InternalCache internalCache,
+ int maxConnections, int maxThreads, int maximumMessageCount, int messageTimeToLive,
+ ConnectionListener listener, List overflowAttributesList, boolean isGatewayReceiver,
+ List<GatewayTransportFilter> transportFilter, boolean tcpNoDelay,
+ final CancelCriterion cancelCriterion) throws IOException {
this.bindHostName = calcBindHostName(internalCache, bindHostName);
this.connectionListener = listener == null ? new ConnectionListenerAdapter() : listener;
this.notifyBySubscription = notifyBySubscription;
@@ -488,11 +485,12 @@ public class AcceptorImpl implements Acceptor, Runnable {
}
- final StatisticsFactory statsFactory = isGatewayReceiver ?
- new DummyStatisticsFactory() : this.cache.getDistributedSystem();
+ final StatisticsFactory statsFactory =
+ isGatewayReceiver ? new DummyStatisticsFactory() : this.cache.getDistributedSystem();
- this.clientNotifier = CacheClientNotifier.getInstance(this.cache, this.stats, statsFactory, maximumMessageCount,
- messageTimeToLive, this.connectionListener, overflowAttributesList, isGatewayReceiver);
+ this.clientNotifier =
+ CacheClientNotifier.getInstance(this.cache, this.stats, statsFactory, maximumMessageCount,
+ messageTimeToLive, this.connectionListener, overflowAttributesList, isGatewayReceiver);
// Create the singleton ClientHealthMonitor
this.healthMonitor = ClientHealthMonitor.getInstance(this.cache, maximumTimeBetweenPings,
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
index 25142a0..813d569 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -136,16 +136,12 @@ public class CacheClientNotifier {
* Factory method to construct a CacheClientNotifier <code>CacheClientNotifier</code> instance.
*/
public static synchronized CacheClientNotifier getInstance(final Cache cache,
- final CacheServerStats acceptorStats,
- final StatisticsFactory statsFactory,
- final int maximumMessageCount,
- final int messageTimeToLive,
- final ConnectionListener listener,
- final List overflowAttributesList,
- final boolean isGatewayReceiver) {
+ final CacheServerStats acceptorStats, final StatisticsFactory statsFactory,
+ final int maximumMessageCount, final int messageTimeToLive, final ConnectionListener listener,
+ final List overflowAttributesList, final boolean isGatewayReceiver) {
if (ccnSingleton == null) {
- ccnSingleton = new CacheClientNotifier(cache, acceptorStats, statsFactory, maximumMessageCount,
- messageTimeToLive, listener);
+ ccnSingleton = new CacheClientNotifier(cache, acceptorStats, statsFactory,
+ maximumMessageCount, messageTimeToLive, listener);
}
if (!isGatewayReceiver && ccnSingleton.getHaContainer() == null) {
@@ -162,6 +158,7 @@ public class CacheClientNotifier {
/**
* Constructor.
+ *
* @param cache The GemFire <code>Cache</code>
* @param acceptorStats
* @param statsFactory
@@ -170,12 +167,9 @@ public class CacheClientNotifier {
* @param listener a listener which should receive notifications abouts queues being added or
* removed.
*/
- private CacheClientNotifier(final Cache cache,
- final CacheServerStats acceptorStats,
- final StatisticsFactory statsFactory,
- final int maximumMessageCount,
- final int messageTimeToLive,
- final ConnectionListener listener) {
+ private CacheClientNotifier(final Cache cache, final CacheServerStats acceptorStats,
+ final StatisticsFactory statsFactory, final int maximumMessageCount,
+ final int messageTimeToLive, final ConnectionListener listener) {
// Set the Cache
this.setCache((GemFireCacheImpl) cache);
this.acceptorStats = acceptorStats;
@@ -398,23 +392,25 @@ public class CacheClientNotifier {
Properties credentials = HandShake.readCredentials(dis, dos, system);
if (credentials != null && proxy != null) {
if (securityLogger.isDebugEnabled()) {
- securityLogger
- .debug("CacheClientNotifier: verifying credentials for proxyID: {}", proxyID);
+ securityLogger.debug("CacheClientNotifier: verifying credentials for proxyID: {}",
+ proxyID);
}
- Object subject = HandShake.verifyCredentials(authenticator, credentials,
- system.getSecurityProperties(), system.getLogWriter(), system.getSecurityLogWriter(), member);
+ Object subject =
+ HandShake.verifyCredentials(authenticator, credentials, system.getSecurityProperties(),
+ system.getLogWriter(), system.getSecurityLogWriter(), member);
if (subject instanceof Principal) {
Principal principal = (Principal) subject;
if (securityLogger.isDebugEnabled()) {
- securityLogger
- .debug("CacheClientNotifier: successfully verified credentials for proxyID: {} having principal: {}", proxyID, principal.getName());
+ securityLogger.debug(
+ "CacheClientNotifier: successfully verified credentials for proxyID: {} having principal: {}",
+ proxyID, principal.getName());
}
String postAuthzFactoryName = sysProps.getProperty(SECURITY_CLIENT_ACCESSOR_PP);
if (postAuthzFactoryName != null && postAuthzFactoryName.length() > 0) {
if (principal == null) {
- securityLogger.warn(
- LocalizedMessage.create(LocalizedStrings.CacheClientNotifier_CACHECLIENTNOTIFIER_POST_PROCESS_AUTHORIZATION_CALLBACK_ENABLED_BUT_AUTHENTICATION_CALLBACK_0_RETURNED_WITH_NULL_CREDENTIALS_FOR_PROXYID_1,
+ securityLogger.warn(LocalizedMessage.create(
+ LocalizedStrings.CacheClientNotifier_CACHECLIENTNOTIFIER_POST_PROCESS_AUTHORIZATION_CALLBACK_ENABLED_BUT_AUTHENTICATION_CALLBACK_0_RETURNED_WITH_NULL_CREDENTIALS_FOR_PROXYID_1,
new Object[] {SECURITY_CLIENT_AUTHENTICATOR, proxyID}));
}
Method authzMethod = ClassLoadUtil.methodFromName(postAuthzFactoryName);
@@ -431,14 +427,14 @@ public class CacheClientNotifier {
LocalizedStrings.CacheClientNotifier_CLIENTPROXYMEMBERSHIPID_OBJECT_COULD_NOT_BE_CREATED_EXCEPTION_OCCURRED_WAS_0
.toLocalizedString(e));
} catch (AuthenticationRequiredException ex) {
- securityLogger.warn(
- LocalizedMessage.create(LocalizedStrings.CacheClientNotifier_AN_EXCEPTION_WAS_THROWN_FOR_CLIENT_0_1,
+ securityLogger.warn(LocalizedMessage.create(
+ LocalizedStrings.CacheClientNotifier_AN_EXCEPTION_WAS_THROWN_FOR_CLIENT_0_1,
new Object[] {proxyID, ex}));
writeException(dos, HandShake.REPLY_EXCEPTION_AUTHENTICATION_REQUIRED, ex, clientVersion);
return;
} catch (AuthenticationFailedException ex) {
- securityLogger.warn(
- LocalizedMessage.create(LocalizedStrings.CacheClientNotifier_AN_EXCEPTION_WAS_THROWN_FOR_CLIENT_0_1,
+ securityLogger.warn(LocalizedMessage.create(
+ LocalizedStrings.CacheClientNotifier_AN_EXCEPTION_WAS_THROWN_FOR_CLIENT_0_1,
new Object[] {proxyID, ex}));
writeException(dos, HandShake.REPLY_EXCEPTION_AUTHENTICATION_FAILED, ex, clientVersion);
return;
@@ -516,9 +512,9 @@ public class CacheClientNotifier {
"CacheClientNotifier: No proxy exists for durable client with id {}. It must be created.",
proxyId.getDurableId());
}
- l_proxy = CacheClientProxy.createCacheClientProxy(this, this._cache, this._cache.getDistributedSystem(), SecurityService
- .getSecurityService(), socket, proxyId, isPrimary, clientConflation,
- clientVersion, acceptorId, notifyBySubscription);
+ l_proxy = CacheClientProxy.createCacheClientProxy(this, this._cache,
+ this._cache.getDistributedSystem(), SecurityService.getSecurityService(), socket,
+ proxyId, isPrimary, clientConflation, clientVersion, acceptorId, notifyBySubscription);
successful = this.initializeProxy(l_proxy);
} else {
if (proxy.isPrimary()) {
@@ -595,8 +591,9 @@ public class CacheClientNotifier {
if (toCreateNewProxy) {
// Create the new proxy for this non-durable client
- l_proxy = CacheClientProxy.createCacheClientProxy(this, this._cache, this._cache.getDistributedSystem(), SecurityService.getSecurityService(), socket, proxyId, isPrimary, clientConflation,
- clientVersion, acceptorId, notifyBySubscription);
+ l_proxy = CacheClientProxy.createCacheClientProxy(this, this._cache,
+ this._cache.getDistributedSystem(), SecurityService.getSecurityService(), socket,
+ proxyId, isPrimary, clientConflation, clientVersion, acceptorId, notifyBySubscription);
successful = this.initializeProxy(l_proxy);
}
}
@@ -1220,8 +1217,7 @@ public class CacheClientNotifier {
public void registerClientInterest(String regionName, Object keyOfInterest,
ClientProxyMembershipID membershipID, int interestType, boolean isDurable,
boolean sendUpdatesAsInvalidates, boolean manageEmptyRegions, int regionDataPolicy,
- boolean flushState)
- throws IOException, RegionDestroyedException {
+ boolean flushState) throws IOException, RegionDestroyedException {
CacheClientProxy proxy = getClientProxy(membershipID, true);
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
index 5370e2f..4a9b8b0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
@@ -128,8 +128,8 @@ public class CacheClientProxy implements ClientSession {
/**
* The number of times to peek on shutdown before giving up and shutting down
*/
- private static final int MAXIMUM_SHUTDOWN_PEEKS = Integer
- .getInteger(DistributionConfig.GEMFIRE_PREFIX + "MAXIMUM_SHUTDOWN_PEEKS", 50);
+ private static final int MAXIMUM_SHUTDOWN_PEEKS =
+ Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "MAXIMUM_SHUTDOWN_PEEKS", 50);
/**
* Default value for slow starting time of dispatcher
@@ -142,20 +142,19 @@ public class CacheClientProxy implements ClientSession {
private static final String KEY_SLOW_START_TIME_FOR_TESTING = "slowStartTimeForTesting";
/**
- * TODO: delete this and rewrite the tests that use this
- * NOTE: this is NOT thread safe
+ * TODO: delete this and rewrite the tests that use this NOTE: this is NOT thread safe
*/
private static TestHook testHook;
/**
- * TODO: delete this and rewrite the test that uses this
- * A debug flag used for testing Backward compatibility
+ * TODO: delete this and rewrite the test that uses this A debug flag used for testing Backward
+ * compatibility
*/
private static boolean afterMessageCreationForTesting = false;
/**
- * TODO: delete this and rewrite the test that uses this
- * for testing purposes, delays the start of the dispatcher thread
+ * TODO: delete this and rewrite the test that uses this for testing purposes, delays the start of
+ * the dispatcher thread
*/
private static boolean isSlowStartForTesting = false;
@@ -318,19 +317,14 @@ public class CacheClientProxy implements ClientSession {
private int numDrainsInProgress = 0;
static CacheClientProxy createCacheClientProxy(final CacheClientNotifier ccn,
- final GemFireCacheImpl cache,
- final StatisticsFactory statsFactory,
- final SecurityService securityService,
- final Socket socket,
- final ClientProxyMembershipID proxyID,
- final boolean isPrimary,
- final byte clientConflation,
- final Version clientVersion,
- final long acceptorId,
- final boolean notifyBySubscription) {
-
- CacheClientProxy cacheClientProxy = new CacheClientProxy(
- ccn, cache, statsFactory, securityService, socket, proxyID, isPrimary, clientConflation, clientVersion, acceptorId, notifyBySubscription);
+ final GemFireCacheImpl cache, final StatisticsFactory statsFactory,
+ final SecurityService securityService, final Socket socket,
+ final ClientProxyMembershipID proxyID, final boolean isPrimary, final byte clientConflation,
+ final Version clientVersion, final long acceptorId, final boolean notifyBySubscription) {
+
+ CacheClientProxy cacheClientProxy =
+ new CacheClientProxy(ccn, cache, statsFactory, securityService, socket, proxyID, isPrimary,
+ clientConflation, clientVersion, acceptorId, notifyBySubscription);
// Create the interest list
cacheClientProxy.cils[RegisterInterestTracker.interestListIndex] =
@@ -353,18 +347,11 @@ public class CacheClientProxy implements ClientSession {
* @param clientConflation
* @param clientVersion
*/
- private CacheClientProxy(final CacheClientNotifier ccn,
- final GemFireCacheImpl cache,
- final StatisticsFactory statsFactory,
- final SecurityService securityService,
- final Socket socket,
- final ClientProxyMembershipID proxyID,
- final boolean isPrimary,
- final byte clientConflation,
- final Version clientVersion,
- final long acceptorId,
- final boolean notifyBySubscription)
- throws CacheException {
+ private CacheClientProxy(final CacheClientNotifier ccn, final GemFireCacheImpl cache,
+ final StatisticsFactory statsFactory, final SecurityService securityService,
+ final Socket socket, final ClientProxyMembershipID proxyID, final boolean isPrimary,
+ final byte clientConflation, final Version clientVersion, final long acceptorId,
+ final boolean notifyBySubscription) throws CacheException {
initializeTransientFields(socket, proxyID, isPrimary, clientConflation, clientVersion);
this.cacheClientNotifier = ccn;
this.cache = cache;
@@ -1785,20 +1772,18 @@ public class CacheClientProxy implements ClientSession {
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("CacheClientProxy[")
- .append(this.proxyID)
- .append("; port=").append(this.socket.getPort()).append("; primary=").append(isPrimary)
- .append("; version=").append(clientVersion).append("]");
+ buffer.append("CacheClientProxy[").append(this.proxyID).append("; port=")
+ .append(this.socket.getPort()).append("; primary=").append(isPrimary).append("; version=")
+ .append(clientVersion).append("]");
return buffer.toString();
}
public String getState() {
StringBuffer buffer = new StringBuffer();
- buffer.append("CacheClientProxy[")
- .append(this.proxyID)
- .append("; port=").append(this.socket.getPort()).append("; primary=").append(isPrimary)
- .append("; version=").append(clientVersion).append("; paused=").append(isPaused())
- .append("; alive=").append(isAlive()).append("; connected=").append(isConnected())
+ buffer.append("CacheClientProxy[").append(this.proxyID).append("; port=")
+ .append(this.socket.getPort()).append("; primary=").append(isPrimary).append("; version=")
+ .append(clientVersion).append("; paused=").append(isPaused()).append("; alive=")
+ .append(isAlive()).append("; connected=").append(isConnected())
.append("; isMarkedForRemoval=").append(isMarkedForRemoval).append("]");
if (_messageDispatcher != null && isAlive()) {
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
index d43244a..8a51c31 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/HandShake.java
@@ -1670,7 +1670,8 @@ public class HandShake implements ClientHandShake {
* not
*/
public static Object verifyCredentials(String authenticatorMethod, Properties credentials,
- Properties securityProperties, LogWriter logWriter, LogWriter securityLogWriter, DistributedMember member)
+ Properties securityProperties, LogWriter logWriter, LogWriter securityLogWriter,
+ DistributedMember member)
throws AuthenticationRequiredException, AuthenticationFailedException {
if (!AcceptorImpl.isAuthenticationRequired()) {
@@ -1702,7 +1703,8 @@ public class HandShake implements ClientHandShake {
String methodName = this.system.getProperties().getProperty(SECURITY_CLIENT_AUTHENTICATOR);
return verifyCredentials(methodName, this.credentials, this.system.getSecurityProperties(),
- this.system.getLogWriter(), this.system.getSecurityLogWriter(), this.id.getDistributedMember());
+ this.system.getLogWriter(), this.system.getSecurityLogWriter(),
+ this.id.getDistributedMember());
}
public void sendCredentialsForWan(OutputStream out, InputStream in) {
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplJUnitTest.java
index 6cb28ee..8ff541b 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplJUnitTest.java
@@ -77,7 +77,8 @@ public class AcceptorImplJUnitTest {
CacheServer.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, this.cache,
AcceptorImpl.MINIMUM_MAX_CONNECTIONS - 1, CacheServer.DEFAULT_MAX_THREADS,
CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT, CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE,
- null, null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY, this.cache.getCancelCriterion());
+ null, null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY,
+ this.cache.getCancelCriterion());
fail("Expected an IllegalArgumentExcption due to max conns < min pool size");
} catch (IllegalArgumentException expected) {
}
@@ -97,12 +98,14 @@ public class AcceptorImplJUnitTest {
CacheServer.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, this.cache,
AcceptorImpl.MINIMUM_MAX_CONNECTIONS, CacheServer.DEFAULT_MAX_THREADS,
CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT, CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE,
- null, null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY, this.cache.getCancelCriterion());
+ null, null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY,
+ this.cache.getCancelCriterion());
a2 = new AcceptorImpl(port1, null, false, CacheServer.DEFAULT_SOCKET_BUFFER_SIZE,
CacheServer.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, this.cache,
AcceptorImpl.MINIMUM_MAX_CONNECTIONS, CacheServer.DEFAULT_MAX_THREADS,
CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT, CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE,
- null, null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY, this.cache.getCancelCriterion());
+ null, null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY,
+ this.cache.getCancelCriterion());
fail("Expecetd a BindException while attaching to the same port");
} catch (BindException expected) {
}
@@ -111,7 +114,8 @@ public class AcceptorImplJUnitTest {
CacheServer.DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS, this.cache,
AcceptorImpl.MINIMUM_MAX_CONNECTIONS, CacheServer.DEFAULT_MAX_THREADS,
CacheServer.DEFAULT_MAXIMUM_MESSAGE_COUNT, CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE, null,
- null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY, this.cache.getCancelCriterion());
+ null, false, Collections.EMPTY_LIST, CacheServer.DEFAULT_TCP_NO_DELAY,
+ this.cache.getCancelCriterion());
assertEquals(port2, a3.getPort());
InternalDistributedSystem isystem =
(InternalDistributedSystem) this.cache.getDistributedSystem();
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplTest.java
index a61f790..7ab539d 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImplTest.java
@@ -1,18 +1,16 @@
/*
- * 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
+ * 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
+ * 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.
+ * 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.internal.cache.tier.sockets;
@@ -51,24 +49,24 @@ public class AcceptorImplTest {
@Test
public void constructWithDefaults() throws Exception {
/*
- Problems:
-
- this.clientNotifier = CacheClientNotifier.getInstance(cache, this.stats, maximumMessageCount,
- messageTimeToLive, connectionListener, overflowAttributesList, isGatewayReceiver);
-
- this.healthMonitor = ClientHealthMonitor.getInstance(internalCache, maximumTimeBetweenPings,
- this.clientNotifier.getStats());
-
- LoggingThreadGroup / ThreadFactory / ThreadPoolExecutor
-
- isAuthenticationRequired = this.securityService.isClientSecurityRequired();
-
- isIntegratedSecurity = this.securityService.isIntegratedSecurity();
-
-
- String postAuthzFactoryName =
- this.cache.getDistributedSystem().getProperties().getProperty(SECURITY_CLIENT_ACCESSOR_PP);
-
+ * Problems:
+ *
+ * this.clientNotifier = CacheClientNotifier.getInstance(cache, this.stats, maximumMessageCount,
+ * messageTimeToLive, connectionListener, overflowAttributesList, isGatewayReceiver);
+ *
+ * this.healthMonitor = ClientHealthMonitor.getInstance(internalCache, maximumTimeBetweenPings,
+ * this.clientNotifier.getStats());
+ *
+ * LoggingThreadGroup / ThreadFactory / ThreadPoolExecutor
+ *
+ * isAuthenticationRequired = this.securityService.isClientSecurityRequired();
+ *
+ * isIntegratedSecurity = this.securityService.isIntegratedSecurity();
+ *
+ *
+ * String postAuthzFactoryName =
+ * this.cache.getDistributedSystem().getProperties().getProperty(SECURITY_CLIENT_ACCESSOR_PP);
+ *
*/
int port = 0;
@@ -88,24 +86,10 @@ public class AcceptorImplTest {
boolean tcpNoDelay = false;
CancelCriterion cancelCriterion = null;
- AcceptorImpl acceptor = new AcceptorImpl(
- port,
- bindHostName,
- notifyBySubscription,
- socketBufferSize,
- maximumTimeBetweenPings,
- internalCache,
- maxConnections,
- maxThreads,
- maximumMessageCount,
- messageTimeToLive,
- listener,
- overflowAttributesList,
- isGatewayReceiver,
- transportFilter,
- tcpNoDelay,
- cancelCriterion
- );
+ AcceptorImpl acceptor = new AcceptorImpl(port, bindHostName, notifyBySubscription,
+ socketBufferSize, maximumTimeBetweenPings, internalCache, maxConnections, maxThreads,
+ maximumMessageCount, messageTimeToLive, listener, overflowAttributesList, isGatewayReceiver,
+ transportFilter, tcpNoDelay, cancelCriterion);
assertThat(acceptor).isNotNull();
}
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
index 5b340d1..43330a5 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/ClientServerMiscDUnitTest.java
@@ -1010,7 +1010,8 @@ public class ClientServerMiscDUnitTest extends JUnit4CacheTestCase {
while (iter_prox.hasNext()) {
CacheClientProxy ccp = (CacheClientProxy) iter_prox.next();
// CCP should not contain region1
- Set akr = ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex].regions;
+ Set akr = ccp
+ .getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex].regions;
assertNotNull(akr);
assertTrue(!akr.contains(Region.SEPARATOR + REGION_NAME1));
// CCP should contain region2
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAInterestTestCase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAInterestTestCase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAInterestTestCase.java
index 07e2220..9d60cc7 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAInterestTestCase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/HAInterestTestCase.java
@@ -818,8 +818,10 @@ public class HAInterestTestCase extends JUnit4DistributedTestCase {
wc = new WaitCriterion() {
@Override
public boolean done() {
- Set keysMap = (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
- .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
+ Set keysMap =
+ (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(Region.SEPARATOR + REGION_NAME)
+ .getKeysOfInterestFor(ccp.getProxyID());
return keysMap != null && keysMap.size() == 2;
}
@@ -830,8 +832,9 @@ public class HAInterestTestCase extends JUnit4DistributedTestCase {
};
Wait.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
- Set keysMap = (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
- .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
+ Set keysMap =
+ (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
assertNotNull(keysMap);
assertEquals(2, keysMap.size());
assertTrue(keysMap.contains(k1));
@@ -879,8 +882,10 @@ public class HAInterestTestCase extends JUnit4DistributedTestCase {
wc = new WaitCriterion() {
@Override
public boolean done() {
- Set keysMap = (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
- .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
+ Set keysMap =
+ (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(Region.SEPARATOR + REGION_NAME)
+ .getKeysOfInterestFor(ccp.getProxyID());
return keysMap != null;
}
@@ -891,8 +896,9 @@ public class HAInterestTestCase extends JUnit4DistributedTestCase {
};
Wait.waitForCriterion(wc, TIMEOUT_MILLIS, INTERVAL_MILLIS, true);
- Set keysMap = (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
- .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
+ Set keysMap =
+ (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
assertNotNull(keysMap);
assertEquals(1, keysMap.size());
assertFalse(keysMap.contains(k1));
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
index e9982b2..be9265b 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/InterestListRecoveryDUnitTest.java
@@ -434,8 +434,8 @@ public class InterestListRecoveryDUnitTest extends JUnit4DistributedTestCase {
public static Set getKeysOfInterestMap(CacheClientProxy proxy, String regionName) {
// assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]);
// assertNotNull(proxy.cils[RegisterInterestTracker.interestListIndex]._keysOfInterest);
- return proxy.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex].getProfile(regionName)
- .getKeysOfInterestFor(proxy.getProxyID());
+ return proxy.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(regionName).getKeysOfInterestFor(proxy.getProxyID());
}
@Override
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
index 826bba9..1635fca 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/RedundancyLevelTestBase.java
@@ -427,8 +427,10 @@ public class RedundancyLevelTestBase extends JUnit4DistributedTestCase {
String excuse;
public boolean done() {
- Set keysMap = (Set) ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
- .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
+ Set keysMap = (Set) ccp
+ .getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(Region.SEPARATOR + REGION_NAME)
+ .getKeysOfInterestFor(ccp.getProxyID());
if (keysMap == null) {
excuse = "keys of interest is null";
return false;
@@ -446,8 +448,9 @@ public class RedundancyLevelTestBase extends JUnit4DistributedTestCase {
};
Wait.waitForCriterion(wc, 180 * 1000, 2 * 1000, true);
- Set keysMap = ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
- .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
+ Set keysMap =
+ ccp.getClientInterestListForTesting()[RegisterInterestTracker.interestListIndex]
+ .getProfile(Region.SEPARATOR + REGION_NAME).getKeysOfInterestFor(ccp.getProxyID());
assertTrue(keysMap.contains(k1));
assertTrue(keysMap.contains(k2));
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
index 485ee5e..94a2e8b 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65BenchTest.java
@@ -46,8 +46,8 @@ public class Put65BenchTest {
this.put65Command = Put65.getCommand();
- this.mockServerConnection = mock(ServerConnection.class,
- withSettings().name("mockServerConnection"));
+ this.mockServerConnection =
+ mock(ServerConnection.class, withSettings().name("mockServerConnection"));
when(this.mockServerConnection.getClientVersion()).thenReturn(Version.CURRENT);
GemFireCacheImpl mockCache = mock(GemFireCacheImpl.class, withSettings().name("mockCache"));
http://git-wip-us.apache.org/repos/asf/geode/blob/eb89fe28/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
index 3cc10e7..036f6af 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/tier/sockets/command/Put65RealBenchTest.java
@@ -67,13 +67,9 @@ public class Put65RealBenchTest {
this.serverPort = getRandomAvailablePort(SOCKET);
- ServerLauncher serverLauncher = new ServerLauncher.Builder()
- .setMemberName("server1")
- .setRedirectOutput(true)
- .setWorkingDirectory(this.workingDir.getAbsolutePath())
- .set(MCAST_PORT, "0")
- .set(LOCATORS, "")
- .build();
+ ServerLauncher serverLauncher = new ServerLauncher.Builder().setMemberName("server1")
+ .setRedirectOutput(true).setWorkingDirectory(this.workingDir.getAbsolutePath())
+ .set(MCAST_PORT, "0").set(LOCATORS, "").build();
serverLauncher.start();
@@ -91,9 +87,9 @@ public class Put65RealBenchTest {
mock(ClientProxyMembershipID.class, withSettings().name("mockProxyId"));
when(this.mockServerConnection.getProxyID()).thenReturn(mockProxyId);
-// Message mockErrorResponseMessage =
-// mock(Message.class, withSettings().name("mockErrorResponseMessage"));
-// when(this.mockServerConnection.getErrorResponseMessage()).thenReturn(mockErrorResponseMessage);
+ // Message mockErrorResponseMessage =
+ // mock(Message.class, withSettings().name("mockErrorResponseMessage"));
+ // when(this.mockServerConnection.getErrorResponseMessage()).thenReturn(mockErrorResponseMessage);
Part mockRegionNamePart = mock(Part.class, withSettings().name("mockRegionNamePart"));
when(mockRegionNamePart.getString()).thenReturn("mockRegionNamePart");