You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by de...@apache.org on 2021/07/28 10:54:54 UTC

[incubator-shenyu] branch master updated: Update UpstreamCheckService (#1821)

This is an automated email from the ASF dual-hosted git repository.

dengliming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new e70487d  Update UpstreamCheckService (#1821)
e70487d is described below

commit e70487d0e27faa9a0baf474627310e85d8f3c4cd
Author: David Liu <re...@163.com>
AuthorDate: Wed Jul 28 18:54:47 2021 +0800

    Update UpstreamCheckService (#1821)
    
    * append hashCode and equals to ZombieUpstream
    
    * add final object field descriptor to the field that only assign in UpstreamCheckService constructor
    
    Co-authored-by: 旻嘉 <lw...@alibaba-inc.com>
---
 .../apache/shenyu/admin/service/impl/UpstreamCheckService.java    | 8 ++++----
 .../java/org/apache/shenyu/common/dto/convert/ZombieUpstream.java | 5 +++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/UpstreamCheckService.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/UpstreamCheckService.java
index 601f439..808ff91 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/UpstreamCheckService.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/UpstreamCheckService.java
@@ -69,13 +69,13 @@ public class UpstreamCheckService {
 
     private static final Set<ZombieUpstream> ZOMBIE_SET = Sets.newConcurrentHashSet();
 
-    private int zombieCheckTimes;
+    private final int zombieCheckTimes;
 
-    private int scheduledTime;
+    private final int scheduledTime;
 
-    private String registerType;
+    private final String registerType;
 
-    private boolean checked;
+    private final boolean checked;
 
     private final SelectorMapper selectorMapper;
 
diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/dto/convert/ZombieUpstream.java b/shenyu-common/src/main/java/org/apache/shenyu/common/dto/convert/ZombieUpstream.java
index d1ff796..f8ca507 100644
--- a/shenyu-common/src/main/java/org/apache/shenyu/common/dto/convert/ZombieUpstream.java
+++ b/shenyu-common/src/main/java/org/apache/shenyu/common/dto/convert/ZombieUpstream.java
@@ -19,6 +19,7 @@ package org.apache.shenyu.common.dto.convert;
 
 import lombok.AllArgsConstructor;
 import lombok.Builder;
+import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
@@ -33,21 +34,25 @@ import lombok.ToString;
 @NoArgsConstructor
 @ToString
 @Builder
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
 public class ZombieUpstream {
 
     /**
      * divide upstream.
      */
+    @EqualsAndHashCode.Include
     private DivideUpstream divideUpstream;
 
     /**
      * total check times.
      */
+    @EqualsAndHashCode.Include
     private int zombieCheckTimes;
 
     /**
      * origin selector name.
      */
+    @EqualsAndHashCode.Include
     private String selectorName;
 
     /**