|
34 | 34 |
|
35 | 35 | import java.time.ZoneId; |
36 | 36 | import java.util.HashSet; |
37 | | -import java.util.LinkedList; |
38 | | -import java.util.List; |
39 | 37 | import java.util.Set; |
| 38 | +import java.util.concurrent.ConcurrentHashMap; |
40 | 39 | import java.util.function.LongConsumer; |
41 | 40 |
|
42 | 41 | /** |
@@ -66,7 +65,8 @@ public class MPPQueryContext { |
66 | 65 | // When some DataNode cannot be connected, its endPoint will be put |
67 | 66 | // in this list. And the following retry will avoid planning fragment |
68 | 67 | // onto this node. |
69 | | - private final List<TEndPoint> endPointBlackList; |
| 68 | + // When dispatch FI fails, this structure may be modified concurrently |
| 69 | + private final Set<TEndPoint> endPointBlackList; |
70 | 70 |
|
71 | 71 | private final TypeProvider typeProvider = new TypeProvider(); |
72 | 72 |
|
@@ -97,7 +97,7 @@ public class MPPQueryContext { |
97 | 97 |
|
98 | 98 | public MPPQueryContext(QueryId queryId) { |
99 | 99 | this.queryId = queryId; |
100 | | - this.endPointBlackList = new LinkedList<>(); |
| 100 | + this.endPointBlackList = ConcurrentHashMap.newKeySet(); |
101 | 101 | this.memoryReservationManager = |
102 | 102 | new NotThreadSafeMemoryReservationManager(queryId, this.getClass().getName()); |
103 | 103 | } |
@@ -222,7 +222,7 @@ public void addFailedEndPoint(TEndPoint endPoint) { |
222 | 222 | this.endPointBlackList.add(endPoint); |
223 | 223 | } |
224 | 224 |
|
225 | | - public List<TEndPoint> getEndPointBlackList() { |
| 225 | + public Set<TEndPoint> getEndPointBlackList() { |
226 | 226 | return endPointBlackList; |
227 | 227 | } |
228 | 228 |
|
|
0 commit comments