类 HealthCheckTaskV2
- java.lang.Object
-
- com.alibaba.nacos.common.task.AbstractExecuteTask
-
- com.alibaba.nacos.naming.healthcheck.v2.HealthCheckTaskV2
-
- 所有已实现的接口:
com.alibaba.nacos.common.task.NacosTask,NacosHealthCheckTask,Interceptable,java.lang.Runnable
public class HealthCheckTaskV2 extends com.alibaba.nacos.common.task.AbstractExecuteTask implements NacosHealthCheckTask
Health check task for v2.x.Current health check logic is same as v1.x. TODO refactor health check for v2.x.
- 作者:
- nacos
-
-
字段概要
字段 修饰符和类型 字段 说明 private booleancancelledprivate longcheckRtBestprivate longcheckRtLastprivate longcheckRtLastLastprivate longcheckRtNormalizedprivate longcheckRtWorstprivate IpPortBasedClientclientprivate static intLOWER_CHECK_RTprivate static NamingMetadataManagermetadataManagerprivate longstartTimeprivate static SwitchDomainswitchDomainprivate java.lang.StringtaskIdprivate static intUPPER_RANDOM_CHECK_RT
-
构造器概要
构造器 构造器 说明 HealthCheckTaskV2(IpPortBasedClient client)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidafterIntercept()If oneNacosNamingInterceptorintercept this object, this method will be called.voiddoHealthCheck()Do health check.longgetCheckRtBest()longgetCheckRtLast()longgetCheckRtLastLast()longgetCheckRtNormalized()longgetCheckRtWorst()IpPortBasedClientgetClient()private ClusterMetadatagetClusterMetadata(Service service, InstancePublishInfo instancePublishInfo)longgetStartTime()java.lang.StringgetTaskId()Get task id.private voidinitCheckRT()private voidinitIfNecessary()booleanisCancelled()voidpassIntercept()If noNacosNamingInterceptorintercept this object, this method will be called to execute.voidrun()voidsetCancelled(boolean cancelled)voidsetCheckRtBest(long checkRtBest)voidsetCheckRtLast(long checkRtLast)voidsetCheckRtLastLast(long checkRtLastLast)voidsetCheckRtNormalized(long checkRtNormalized)voidsetCheckRtWorst(long checkRtWorst)voidsetStartTime(long startTime)
-
-
-
字段详细资料
-
LOWER_CHECK_RT
private static final int LOWER_CHECK_RT
- 另请参阅:
- 常量字段值
-
UPPER_RANDOM_CHECK_RT
private static final int UPPER_RANDOM_CHECK_RT
- 另请参阅:
- 常量字段值
-
switchDomain
private static SwitchDomain switchDomain
-
metadataManager
private static NamingMetadataManager metadataManager
-
client
private final IpPortBasedClient client
-
taskId
private final java.lang.String taskId
-
checkRtNormalized
private long checkRtNormalized
-
checkRtBest
private long checkRtBest
-
checkRtWorst
private long checkRtWorst
-
checkRtLast
private long checkRtLast
-
checkRtLastLast
private long checkRtLastLast
-
startTime
private long startTime
-
cancelled
private volatile boolean cancelled
-
-
构造器详细资料
-
HealthCheckTaskV2
public HealthCheckTaskV2(IpPortBasedClient client)
-
-
方法详细资料
-
initIfNecessary
private void initIfNecessary()
-
initCheckRT
private void initCheckRT()
-
getClient
public IpPortBasedClient getClient()
-
getTaskId
public java.lang.String getTaskId()
从接口复制的说明:NacosHealthCheckTaskGet task id.- 指定者:
getTaskId在接口中NacosHealthCheckTask- 返回:
- task id.
-
doHealthCheck
public void doHealthCheck()
从接口复制的说明:NacosHealthCheckTaskDo health check.- 指定者:
doHealthCheck在接口中NacosHealthCheckTask
-
passIntercept
public void passIntercept()
从接口复制的说明:InterceptableIf noNacosNamingInterceptorintercept this object, this method will be called to execute.- 指定者:
passIntercept在接口中Interceptable
-
afterIntercept
public void afterIntercept()
从接口复制的说明:InterceptableIf oneNacosNamingInterceptorintercept this object, this method will be called.- 指定者:
afterIntercept在接口中Interceptable
-
run
public void run()
- 指定者:
run在接口中java.lang.Runnable
-
getClusterMetadata
private ClusterMetadata getClusterMetadata(Service service, InstancePublishInfo instancePublishInfo)
-
getCheckRtNormalized
public long getCheckRtNormalized()
-
getCheckRtBest
public long getCheckRtBest()
-
getCheckRtWorst
public long getCheckRtWorst()
-
setCheckRtWorst
public void setCheckRtWorst(long checkRtWorst)
-
setCheckRtBest
public void setCheckRtBest(long checkRtBest)
-
setCheckRtNormalized
public void setCheckRtNormalized(long checkRtNormalized)
-
isCancelled
public boolean isCancelled()
-
setCancelled
public void setCancelled(boolean cancelled)
-
getStartTime
public long getStartTime()
-
setStartTime
public void setStartTime(long startTime)
-
getCheckRtLast
public long getCheckRtLast()
-
setCheckRtLast
public void setCheckRtLast(long checkRtLast)
-
getCheckRtLastLast
public long getCheckRtLastLast()
-
setCheckRtLastLast
public void setCheckRtLastLast(long checkRtLastLast)
-
-