Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions fe/fe-core/src/main/java/org/apache/doris/catalog/Tablet.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.Pair;
import org.apache.doris.common.UserException;
import org.apache.doris.common.lock.MonitoredReentrantReadWriteLock;
import org.apache.doris.resource.Tag;
import org.apache.doris.system.Backend;
import org.apache.doris.system.SystemInfoService;
Expand Down Expand Up @@ -123,7 +122,7 @@ public TabletHealth() {
private long cooldownReplicaId = -1;
@SerializedName(value = "ctm", alternate = {"cooldownTerm"})
private long cooldownTerm = -1;
private MonitoredReentrantReadWriteLock cooldownConfLock = new MonitoredReentrantReadWriteLock();
private final Object cooldownConfLock = new Object();

// last time that the tablet checker checks this tablet.
// no need to persist
Expand Down Expand Up @@ -184,22 +183,19 @@ public boolean isConsistent() {
}

public void setCooldownConf(long cooldownReplicaId, long cooldownTerm) {
cooldownConfLock.writeLock().lock();
this.cooldownReplicaId = cooldownReplicaId;
this.cooldownTerm = cooldownTerm;
cooldownConfLock.writeLock().unlock();
synchronized (cooldownConfLock) {
this.cooldownReplicaId = cooldownReplicaId;
this.cooldownTerm = cooldownTerm;
}
}

public long getCooldownReplicaId() {
return cooldownReplicaId;
}

public Pair<Long, Long> getCooldownConf() {
cooldownConfLock.readLock().lock();
try {
synchronized (cooldownConfLock) {
return Pair.of(cooldownReplicaId, cooldownTerm);
} finally {
cooldownConfLock.readLock().unlock();
}
}

Expand Down
Loading