Skip to content

Commit

Permalink
GEODE-4644: Move static to member of distributed system. (apache#1734)
Browse files Browse the repository at this point in the history
  • Loading branch information
PivotalSarge authored Apr 4, 2018
1 parent da1ce1c commit 595da56
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) {
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 /////////////////////

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 595da56

Please sign in to comment.