Skip to content

Commit fd65e58

Browse files
committed
remove useless code
1 parent d2d5ff1 commit fd65e58

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

motan-core/src/main/java/com/weibo/api/motan/cluster/group/DefaultClusterSelector.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,6 @@ public Cluster<T> select(Request request) {
5050
return clusterGroup.getMasterCluster();
5151
}
5252

53-
private boolean isMatch(Request request, Cluster<T> cluster, String defaultValue) {
54-
if (cluster != null && !CollectionUtil.isEmpty(cluster.getReferers())) {
55-
// Check the route group of the request
56-
String routeGroup = request.getAttachment(MotanConstants.ROUTE_GROUP_KEY);
57-
if (routeGroup != null) {
58-
routeGroup = routeGroup.trim();
59-
// If the route group is default value, such as "sandbox", return true
60-
if (defaultValue != null && defaultValue.equals(routeGroup)) {
61-
return true;
62-
}
63-
64-
// Check the comma-separated group list
65-
String[] routeGroupList = routeGroup.split(",");
66-
String targetGroup = cluster.getUrl().getGroup();
67-
for (String group : routeGroupList) {
68-
group = group.trim();
69-
if (group.equals(targetGroup)) { // if the route group is the same as the target group, return true
70-
return true;
71-
}
72-
}
73-
}
74-
}
75-
return false;
76-
}
77-
7853
@Override
7954
public void init(ClusterGroup<T> clusterGroup) {
8055
if (clusterGroup == null) {

motan-core/src/main/java/com/weibo/api/motan/config/RefererConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
*/
4848

4949
public class RefererConfig<T> extends AbstractRefererConfig {
50-
private static final ConcurrentHashSet<String> NONE_EXTRA_GROUP_PROTOCOL_SET = new ConcurrentHashSet<>(); // The set of protocols that do not support sandbox grouping.
51-
private static final ConcurrentHashSet<String> NONE_EXTRA_GROUP_REGISTRY_SET = new ConcurrentHashSet<>(); // The set of protocols that do not support sandbox grouping.
50+
private static final ConcurrentHashSet<String> NONE_EXTRA_GROUP_PROTOCOL_SET = new ConcurrentHashSet<>(); // The set of protocols that do not support sandbox/grey grouping.
51+
private static final ConcurrentHashSet<String> NONE_EXTRA_GROUP_REGISTRY_SET = new ConcurrentHashSet<>(); // The set of registries that do not support sandbox/grey grouping.
5252

5353
static {
5454
NONE_EXTRA_GROUP_PROTOCOL_SET.add(MotanConstants.PROTOCOL_INJVM);

0 commit comments

Comments
 (0)