// comflix.discovery.DiscoveryClientboolean renew() {try {EurekaHttpResponse<InstanceInfo> httpResponse = istrationClient.sendHeartBeat(AppName(), Id(), this.instanceInfo, (InstanceStatus)null);logger.debug("DiscoveryClient_{} - Heartbeat status: {}", this.appPathIdentifier, StatusCode());if (StatusCode() == Status.StatusCode()) {this.REREGISTER_COUNTER.increment();logger.info("DiscoveryClient_{} - Re-registering apps/{}", this.appPathIdentifier, AppName());long timestamp = this.instanceInfo.setIsDirtyWithTime();boolean success = ister();if (success) {this.instanceInfo.unsetIsDirty(timestamp);}return success;} else {StatusCode() == StatusCode();}} catch (Throwable var5) {("DiscoveryClient_{} - was unable to send heartbeat!", this.appPathIdentifier, var5);return false;}}
// sources.InstanceResource@PUTpublic Response renewLease(@HeaderParam("x-netflix-discovery-replication") String isReplication, @QueryParam("overriddenstatus") String overriddenStatus, @QueryParam("status") String status, @QueryParam("lastDirtyTimestamp")
String lastDirtyTimestamp) {boolean isFromReplicaNode = "true".equals(isReplication);boolean isSuccess = w(Name(), this.id, isFromReplicaNode);if (!isSuccess) {logger.warn("Not Found (Renew): {} - {}", Name(), this.id);return Response.status(Status.NOT_FOUND).build();} else {Response response;if (lastDirtyTimestamp != null && this.serverConfig.shouldSyncWhenTimestampDiffers()) {response = this.validateDirtyTimestamp(Long.valueOf(lastDirtyTimestamp), isFromReplicaNode);if (Status() == Status.StatusCode() && overriddenStatus != null && !InstanceStatus.UNKNOWN.name().equals(overriddenStatus) && isFromReplicaNode) {istry.storeOverriddenStatusIfRequired(AppName(), this.id, InstanceStatus.valueOf(overriddenStatus));}} else {response = Response.ok().build();}logger.debug("Found (Renew): {} - {}; reply status={}", new Object[]{Name(), this.id, Status()});return response;}}
本文发布于:2024-01-31 01:15:32,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170663493324289.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |