test_class.declarator: service
test_class.modifier: static
test_class.original_string: static String service;
test_class.type: String
test_class.var_name: service
test_class.declarator: serviceUrl
test_class.modifier: static
test_class.original_string: static URL serviceUrl;
test_class.type: URL
test_class.var_name: serviceUrl
test_class.declarator: registryUrl
test_class.modifier: static
test_class.original_string: static URL registryUrl;
test_class.type: URL
test_class.var_name: registryUrl
test_class.declarator: registry
test_class.original_string: MockRegistry registry;
test_class.type: MockRegistry
test_class.var_name: registry
test_class.declarator: FAILED_PERIOD = 200
test_class.modifier: private
test_class.original_string: private int FAILED_PERIOD = 200;
test_class.type: int
test_class.var_name: FAILED_PERIOD
test_class.declarator: sleeptime = 100
test_class.modifier: private
test_class.original_string: private int sleeptime = 100;
test_class.type: int
test_class.var_name: sleeptime
test_class.declarator: trytimes = 5
test_class.modifier: private
test_class.original_string: private int trytimes = 5;
test_class.type: int
test_class.var_name: trytimes
test_class.file: dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/FailbackRegistryTest.java
test_class.identifier: FailbackRegistryTest
test_case.body: @Test
      public void testRecover() throws Exception {
          CountDownLatch countDownLatch = new CountDownLatch(4);
          final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
          NotifyListener listener = new NotifyListener() {
              @Override
              public void notify(List<URL> urls) {
                  notified.set(Boolean.TRUE);
              }
          };
  
          MockRegistry mockRegistry = new MockRegistry(registryUrl, countDownLatch);
          mockRegistry.register(serviceUrl);
          mockRegistry.subscribe(serviceUrl, listener);
          Assertions.assertEquals(1, mockRegistry.getRegistered().size());
          Assertions.assertEquals(1, mockRegistry.getSubscribed().size());
          mockRegistry.recover();
          countDownLatch.await();
          Assertions.assertEquals(0, mockRegistry.getFailedRegistered().size());
          FailbackRegistry.Holder h = new FailbackRegistry.Holder(registryUrl, listener);
          Assertions.assertNull(mockRegistry.getFailedSubscribed().get(h));
          Assertions.assertEquals(countDownLatch.getCount(), 0);
      }
