test_class.declarator: invokers = new ArrayList<Invoker<IHelloService>>()
test_class.original_string: List<Invoker<IHelloService>> invokers = new ArrayList<Invoker<IHelloService>>();
test_class.type: List<Invoker<IHelloService>>
test_class.var_name: invokers
test_class.declarator: selectedInvokers = new ArrayList<Invoker<IHelloService>>()
test_class.original_string: List<Invoker<IHelloService>> selectedInvokers = new ArrayList<Invoker<IHelloService>>();
test_class.type: List<Invoker<IHelloService>>
test_class.var_name: selectedInvokers
test_class.declarator: cluster
test_class.original_string: AbstractClusterInvoker<IHelloService> cluster;
test_class.type: AbstractClusterInvoker<IHelloService>
test_class.var_name: cluster
test_class.declarator: cluster_nocheck
test_class.original_string: AbstractClusterInvoker<IHelloService> cluster_nocheck;
test_class.type: AbstractClusterInvoker<IHelloService>
test_class.var_name: cluster_nocheck
test_class.declarator: dic
test_class.original_string: Directory<IHelloService> dic;
test_class.type: Directory<IHelloService>
test_class.var_name: dic
test_class.declarator: invocation = new RpcInvocation()
test_class.original_string: RpcInvocation invocation = new RpcInvocation();
test_class.type: RpcInvocation
test_class.var_name: invocation
test_class.declarator: url = URL.valueOf("registry://localhost:9090")
test_class.original_string: URL url = URL.valueOf("registry://localhost:9090");
test_class.type: URL
test_class.var_name: url
test_class.declarator: invoker1
test_class.original_string: Invoker<IHelloService> invoker1;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker1
test_class.declarator: invoker2
test_class.original_string: Invoker<IHelloService> invoker2;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker2
test_class.declarator: invoker3
test_class.original_string: Invoker<IHelloService> invoker3;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker3
test_class.declarator: invoker4
test_class.original_string: Invoker<IHelloService> invoker4;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker4
test_class.declarator: invoker5
test_class.original_string: Invoker<IHelloService> invoker5;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker5
test_class.declarator: mockedInvoker1
test_class.original_string: Invoker<IHelloService> mockedInvoker1;
test_class.type: Invoker<IHelloService>
test_class.var_name: mockedInvoker1
test_class.file: dubbo-cluster/src/test/java/com/alibaba/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
test_class.identifier: AbstractClusterInvokerTest
test_case.body: @Test
      public void testSelect_Invokersize2AndselectNotNull() throws Exception {
          invokers.clear();
          invokers.add(invoker2);
          invokers.add(invoker4);
          {
              selectedInvokers.clear();
              selectedInvokers.add(invoker4);
              Invoker invoker = cluster.select(null, invocation, invokers, selectedInvokers);
              Assert.assertEquals(invoker2, invoker);
          }
          {
              selectedInvokers.clear();
              selectedInvokers.add(invoker2);
              Invoker invoker = cluster.select(null, invocation, invokers, selectedInvokers);
              Assert.assertEquals(invoker4, invoker);
          }
      }
