test_class.file: dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalanceTest.java
test_class.identifier: RoundRobinLoadBalanceTest
test_class.superclass: extends LoadBalanceBaseTest
test_case.body: @Test
      public void testNodeCacheShouldRecycle() {
          {
              Field recycleTimeField = null;
              try {
                  //change recycle time to 1 ms
                  recycleTimeField = RoundRobinLoadBalance.class.getDeclaredField("RECYCLE_PERIOD");
                  recycleTimeField.setAccessible(true);
                  recycleTimeField.setInt(RoundRobinLoadBalance.class, 10);
              } catch (NoSuchFieldException e) {
                  Assertions.assertTrue(true, "getField failed");
              } catch (SecurityException e) {
                  Assertions.assertTrue(true, "getField failed");
              } catch (IllegalArgumentException e) {
                  Assertions.assertTrue(true, "getField failed");
              } catch (IllegalAccessException e) {
                  Assertions.assertTrue(true, "getField failed");
              }
          }
  
          int loop = 10000;
          //tmperately add a new invoker
          weightInvokers.add(weightInvokerTmp);
          try {
              Map<Invoker, InvokeResult> resultMap = getWeightedInvokeResult(loop, RoundRobinLoadBalance.NAME);
              assertStrictWRRResult(loop, resultMap);
  
              // inner nodes cache judgement
              RoundRobinLoadBalance lb = (RoundRobinLoadBalance) getLoadBalance(RoundRobinLoadBalance.NAME);
              Assertions.assertEquals(weightInvokers.size(), lb.getInvokerAddrList(weightInvokers, weightTestInvocation).size());
  
              weightInvokers.remove(weightInvokerTmp);
  
              resultMap = getWeightedInvokeResult(loop, RoundRobinLoadBalance.NAME);
              assertStrictWRRResult(loop, resultMap);
  
              Assertions.assertEquals(weightInvokers.size(), lb.getInvokerAddrList(weightInvokers, weightTestInvocation).size());
          } finally {
              //prevent other UT's failure
              weightInvokers.remove(weightInvokerTmp);
          }
      }
test_case.class_method_signature: RoundRobinLoadBalanceTest.testNodeCacheShouldRecycle()
test_case.full_signature: @Test public void testNodeCacheShouldRecycle()
test_case.identifier: testNodeCacheShouldRecycle
test_case.invocations: getDeclaredField setAccessible setInt assertTrue assertTrue assertTrue assertTrue add getWeightedInvokeResult assertStrictWRRResult getLoadBalance assertEquals size size getInvokerAddrList remove getWeightedInvokeResult assertStrictWRRResult assertEquals size size getInvokerAddrList remove
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNodeCacheShouldRecycle()
focal_class.declarator: NAME = "roundrobin"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = "roundrobin";
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: RECYCLE_PERIOD = 60000
focal_class.modifier: private static final
focal_class.original_string: private static final int RECYCLE_PERIOD = 60000;
focal_class.type: int
focal_class.var_name: RECYCLE_PERIOD
focal_class.declarator: methodWeightMap = new ConcurrentHashMap<String, ConcurrentMap<String, WeightedRoundRobin>>()
focal_class.modifier: private
focal_class.original_string: private ConcurrentMap<String, ConcurrentMap<String, WeightedRoundRobin>> methodWeightMap = new ConcurrentHashMap<String, ConcurrentMap<String, WeightedRoundRobin>>();
focal_class.type: ConcurrentMap<String, ConcurrentMap<String, WeightedRoundRobin>>
focal_class.var_name: methodWeightMap
focal_class.file: dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RoundRobinLoadBalance.java
focal_class.identifier: RoundRobinLoadBalance
focal_class.class_method_signature: RoundRobinLoadBalance.getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation)
focal_class.full_signature: protected Collection<String> getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation)
focal_class.identifier: getInvokerAddrList
focal_class.modifiers: protected
focal_class.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_class.return: Collection<String>
focal_class.signature: Collection<String> getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation)
focal_class.class_method_signature: RoundRobinLoadBalance.doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.full_signature: @Override protected Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.identifier: doSelect
focal_class.modifiers: @Override protected
focal_class.parameters: (List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.superclass: extends AbstractLoadBalance
focal_method.body: protected <T> Collection<String> getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation) {
          String key = invokers.get(0).getUrl().getServiceKey() + "." + invocation.getMethodName();
          Map<String, WeightedRoundRobin> map = methodWeightMap.get(key);
          if (map != null) {
              return map.keySet();
          }
          return null;
      }
focal_method.class_method_signature: RoundRobinLoadBalance.getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation)
focal_method.full_signature: protected Collection<String> getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation)
focal_method.identifier: getInvokerAddrList
focal_method.invocations: getServiceKey getUrl get getMethodName get keySet
focal_method.modifiers: protected
focal_method.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_method.return: Collection<String>
focal_method.signature: Collection<String> getInvokerAddrList(List<Invoker<T>> invokers, Invocation invocation)