1616
1717package com .navercorp .pinpoint .web .filter ;
1818
19- import com .google .common .collect .ImmutableSet ;
2019import com .navercorp .pinpoint .common .server .bo .AnnotationBo ;
2120import com .navercorp .pinpoint .common .server .bo .SpanBo ;
2221import com .navercorp .pinpoint .common .server .bo .SpanEventBo ;
2524import com .navercorp .pinpoint .common .util .CollectionUtils ;
2625import com .navercorp .pinpoint .loader .service .AnnotationKeyRegistryService ;
2726import com .navercorp .pinpoint .loader .service .ServiceTypeRegistryService ;
27+ import org .eclipse .collections .api .factory .primitive .IntSets ;
28+ import org .eclipse .collections .api .set .primitive .IntSet ;
29+ import org .eclipse .collections .api .set .primitive .MutableIntSet ;
2830import org .springframework .util .AntPathMatcher ;
2931
30- import java .util .HashSet ;
3132import java .util .List ;
3233import java .util .NoSuchElementException ;
3334import java .util .Objects ;
34- import java .util .Set ;
3535
3636/**
3737 * @author emeroad
@@ -45,7 +45,7 @@ public class RpcURLPatternFilter implements URLPatternFilter {
4545 private final AnnotationKeyRegistryService annotationKeyRegistryService ;
4646
4747 // TODO remove. hard coded annotation for compatibility, need a better to group rpc url annotations
48- private final Set < Integer > rpcEndpointAnnotationCodes ;
48+ private final IntSet rpcEndpointAnnotationCodes ;
4949
5050 public RpcURLPatternFilter (String urlPattern , ServiceTypeRegistryService serviceTypeRegistryService , AnnotationKeyRegistryService annotationKeyRegistryService ) {
5151 this .urlPattern = Objects .requireNonNull (urlPattern , "urlPattern" );
@@ -57,12 +57,12 @@ public RpcURLPatternFilter(String urlPattern, ServiceTypeRegistryService service
5757 // TODO remove. hard coded annotation for compatibility, need a better to group rpc url annotations
5858 this .rpcEndpointAnnotationCodes = initRpcEndpointAnnotations (
5959 AnnotationKey .HTTP_URL .getName (), AnnotationKey .MESSAGE_QUEUE_URI .getName (),
60- "thrift.url" , "npc.url" , "nimm.url"
60+ "thrift.url" , "npc.url"
6161 );
6262 }
6363
64- private Set < Integer > initRpcEndpointAnnotations (String ... annotationKeyNames ) {
65- Set < Integer > rpcEndPointAnnotationCodes = new HashSet <> ();
64+ private IntSet initRpcEndpointAnnotations (String ... annotationKeyNames ) {
65+ MutableIntSet rpcEndPointAnnotationCodes = IntSets . mutable . of ();
6666 for (String annotationKeyName : annotationKeyNames ) {
6767 try {
6868 final AnnotationKey pluginRpcEndpointAnnotationKey = annotationKeyRegistryService .findAnnotationKeyByName (annotationKeyName );
@@ -73,7 +73,7 @@ private Set<Integer> initRpcEndpointAnnotations(String... annotationKeyNames) {
7373 // ignore
7474 }
7575 }
76- return ImmutableSet . copyOf ( rpcEndPointAnnotationCodes );
76+ return rpcEndPointAnnotationCodes . freeze ( );
7777 }
7878
7979 @ Override
0 commit comments