Skip to content

Commit cf54803

Browse files
timeckljacomet
authored andcommitted
Remove group ID from most messages
git-svn-id: https://svn.terracotta.org/repo/tc/tc-messaging/branches/private/voltron@26040 7fc7bbf3-cf45-46d4-be06-341739edd864
1 parent 53be575 commit cf54803

9 files changed

+11
-78
lines changed

src/main/java/com/tc/object/msg/ClientHandshakeAckMessage.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,21 @@
44
package com.tc.object.msg;
55

66
import com.tc.net.ClientID;
7-
import com.tc.net.GroupID;
87
import com.tc.net.NodeID;
9-
import com.tc.net.StripeID;
108
import com.tc.net.protocol.tcm.TCMessage;
119

12-
import java.util.Map;
1310
import java.util.Set;
1411

1512
public interface ClientHandshakeAckMessage extends TCMessage {
1613

1714
public boolean getPersistentServer();
1815

19-
public void initialize(boolean persistent, Set<? extends NodeID> allNodes, ClientID thisNodeID, String serverVersion,
20-
GroupID thisGroup, StripeID stripeID, Map<GroupID, StripeID> stripeIDMap);
16+
public void initialize(boolean persistent, Set<? extends NodeID> allNodes, ClientID thisNodeID, String serverVersion);
2117

2218
public ClientID[] getAllNodes();
2319

2420
public ClientID getThisNodeId();
2521

2622
public String getServerVersion();
2723

28-
public GroupID getGroupID();
29-
30-
public StripeID getStripeID();
31-
32-
public Map<GroupID, StripeID> getStripeIDMap();
33-
3424
}

src/main/java/com/tc/object/msg/ClientHandshakeAckMessageImpl.java

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,15 @@
66
import com.tc.bytes.TCByteBuffer;
77
import com.tc.io.TCByteBufferOutputStream;
88
import com.tc.net.ClientID;
9-
import com.tc.net.GroupID;
109
import com.tc.net.NodeID;
11-
import com.tc.net.StripeID;
12-
import com.tc.net.groups.GroupToStripeMapSerializer;
1310
import com.tc.net.protocol.tcm.MessageChannel;
1411
import com.tc.net.protocol.tcm.MessageMonitor;
1512
import com.tc.net.protocol.tcm.TCMessageHeader;
1613
import com.tc.net.protocol.tcm.TCMessageType;
1714
import com.tc.object.session.SessionID;
1815

1916
import java.io.IOException;
20-
import java.util.HashMap;
2117
import java.util.HashSet;
22-
import java.util.Map;
2318
import java.util.Set;
2419

