From 595da5633915901f74d52ad1c631a5426225d5a0 Mon Sep 17 00:00:00 2001 From: "Michael \"Sarge\" Dodge" Date: Wed, 4 Apr 2018 14:51:47 -0700 Subject: [PATCH] GEODE-4644: Move static to member of distributed system. (#1734) --- .../client/internal/ClientSideHandshakeImpl.java | 13 +------------ .../internal/InternalDistributedSystem.java | 15 +++++++++++++++ .../apache/geode/internal/cache/LocalRegion.java | 2 +- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ClientSideHandshakeImpl.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ClientSideHandshakeImpl.java index 34e0847453ec..0f4aa4ec7de0 100644 --- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ClientSideHandshakeImpl.java +++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ClientSideHandshakeImpl.java @@ -70,13 +70,6 @@ import org.apache.geode.security.GemFireSecurityException; public class ClientSideHandshakeImpl extends Handshake implements ClientSideHandshake { - /** - * Used at client side, indicates whether the 'delta-propagation' property is enabled on the DS - * this client is connected to. This variable is used to decide whether to send delta bytes or - * full value to the server for a delta-update operation. - */ - private static boolean deltaEnabledOnServer = true; - /** * If true, the client has configured multi-user security, meaning that each thread holds its own * security principal. @@ -95,10 +88,6 @@ protected byte getReplyCode() { return replyCode; } - public static boolean isDeltaEnabledOnServer() { - return deltaEnabledOnServer; - } - public ClientSideHandshakeImpl(ClientProxyMembershipID proxyId, InternalDistributedSystem distributedSystem, SecurityService securityService, boolean multiuserSecureMode) { @@ -245,7 +234,7 @@ public ServerQueueStatus handshakeWithServer(Connection conn, ServerLocation loc // [sumedh] Static variable below? Client can connect to different // DSes with different values of this. It shoule be a member variable. if (!communicationMode.isWAN() && currentClientVersion.compareTo(Version.GFE_61) >= 0) { - deltaEnabledOnServer = dis.readBoolean(); + ((InternalDistributedSystem) system).setDeltaEnabledOnServer(dis.readBoolean()); } // validate that the remote side has a different distributed system id. 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 6a59b92f1303..4992038a728d 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 @@ -311,6 +311,21 @@ public GrantorRequestProcessor.GrantorRequestContext getGrantorRequestContext() private volatile SecurityService securityService; + /** + * Used at client side, indicates whether the 'delta-propagation' property is enabled on the DS + * this client is connected to. This variable is used to decide whether to send delta bytes or + * full value to the server for a delta-update operation. + */ + private boolean deltaEnabledOnServer = true; + + public boolean isDeltaEnabledOnServer() { + return deltaEnabledOnServer; + } + + public void setDeltaEnabledOnServer(boolean deltaEnabledOnServer) { + this.deltaEnabledOnServer = deltaEnabledOnServer; + } + ///////////////////// Static Methods ///////////////////// /** diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java index 34728cdece0e..2a8813e43286 100644 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java @@ -1683,7 +1683,7 @@ private void extractDeltaIntoEvent(Object value, EntryEventImpl event) { if (!extractDelta && ClientHealthMonitor.getInstance() != null) { extractDelta = ClientHealthMonitor.getInstance().hasDeltaClients(); } - } else if (ClientSideHandshakeImpl.isDeltaEnabledOnServer()) { + } else if (getSystem().isDeltaEnabledOnServer()) { // This is a client region extractDelta = true; }