Skip to content

Commit d59dc20

Browse files
authored
[fix](fe) remove deprecated version hash variables to reduce memory (#59458)
1 parent e9da494 commit d59dc20

File tree

4 files changed

+0
-57
lines changed

4 files changed

+0
-57
lines changed

fe/fe-core/src/main/java/org/apache/doris/catalog/Partition.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,12 @@ public enum PartitionState {
8383
* next version(hash): next version is set after finished committing, it should equals to committed version + 1
8484
*/
8585

86-
// not have committedVersion because committedVersion = nextVersion - 1
87-
@Deprecated
88-
@SerializedName(value = "cvh", alternate = {"committedVersionHash"})
89-
private long committedVersionHash;
9086
@SerializedName(value = "vv", alternate = {"visibleVersion"})
9187
private long visibleVersion;
9288
@SerializedName(value = "vvt", alternate = {"visibleVersionTime"})
9389
private long visibleVersionTime;
94-
@Deprecated
95-
@SerializedName(value = "vvh", alternate = {"visibleVersionHash"})
96-
private long visibleVersionHash;
9790
@SerializedName(value = "nv", alternate = {"nextVersion"})
9891
protected long nextVersion;
99-
@Deprecated
100-
@SerializedName(value = "nvh", alternate = {"nextVersionHash"})
101-
private long nextVersionHash;
10292
@SerializedName(value = "di", alternate = {"distributionInfo"})
10393
private DistributionInfo distributionInfo;
10494

@@ -183,18 +173,6 @@ public static List<Long> getVisibleVersions(List<? extends Partition> partitions
183173
}
184174
}
185175

186-
/**
187-
* if visibleVersion is 1, do not return creation time but 0
188-
*
189-
* @return
190-
*/
191-
public long getVisibleVersionTimeIgnoreInit() {
192-
if (visibleVersion == 1) {
193-
return 0L;
194-
}
195-
return visibleVersionTime;
196-
}
197-
198176
// The method updateVisibleVersionAndVersionHash is called when fe restart, the visibleVersionTime is updated
199177
protected void setVisibleVersion(long visibleVersion) {
200178
this.visibleVersion = visibleVersion;

fe/fe-core/src/main/java/org/apache/doris/catalog/Replica.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,6 @@ public static class ReplicaContext {
9393
// the version could be queried
9494
@SerializedName(value = "v", alternate = {"version"})
9595
private volatile long version;
96-
@Deprecated
97-
@SerializedName(value = "vh", alternate = {"versionHash"})
98-
private long versionHash = 0L;
9996
private int schemaHash = -1;
10097
@SerializedName(value = "ds", alternate = {"dataSize"})
10198
private volatile long dataSize = 0;
@@ -109,17 +106,11 @@ public static class ReplicaContext {
109106
// the last load failed version
110107
@SerializedName(value = "lfv", alternate = {"lastFailedVersion"})
111108
private long lastFailedVersion = -1L;
112-
@Deprecated
113-
@SerializedName(value = "lfvh", alternate = {"lastFailedVersionHash"})
114-
private long lastFailedVersionHash = 0L;
115109
// not serialized, not very important
116110
private long lastFailedTimestamp = 0;
117111
// the last load successful version
118112
@SerializedName(value = "lsv", alternate = {"lastSuccessVersion"})
119113
private long lastSuccessVersion = -1L;
120-
@Deprecated
121-
@SerializedName(value = "lsvh", alternate = {"lastSuccessVersionHash"})
122-
private long lastSuccessVersionHash = 0L;
123114

124115
@Setter
125116
@Getter
@@ -438,7 +429,6 @@ public synchronized void adminUpdateVersionInfo(Long version, Long lastFailedVer
438429
if (this.lastFailedVersion < this.version) {
439430
this.lastFailedVersion = -1;
440431
this.lastFailedTimestamp = -1;
441-
this.lastFailedVersionHash = 0;
442432
}
443433
if (this.lastFailedVersion > 0
444434
&& this.lastSuccessVersion > this.lastFailedVersion) {
@@ -546,7 +536,6 @@ private void updateReplicaVersion(long newVersion, long lastFailedVersion, long
546536
// Case 4:
547537
if (this.version >= this.lastFailedVersion) {
548538
this.lastFailedVersion = -1;
549-
this.lastFailedVersionHash = 0;
550539
this.lastFailedTimestamp = -1;
551540
if (this.version < this.lastSuccessVersion) {
552541
this.version = this.lastSuccessVersion;

fe/fe-core/src/main/java/org/apache/doris/catalog/Table.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public abstract class Table extends MetaObject implements Writable, TableIf, Gso
7373

7474
public volatile boolean isDropped = false;
7575

76-
private boolean hasCompoundKey = false;
7776
@SerializedName(value = "id")
7877
protected long id;
7978
@SerializedName(value = "name")
@@ -118,8 +117,6 @@ public abstract class Table extends MetaObject implements Writable, TableIf, Gso
118117
*/
119118
protected Map<String, Column> nameToColumn;
120119

121-
// DO NOT persist this variable.
122-
protected boolean isTypeRead = false;
123120
// table(view)'s comment
124121
@SerializedName(value = "comment")
125122
protected String comment = "";
@@ -350,14 +347,6 @@ public void commitUnlock() {
350347
this.commitLock.unlock();
351348
}
352349

353-
public boolean isTypeRead() {
354-
return isTypeRead;
355-
}
356-
357-
public void setTypeRead(boolean isTypeRead) {
358-
this.isTypeRead = isTypeRead;
359-
}
360-
361350
public long getId() {
362351
return id;
363352
}
@@ -490,7 +479,6 @@ public void gsonPostProcess() throws IOException {
490479
}
491480
if (keys.size() > 1) {
492481
keys.forEach(key -> key.setCompoundKey(true));
493-
hasCompoundKey = true;
494482
}
495483
}
496484

fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ public TabletHealth() {
111111
protected List<Replica> replicas;
112112
@SerializedName(value = "cv", alternate = {"checkedVersion"})
113113
private long checkedVersion;
114-
@Deprecated
115-
@SerializedName(value = "cvs", alternate = {"checkedVersionHash"})
116-
private long checkedVersionHash;
117114
@SerializedName(value = "ic", alternate = {"isConsistent"})
118115
private boolean isConsistent;
119116

@@ -158,10 +155,6 @@ private Tablet(long tabletId, List<Replica> replicas) {
158155
isConsistent = true;
159156
}
160157

161-
public void setIdForRestore(long tabletId) {
162-
this.id = tabletId;
163-
}
164-
165158
public long getId() {
166159
return this.id;
167160
}
@@ -449,11 +442,6 @@ public void setTabletId(long tabletId) {
449442
this.id = tabletId;
450443
}
451444

452-
public static void sortReplicaByVersionDesc(List<Replica> replicas) {
453-
// sort replicas by version. higher version in the tops
454-
replicas.sort(Replica.VERSION_DESC_COMPARATOR);
455-
}
456-
457445
@Override
458446
public String toString() {
459447
return "tabletId=" + this.id;

0 commit comments

Comments
 (0)