2520
public class ClientHandshakeAckMessageImpl extends DSOMessageBase implements ClientHandshakeAckMessage {
@@ -28,17 +23,11 @@ public class ClientHandshakeAckMessageImpl extends DSOMessageBase implements Cli
2823
private static final byte ALL_NODES = 2;
2924
private static final byte THIS_NODE_ID = 3;
3025
private static final byte SERVER_VERSION = 4;
31-
private static final byte GROUP_ID = 5;
32-
private static final byte STRIPE_ID = 6;
33-
private static final byte STRIPE_ID_MAP = 7;
3426

3527
private final Set<NodeID> allNodes = new HashSet<NodeID>();
3628
private boolean persistentServer;
3729
private ClientID thisNodeId;
3830
private String serverVersion;
39-
private GroupID groupID;
40-
private StripeID stripeID;
41-
private Map<GroupID, StripeID> stripeIDMap = new HashMap<GroupID, StripeID>(0);
4231

4332
public ClientHandshakeAckMessageImpl(final SessionID sessionID, final MessageMonitor monitor,
4433
final TCByteBufferOutputStream out, final MessageChannel channel,
@@ -62,9 +51,6 @@ protected void dehydrateValues() {
6251

6352
putNVPair(THIS_NODE_ID, thisNodeId);
6453
putNVPair(SERVER_VERSION, serverVersion);
65-
putNVPair(GROUP_ID, groupID);
66-
putNVPair(STRIPE_ID, stripeID);
67-
putNVPair(STRIPE_ID_MAP, new GroupToStripeMapSerializer(stripeIDMap));
6854
}
6955

7056
@Override
@@ -82,31 +68,19 @@ protected boolean hydrateValue(final byte name) throws IOException {
8268
case SERVER_VERSION:
8369
serverVersion = getStringValue();
8470
return true;
85-
case GROUP_ID:
86-
groupID = (GroupID) getNodeIDValue();
87-
return true;
88-
case STRIPE_ID:
89-
stripeID = (StripeID) getNodeIDValue();
90-
return true;
91-
case STRIPE_ID_MAP:
92-
stripeIDMap = getObject(new GroupToStripeMapSerializer()).getMap();
93-
return true;
9471
default:
9572
return false;
9673
}
9774
}
9875

9976
@Override
10077
public void initialize(final boolean persistent, final Set<? extends NodeID> allNodeIDs, final ClientID thisNodeID,
101-
final String sv, final GroupID l2GroupID, StripeID l2StripeID, Map<GroupID, StripeID> sidMap) {
78+
final String sv) {
10279
this.persistentServer = persistent;
10380
this.allNodes.addAll(allNodeIDs);
10481

10582
this.thisNodeId = thisNodeID;
10683
this.serverVersion = sv;
107-
this.groupID = l2GroupID;
108-
this.stripeID = l2StripeID;
109-
this.stripeIDMap = sidMap;
11084
}
11185

11286
@Override
@@ -128,19 +102,4 @@ public ClientID getThisNodeId() {
128102
public String getServerVersion() {
129103
return serverVersion;
130104
}
131-
132-
@Override
133-
public GroupID getGroupID() {
134-
return groupID;
135-
}
136-
137-
@Override
138-
public StripeID getStripeID() {
139-
return this.stripeID;
140-
}
141-
142-
@Override
143-
public Map<GroupID, StripeID> getStripeIDMap() {
144-
return this.stripeIDMap;
145-
}
146105
}

src/main/java/com/tc/object/msg/ClientHandshakeMessageFactory.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
*/
44
package com.tc.object.msg;
55

6-
import com.tc.net.NodeID;
7-
86
public interface ClientHandshakeMessageFactory {
97

10-
public ClientHandshakeMessage newClientHandshakeMessage(NodeID remoteNode, String clientVersion,
11-
boolean isEnterpriseClient);
8+
public ClientHandshakeMessage newClientHandshakeMessage(String clientVersion, boolean isEnterpriseClient);
129

1310
}

src/main/java/com/tc/object/msg/CommitTransactionMessageFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
*/
44
package com.tc.object.msg;
55

6-
import com.tc.net.NodeID;
7-
86
public interface CommitTransactionMessageFactory {
97

10-
public CommitTransactionMessage newCommitTransactionMessage(NodeID remoteNode);
8+
public CommitTransactionMessage newCommitTransactionMessage();
119

1210
}

src/main/java/com/tc/object/msg/CompletedTransactionLowWaterMarkMessageFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
*/
44
package com.tc.object.msg;
55

6-
import com.tc.net.NodeID;
7-
86
public interface CompletedTransactionLowWaterMarkMessageFactory {
97

10-
public CompletedTransactionLowWaterMarkMessage newCompletedTransactionLowWaterMarkMessage(NodeID remoteID);
8+
public CompletedTransactionLowWaterMarkMessage newCompletedTransactionLowWaterMarkMessage();
119

1210
}

src/main/java/com/tc/object/msg/LockRequestMessageFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*/
44
package com.tc.object.msg;
55

6-
import com.tc.net.NodeID;
7-
86
public interface LockRequestMessageFactory {
9-
public LockRequestMessage newLockRequestMessage(NodeID nodeID);
7+
public LockRequestMessage newLockRequestMessage();
108
}

src/main/java/com/tc/object/msg/RequestManagedObjectMessageFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
*/
44
package com.tc.object.msg;
55

6-
import com.tc.net.NodeID;
7-
86
public interface RequestManagedObjectMessageFactory {
97

10-
public RequestManagedObjectMessage newRequestManagedObjectMessage(NodeID nodeID);
8+
public RequestManagedObjectMessage newRequestManagedObjectMessage();
119

1210
}

src/main/java/com/tc/object/msg/RequestRootMessageFactory.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
*/
44
package com.tc.object.msg;
55

6-
import com.tc.net.NodeID;
7-
86
public interface RequestRootMessageFactory {
97

10-
public RequestRootMessage newRequestRootMessage(NodeID nodeID);
8+
public RequestRootMessage newRequestRootMessage();
119

1210
}

src/main/java/com/tc/object/tx/ClientTransactionBatchWriter.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.tc.io.TCByteBufferOutputStream;
99
import com.tc.io.TCByteBufferOutputStream.Mark;
1010
import com.tc.lang.Recyclable;
11-
import com.tc.net.GroupID;
1211
import com.tc.object.ObjectID;
1312
import com.tc.object.TCObject;
1413
import com.tc.object.change.TCChangeBuffer;
@@ -36,7 +35,6 @@
3635

3736
public class ClientTransactionBatchWriter implements ClientTransactionBatch {
3837

39-
private final GroupID groupID;
4038
private final CommitTransactionMessageFactory commitTransactionMessageFactory;
4139
private final TxnBatchID batchID;
4240
private final LinkedHashMap<TransactionID, TransactionBuffer> transactionData = new LinkedHashMap<TransactionID, TransactionBuffer>();
@@ -50,10 +48,9 @@ public class ClientTransactionBatchWriter implements ClientTransactionBatch {
5048
private boolean committed = false;
5149
private int holders = 0;
5250

53-
public ClientTransactionBatchWriter(final GroupID groupID, final TxnBatchID batchID,
51+
public ClientTransactionBatchWriter(final TxnBatchID batchID,
5452
final ObjectStringSerializer serializer, final DNAEncodingInternal encoding,
55-
final CommitTransactionMessageFactory commitTransactionMessageFactory) {
56-
this.groupID = groupID;
53+
final CommitTransactionMessageFactory commitTransactionMessageFactory) {
5754
this.batchID = batchID;
5855
this.encoding = encoding;
5956
this.commitTransactionMessageFactory = commitTransactionMessageFactory;
@@ -190,7 +187,7 @@ private TCByteBufferOutputStream newOutputStream() {
190187
public void send() {
191188
final CommitTransactionMessage msg;
192189
synchronized (this) {
193-
msg = this.commitTransactionMessageFactory.newCommitTransactionMessage(this.groupID);
190+
msg = this.commitTransactionMessageFactory.newCommitTransactionMessage();
194191
msg.setBatch(this, this.serializer);
195192
}
196193
msg.send();

0 commit comments

Comments
 (0)