test_case.class_method_signature: FailbackRegistryTest.testRecover()
test_case.full_signature: @Test public void testRecover()
test_case.identifier: testRecover
test_case.invocations: set register subscribe assertEquals size getRegistered assertEquals size getSubscribed recover await assertEquals size getFailedRegistered assertNull get getFailedSubscribed assertEquals getCount
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRecover()
focal_class.declarator: failedRegistered = new ConcurrentHashMap<URL, FailedRegisteredTask>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<URL, FailedRegisteredTask> failedRegistered = new ConcurrentHashMap<URL, FailedRegisteredTask>();
focal_class.type: ConcurrentMap<URL, FailedRegisteredTask>
focal_class.var_name: failedRegistered
focal_class.declarator: failedUnregistered = new ConcurrentHashMap<URL, FailedUnregisteredTask>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<URL, FailedUnregisteredTask> failedUnregistered = new ConcurrentHashMap<URL, FailedUnregisteredTask>();
focal_class.type: ConcurrentMap<URL, FailedUnregisteredTask>
focal_class.var_name: failedUnregistered
focal_class.declarator: failedSubscribed = new ConcurrentHashMap<Holder, FailedSubscribedTask>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<Holder, FailedSubscribedTask> failedSubscribed = new ConcurrentHashMap<Holder, FailedSubscribedTask>();
focal_class.type: ConcurrentMap<Holder, FailedSubscribedTask>
focal_class.var_name: failedSubscribed
focal_class.declarator: failedUnsubscribed = new ConcurrentHashMap<Holder, FailedUnsubscribedTask>()
focal_class.modifier: private final
focal_class.original_string: private final ConcurrentMap<Holder, FailedUnsubscribedTask> failedUnsubscribed = new ConcurrentHashMap<Holder, FailedUnsubscribedTask>();
focal_class.type: ConcurrentMap<Holder, FailedUnsubscribedTask>
focal_class.var_name: failedUnsubscribed
focal_class.declarator: retryPeriod
focal_class.modifier: private final
focal_class.original_string: private final int retryPeriod;
focal_class.type: int
focal_class.var_name: retryPeriod
focal_class.declarator: retryTimer
focal_class.modifier: private final
focal_class.original_string: private final HashedWheelTimer retryTimer;
focal_class.type: HashedWheelTimer
focal_class.var_name: retryTimer
focal_class.file: dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/FailbackRegistry.java
focal_class.identifier: FailbackRegistry
focal_class.class_method_signature: FailbackRegistry.FailbackRegistry(URL url)
focal_class.full_signature: public  FailbackRegistry(URL url)
focal_class.identifier: FailbackRegistry
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.signature:  FailbackRegistry(URL url)
focal_class.class_method_signature: FailbackRegistry.removeFailedRegisteredTask(URL url)
focal_class.full_signature: public void removeFailedRegisteredTask(URL url)
focal_class.identifier: removeFailedRegisteredTask
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void removeFailedRegisteredTask(URL url)
focal_class.class_method_signature: FailbackRegistry.removeFailedUnregisteredTask(URL url)
focal_class.full_signature: public void removeFailedUnregisteredTask(URL url)
focal_class.identifier: removeFailedUnregisteredTask
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void removeFailedUnregisteredTask(URL url)
focal_class.class_method_signature: FailbackRegistry.removeFailedSubscribedTask(URL url, NotifyListener listener)
focal_class.full_signature: public void removeFailedSubscribedTask(URL url, NotifyListener listener)
focal_class.identifier: removeFailedSubscribedTask
focal_class.modifiers: public
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void removeFailedSubscribedTask(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.removeFailedUnsubscribedTask(URL url, NotifyListener listener)
focal_class.full_signature: public void removeFailedUnsubscribedTask(URL url, NotifyListener listener)
focal_class.identifier: removeFailedUnsubscribedTask
focal_class.modifiers: public
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void removeFailedUnsubscribedTask(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.addFailedRegistered(URL url)
focal_class.full_signature: private void addFailedRegistered(URL url)
focal_class.identifier: addFailedRegistered
focal_class.modifiers: private
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void addFailedRegistered(URL url)
focal_class.class_method_signature: FailbackRegistry.removeFailedRegistered(URL url)
focal_class.full_signature: private void removeFailedRegistered(URL url)
focal_class.identifier: removeFailedRegistered
focal_class.modifiers: private
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void removeFailedRegistered(URL url)
focal_class.class_method_signature: FailbackRegistry.addFailedUnregistered(URL url)
focal_class.full_signature: private void addFailedUnregistered(URL url)
focal_class.identifier: addFailedUnregistered
focal_class.modifiers: private
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void addFailedUnregistered(URL url)
focal_class.class_method_signature: FailbackRegistry.removeFailedUnregistered(URL url)
focal_class.full_signature: private void removeFailedUnregistered(URL url)
focal_class.identifier: removeFailedUnregistered
focal_class.modifiers: private
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void removeFailedUnregistered(URL url)
focal_class.class_method_signature: FailbackRegistry.addFailedSubscribed(URL url, NotifyListener listener)
focal_class.full_signature: protected void addFailedSubscribed(URL url, NotifyListener listener)
focal_class.identifier: addFailedSubscribed
focal_class.modifiers: protected
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void addFailedSubscribed(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.removeFailedSubscribed(URL url, NotifyListener listener)
focal_class.full_signature: private void removeFailedSubscribed(URL url, NotifyListener listener)
focal_class.identifier: removeFailedSubscribed
focal_class.modifiers: private
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void removeFailedSubscribed(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.addFailedUnsubscribed(URL url, NotifyListener listener)
focal_class.full_signature: private void addFailedUnsubscribed(URL url, NotifyListener listener)
focal_class.identifier: addFailedUnsubscribed
focal_class.modifiers: private
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void addFailedUnsubscribed(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.removeFailedUnsubscribed(URL url, NotifyListener listener)
focal_class.full_signature: private void removeFailedUnsubscribed(URL url, NotifyListener listener)
focal_class.identifier: removeFailedUnsubscribed
focal_class.modifiers: private
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void removeFailedUnsubscribed(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.getFailedRegistered()
focal_class.full_signature:  ConcurrentMap<URL, FailedRegisteredTask> getFailedRegistered()
focal_class.identifier: getFailedRegistered
focal_class.parameters: ()
focal_class.return: ConcurrentMap<URL, FailedRegisteredTask>
focal_class.signature: ConcurrentMap<URL, FailedRegisteredTask> getFailedRegistered()
focal_class.class_method_signature: FailbackRegistry.getFailedUnregistered()
focal_class.full_signature:  ConcurrentMap<URL, FailedUnregisteredTask> getFailedUnregistered()
focal_class.identifier: getFailedUnregistered
focal_class.parameters: ()
focal_class.return: ConcurrentMap<URL, FailedUnregisteredTask>
focal_class.signature: ConcurrentMap<URL, FailedUnregisteredTask> getFailedUnregistered()
focal_class.class_method_signature: FailbackRegistry.getFailedSubscribed()
focal_class.full_signature:  ConcurrentMap<Holder, FailedSubscribedTask> getFailedSubscribed()
focal_class.identifier: getFailedSubscribed
focal_class.parameters: ()
focal_class.return: ConcurrentMap<Holder, FailedSubscribedTask>
focal_class.signature: ConcurrentMap<Holder, FailedSubscribedTask> getFailedSubscribed()
focal_class.class_method_signature: FailbackRegistry.getFailedUnsubscribed()
focal_class.full_signature:  ConcurrentMap<Holder, FailedUnsubscribedTask> getFailedUnsubscribed()
focal_class.identifier: getFailedUnsubscribed
focal_class.parameters: ()
focal_class.return: ConcurrentMap<Holder, FailedUnsubscribedTask>
focal_class.signature: ConcurrentMap<Holder, FailedUnsubscribedTask> getFailedUnsubscribed()
focal_class.class_method_signature: FailbackRegistry.register(URL url)
focal_class.full_signature: @Override public void register(URL url)
focal_class.identifier: register
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void register(URL url)
focal_class.class_method_signature: FailbackRegistry.reExportRegister(URL url)
focal_class.full_signature: @Override public void reExportRegister(URL url)
focal_class.identifier: reExportRegister
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void reExportRegister(URL url)
focal_class.class_method_signature: FailbackRegistry.unregister(URL url)
focal_class.full_signature: @Override public void unregister(URL url)
focal_class.identifier: unregister
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void unregister(URL url)
focal_class.class_method_signature: FailbackRegistry.reExportUnregister(URL url)
focal_class.full_signature: @Override public void reExportUnregister(URL url)
focal_class.identifier: reExportUnregister
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void reExportUnregister(URL url)
focal_class.class_method_signature: FailbackRegistry.subscribe(URL url, NotifyListener listener)
focal_class.full_signature: @Override public void subscribe(URL url, NotifyListener listener)
focal_class.identifier: subscribe
focal_class.modifiers: @Override public
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void subscribe(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.unsubscribe(URL url, NotifyListener listener)
focal_class.full_signature: @Override public void unsubscribe(URL url, NotifyListener listener)
focal_class.identifier: unsubscribe
focal_class.modifiers: @Override public
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void unsubscribe(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.notify(URL url, NotifyListener listener, List<URL> urls)
focal_class.full_signature: @Override protected void notify(URL url, NotifyListener listener, List<URL> urls)
focal_class.identifier: notify
focal_class.modifiers: @Override protected
focal_class.parameters: (URL url, NotifyListener listener, List<URL> urls)
focal_class.return: void
focal_class.signature: void notify(URL url, NotifyListener listener, List<URL> urls)
focal_class.class_method_signature: FailbackRegistry.doNotify(URL url, NotifyListener listener, List<URL> urls)
focal_class.full_signature: protected void doNotify(URL url, NotifyListener listener, List<URL> urls)
focal_class.identifier: doNotify
focal_class.modifiers: protected
focal_class.parameters: (URL url, NotifyListener listener, List<URL> urls)
focal_class.return: void
focal_class.signature: void doNotify(URL url, NotifyListener listener, List<URL> urls)
focal_class.class_method_signature: FailbackRegistry.recover()
focal_class.full_signature: @Override protected void recover()
focal_class.identifier: recover
focal_class.modifiers: @Override protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void recover()
focal_class.class_method_signature: FailbackRegistry.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: FailbackRegistry.doRegister(URL url)
focal_class.full_signature: public abstract void doRegister(URL url)
focal_class.identifier: doRegister
focal_class.modifiers: public abstract
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void doRegister(URL url)
focal_class.class_method_signature: FailbackRegistry.doUnregister(URL url)
focal_class.full_signature: public abstract void doUnregister(URL url)
focal_class.identifier: doUnregister
focal_class.modifiers: public abstract
focal_class.parameters: (URL url)
focal_class.return: void
focal_class.signature: void doUnregister(URL url)
focal_class.class_method_signature: FailbackRegistry.doSubscribe(URL url, NotifyListener listener)
focal_class.full_signature: public abstract void doSubscribe(URL url, NotifyListener listener)
focal_class.identifier: doSubscribe
focal_class.modifiers: public abstract
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void doSubscribe(URL url, NotifyListener listener)
focal_class.class_method_signature: FailbackRegistry.doUnsubscribe(URL url, NotifyListener listener)
focal_class.full_signature: public abstract void doUnsubscribe(URL url, NotifyListener listener)
focal_class.identifier: doUnsubscribe
focal_class.modifiers: public abstract
focal_class.parameters: (URL url, NotifyListener listener)
focal_class.return: void
focal_class.signature: void doUnsubscribe(URL url, NotifyListener listener)
focal_class.superclass: extends AbstractRegistry
focal_method.body: @Override
      protected void recover() throws Exception {
          // register
          Set<URL> recoverRegistered = new HashSet<URL>(getRegistered());
          if (!recoverRegistered.isEmpty()) {
              if (logger.isInfoEnabled()) {
                  logger.info("Recover register url " + recoverRegistered);
              }
              for (URL url : recoverRegistered) {
                  addFailedRegistered(url);
              }
          }
          // subscribe
          Map<URL, Set<NotifyListener>> recoverSubscribed = new HashMap<URL, Set<NotifyListener>>(getSubscribed());
          if (!recoverSubscribed.isEmpty()) {
              if (logger.isInfoEnabled()) {
                  logger.info("Recover subscribe url " + recoverSubscribed.keySet());
              }
              for (Map.Entry<URL, Set<NotifyListener>> entry : recoverSubscribed.entrySet()) {
                  URL url = entry.getKey();
                  for (NotifyListener listener : entry.getValue()) {
                      addFailedSubscribed(url, listener);
                  }
              }
          }
      }
focal_method.class_method_signature: FailbackRegistry.recover()
focal_method.full_signature: @Override protected void recover()
focal_method.identifier: recover
focal_method.invocations: getRegistered isEmpty isInfoEnabled info addFailedRegistered getSubscribed isEmpty isInfoEnabled info keySet entrySet getKey getValue addFailedSubscribed
focal_method.modifiers: @Override protected
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void recover()