类 TimeoutUtils
- java.lang.Object
-
- com.alibaba.nacos.config.server.utils.TimeoutUtils
-
public class TimeoutUtils extends java.lang.ObjectA utility class that handles timeouts and is used by the client to retrieve the total timeout of the data. After obtaining the data from the network,totalTime is accumulated. Before obtaining the data from the network, check whether the totalTime is greater than totalTimeout. If yes, it indicates the totalTimeout- 作者:
- leiwen.zh
-
-
字段概要
字段 修饰符和类型 字段 说明 private booleaninitializedprivate longinvalidThresholdThe cumulative expiration time of the time consumed by fetching the data, the unit of ms.private longlastResetTimeprivate java.util.concurrent.atomic.AtomicLongtotalTimeTotal time to get the data of consumption, the unit of ms.private longtotalTimeoutTotal timeout to get data, the unit of ms.
-
构造器概要
构造器 构造器 说明 TimeoutUtils(long totalTimeout, long invalidThreshold)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddTotalTime(long time)Cumulative total time.java.util.concurrent.atomic.AtomicLonggetTotalTime()voidinitLastResetTime()Init last reset time.booleanisTimeout()Is timeout.private booleanisTotalTimeExpired()voidresetTotalTime()Clean the total time.
-
-
-
字段详细资料
-
totalTime
private final java.util.concurrent.atomic.AtomicLong totalTime
Total time to get the data of consumption, the unit of ms.
-
lastResetTime
private volatile long lastResetTime
-
initialized
private volatile boolean initialized
-
totalTimeout
private long totalTimeout
Total timeout to get data, the unit of ms.
-
invalidThreshold
private long invalidThreshold
The cumulative expiration time of the time consumed by fetching the data, the unit of ms.
-
-
方法详细资料
-
initLastResetTime
public void initLastResetTime()
Init last reset time.
-
addTotalTime
public void addTotalTime(long time)
Cumulative total time.
-
isTimeout
public boolean isTimeout()
Is timeout.
-
resetTotalTime
public void resetTotalTime()
Clean the total time.
-
getTotalTime
public java.util.concurrent.atomic.AtomicLong getTotalTime()
-
isTotalTimeExpired
private boolean isTotalTimeExpired()
-
-