Skip to content

Commit 978897e

Browse files
authored
IGNITE-24260 Remove IgniteDataTransferObject protoVer fields (#11910)
1 parent be1f4bc commit 978897e

File tree

119 files changed

+136
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+136
-221
lines changed

modules/core/src/main/java/org/apache/ignite/internal/cache/query/index/sorted/DurableBackgroundCleanupIndexTreeTaskV2.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ public DurableBackgroundCleanupIndexTreeTaskV2() {
166166
}
167167

168168
/** {@inheritDoc} */
169-
@Override protected void readExternalData(
170-
byte protoVer,
171-
ObjectInput in
172-
) throws IOException, ClassNotFoundException {
169+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
173170
uid = U.readLongString(in);
174171
grpName = U.readLongString(in);
175172
cacheName = U.readLongString(in);

modules/core/src/main/java/org/apache/ignite/internal/commandline/cache/check_indexes_inline_size/CheckIndexInlineSizesResult.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ public class CheckIndexInlineSizesResult extends IgniteDataTransferObject {
5050
}
5151

5252
/** {@inheritDoc} */
53-
@Override protected void readExternalData(
54-
byte protoVer,
55-
ObjectInput in
56-
) throws IOException, ClassNotFoundException {
53+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
5754
int size = in.readInt();
5855

5956
for (int i = 0; i < size; i++) {

modules/core/src/main/java/org/apache/ignite/internal/dto/IgniteDataTransferObject.java

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -38,33 +38,6 @@ public abstract class IgniteDataTransferObject implements Externalizable {
3838
/** Magic number to detect correct transfer objects. */
3939
private static final int MAGIC = 0x42BEEF00;
4040

41-
/** Version 1. */
42-
protected static final byte V1 = 1;
43-
44-
/** Version 2. */
45-
protected static final byte V2 = 2;
46-
47-
/** Version 3. */
48-
protected static final byte V3 = 3;
49-
50-
/** Version 4. */
51-
protected static final byte V4 = 4;
52-
53-
/** Version 5. */
54-
protected static final byte V5 = 5;
55-
56-
/** Version 6. */
57-
protected static final byte V6 = 6;
58-
59-
/** Version 7. */
60-
protected static final byte V7 = 7;
61-
62-
/** Version 8. */
63-
protected static final byte V8 = 8;
64-
65-
/** Version 9. */
66-
protected static final byte V9 = 9;
67-
6841
/**
6942
* @param col Source collection.
7043
* @param <T> Collection type.
@@ -89,13 +62,6 @@ public abstract class IgniteDataTransferObject implements Externalizable {
8962
return null;
9063
}
9164

92-
/**
93-
* @return Transfer object version.
94-
*/
95-
public byte getProtocolVersion() {
96-
return V1;
97-
}
98-
9965
/**
10066
* Save object's specific data content.
10167
*
@@ -106,9 +72,7 @@ public byte getProtocolVersion() {
10672

10773
/** {@inheritDoc} */
10874
@Override public void writeExternal(ObjectOutput out) throws IOException {
109-
int hdr = MAGIC + getProtocolVersion();
110-
111-
out.writeInt(hdr);
75+
out.writeInt(MAGIC);
11276

11377
try (IgniteDataTransferObjectOutput dtout = new IgniteDataTransferObjectOutput(out)) {
11478
writeExternalData(dtout);
@@ -118,12 +82,11 @@ public byte getProtocolVersion() {
11882
/**
11983
* Load object's specific data content.
12084
*
121-
* @param protoVer Input object version.
12285
* @param in Input object to load data content.
12386
* @throws IOException If I/O errors occur.
12487
* @throws ClassNotFoundException If the class for an object being restored cannot be found.
12588
*/
126-
protected abstract void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException;
89+
protected abstract void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException;
12790

12891
/** {@inheritDoc} */
12992
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
@@ -133,10 +96,8 @@ public byte getProtocolVersion() {
13396
throw new IOException("Unexpected IgniteDataTransferObject header " +
13497
"[actual=" + Integer.toHexString(hdr) + ", expected=" + Integer.toHexString(MAGIC) + "]");
13598

136-
byte ver = (byte)(hdr & 0xFF);
137-
13899
try (IgniteDataTransferObjectInput dtin = new IgniteDataTransferObjectInput(in)) {
139-
readExternalData(ver, dtin);
100+
readExternalData(dtin);
140101
}
141102
}
142103
}

modules/core/src/main/java/org/apache/ignite/internal/management/ChangeTagCommandArg.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class ChangeTagCommandArg extends IgniteDataTransferObject {
4444
}
4545

4646
/** {@inheritDoc} */
47-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
47+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
4848
newTagValue = U.readString(in);
4949
}
5050

modules/core/src/main/java/org/apache/ignite/internal/management/ClusterChangeTagTaskResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public ClusterChangeTagTaskResult(String tag, @Nullable Boolean success, @Nullab
6464
}
6565

6666
/** {@inheritDoc} */
67-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
67+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
6868
success = (Boolean)in.readObject();
6969
errResp = (String)in.readObject();
7070

modules/core/src/main/java/org/apache/ignite/internal/management/DeactivateCommandArg.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class DeactivateCommandArg extends IgniteDataTransferObject {
4545
}
4646

4747
/** {@inheritDoc} */
48-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
48+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
4949
force = in.readBoolean();
5050
clusterName = U.readString(in);
5151
}

modules/core/src/main/java/org/apache/ignite/internal/management/SetStateCommandArg.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public class SetStateCommandArg extends IgniteDataTransferObject {
6666
}
6767

6868
/** {@inheritDoc} */
69-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
69+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
7070
state = U.readEnum(in, ClusterState.class);
7171
force = in.readBoolean();
7272
clusterName = U.readString(in);

modules/core/src/main/java/org/apache/ignite/internal/management/ShutdownPolicyCommandArg.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ShutdownPolicyCommandArg extends IgniteDataTransferObject {
5353
}
5454

5555
/** {@inheritDoc} */
56-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
56+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
5757
shutdownPolicy = U.readEnum(in, ShutdownPolicy.class);
5858
}
5959

modules/core/src/main/java/org/apache/ignite/internal/management/ShutdownPolicyTaskResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void setShutdown(ShutdownPolicy shutdown) {
5757
}
5858

5959
/** {@inheritDoc} */
60-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
60+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
6161
shutdown = ShutdownPolicy.fromOrdinal(in.readInt());
6262

6363
}

modules/core/src/main/java/org/apache/ignite/internal/management/SystemViewCommandArg.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class SystemViewCommandArg extends IgniteDataTransferObject {
6868
}
6969

7070
/** {@inheritDoc} */
71-
@Override protected void readExternalData(byte protoVer, ObjectInput in) throws IOException, ClassNotFoundException {
71+
@Override protected void readExternalData(ObjectInput in) throws IOException, ClassNotFoundException {
7272
systemViewName = U.readString(in);
7373
nodeId = U.readUuid(in);
7474
nodeIds = U.readArray(in, UUID.class);

0 commit comments

Comments
 (0)