test_case.class_method_signature: AbstractClusterInvokerTest.testSelect_Invokersize2AndselectNotNull()
test_case.full_signature: @Test public void testSelect_Invokersize2AndselectNotNull()
test_case.identifier: testSelect_Invokersize2AndselectNotNull
test_case.invocations: clear add add clear add select assertEquals clear add select assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSelect_Invokersize2AndselectNotNull()
focal_class.declarator: logger = LoggerFactory
              .getLogger(AbstractClusterInvoker.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory
              .getLogger(AbstractClusterInvoker.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: directory
focal_class.modifier: protected final
focal_class.original_string: protected final Directory<T> directory;
focal_class.type: Directory<T>
focal_class.var_name: directory
focal_class.declarator: availablecheck
focal_class.modifier: protected final
focal_class.original_string: protected final boolean availablecheck;
focal_class.type: boolean
focal_class.var_name: availablecheck
focal_class.declarator: destroyed = new AtomicBoolean(false)
focal_class.modifier: private
focal_class.original_string: private AtomicBoolean destroyed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: destroyed
focal_class.declarator: stickyInvoker = null
focal_class.modifier: private volatile
focal_class.original_string: private volatile Invoker<T> stickyInvoker = null;
focal_class.type: Invoker<T>
focal_class.var_name: stickyInvoker
focal_class.file: dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
focal_class.identifier: AbstractClusterInvoker
focal_class.interfaces: implements Invoker<T>
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker(Directory<T> directory)
focal_class.full_signature: public  AbstractClusterInvoker(Directory<T> directory)
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: (Directory<T> directory)
focal_class.signature:  AbstractClusterInvoker(Directory<T> directory)
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.full_signature: public  AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: (Directory<T> directory, URL url)
focal_class.signature:  AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.class_method_signature: AbstractClusterInvoker.getInterface()
focal_class.full_signature: @Override public Class<T> getInterface()
focal_class.identifier: getInterface
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<T>
focal_class.signature: Class<T> getInterface()
focal_class.class_method_signature: AbstractClusterInvoker.getUrl()
focal_class.full_signature: @Override public URL getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getUrl()
focal_class.class_method_signature: AbstractClusterInvoker.isAvailable()
focal_class.full_signature: @Override public boolean isAvailable()
focal_class.identifier: isAvailable
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isAvailable()
focal_class.class_method_signature: AbstractClusterInvoker.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: AbstractClusterInvoker.select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.full_signature: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.identifier: select
focal_class.modifiers: protected
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.class_method_signature: AbstractClusterInvoker.doSelect(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.full_signature: private Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.identifier: doSelect
focal_class.modifiers: private
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.class_method_signature: AbstractClusterInvoker.reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.full_signature: private Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.identifier: reselect
focal_class.modifiers: private
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.class_method_signature: AbstractClusterInvoker.invoke(final Invocation invocation)
focal_class.full_signature: @Override public Result invoke(final Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (final Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(final Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.checkWhetherDestroyed()
focal_class.full_signature: protected void checkWhetherDestroyed()
focal_class.identifier: checkWhetherDestroyed
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkWhetherDestroyed()
focal_class.class_method_signature: AbstractClusterInvoker.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: AbstractClusterInvoker.checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.full_signature: protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.identifier: checkInvokers
focal_class.modifiers: protected
focal_class.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_class.return: void
focal_class.signature: void checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.full_signature: protected abstract Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.identifier: doInvoke
focal_class.modifiers: protected abstract
focal_class.parameters: (Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.return: Result
focal_class.signature: Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.class_method_signature: AbstractClusterInvoker.list(Invocation invocation)
focal_class.full_signature: protected List<Invoker<T>> list(Invocation invocation)
focal_class.identifier: list
focal_class.modifiers: protected
focal_class.parameters: (Invocation invocation)
focal_class.return: List<Invoker<T>>
focal_class.signature: List<Invoker<T>> list(Invocation invocation)
focal_method.body: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected) throws RpcException {
          if (invokers == null || invokers.isEmpty())
              return null;
          // 获取调用方法名
          String methodName = invocation == null ? "" : invocation.getMethodName();
  
          boolean sticky = invokers.get(0).getUrl().getMethodParameter(methodName, Constants.CLUSTER_STICKY_KEY, Constants.DEFAULT_CLUSTER_STICKY);
          {
              //ignore overloaded method
              if (stickyInvoker != null && !invokers.contains(stickyInvoker)) {
                  stickyInvoker = null;
              }
              //ignore concurrency problem
              if (sticky && stickyInvoker != null && (selected == null || !selected.contains(stickyInvoker))) {
                  if (availablecheck && stickyInvoker.isAvailable()) {
                      return stickyInvoker;
                  }
              }
          }
          Invoker<T> invoker = doSelect(loadbalance, invocation, invokers, selected);
  
          if (sticky) {
              stickyInvoker = invoker;
          }
          return invoker;
      }
focal_method.class_method_signature: AbstractClusterInvoker.select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_method.full_signature: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_method.identifier: select
focal_method.invocations: isEmpty getMethodName getMethodParameter getUrl get contains contains isAvailable doSelect
focal_method.modifiers: protected
focal_method.parameters: (LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_method.return: Invoker<T>
focal_method.signature: Invoker<T> select(LoadBalance loadbalance, Invocation invocation, List<Invoker<T>> invokers, List<Invoker<T>> selected)