test_class.declarator: zkServer
test_class.modifier: private
test_class.original_string: private TestingServer zkServer;
test_class.type: TestingServer
test_class.var_name: zkServer
test_class.declarator: zookeeperClient
test_class.modifier: private
test_class.original_string: private ZookeeperClient zookeeperClient;
test_class.type: ZookeeperClient
test_class.var_name: zookeeperClient
test_class.declarator: abstractZookeeperTransporter
test_class.modifier: private
test_class.original_string: private AbstractZookeeperTransporter abstractZookeeperTransporter;
test_class.type: AbstractZookeeperTransporter
test_class.var_name: abstractZookeeperTransporter
test_class.declarator: zkServerPort
test_class.modifier: private
test_class.original_string: private int zkServerPort;
test_class.type: int
test_class.var_name: zkServerPort
test_class.file: dubbo-remoting/dubbo-remoting-zookeeper/src/test/java/org/apache/dubbo/remoting/zookeeper/support/AbstractZookeeperTransporterTest.java
test_class.identifier: AbstractZookeeperTransporterTest
test_case.body: @Test
      public void testGetURLBackupAddress() {
          URL url = URL.valueOf("zookeeper://127.0.0.1:" + zkServerPort + "/org.apache.dubbo.registry.RegistryService?backup=127.0.0.1:" + 9099 + "&application=metadatareport-local-xml-provider2&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=47418&specVersion=2.7.0-SNAPSHOT&timestamp=1547102428828");
          List<String> stringList = abstractZookeeperTransporter.getURLBackupAddress(url);
          Assertions.assertEquals(stringList.size(), 2);
          Assertions.assertEquals(stringList.get(0), "127.0.0.1:" + zkServerPort);
          Assertions.assertEquals(stringList.get(1), "127.0.0.1:9099");
      }
test_case.class_method_signature: AbstractZookeeperTransporterTest.testGetURLBackupAddress()
test_case.full_signature: @Test public void testGetURLBackupAddress()
test_case.identifier: testGetURLBackupAddress
test_case.invocations: valueOf getURLBackupAddress assertEquals size assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetURLBackupAddress()
focal_class.declarator: logger = LoggerFactory.getLogger(ZookeeperTransporter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ZookeeperTransporter.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: zookeeperClientMap = new ConcurrentHashMap<>()
focal_class.modifier: private final
focal_class.original_string: private final Map<String, ZookeeperClient> zookeeperClientMap = new ConcurrentHashMap<>();
focal_class.type: Map<String, ZookeeperClient>
focal_class.var_name: zookeeperClientMap
focal_class.file: dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/org/apache/dubbo/remoting/zookeeper/support/AbstractZookeeperTransporter.java
focal_class.identifier: AbstractZookeeperTransporter
focal_class.interfaces: implements ZookeeperTransporter
focal_class.class_method_signature: AbstractZookeeperTransporter.connect(URL url)
focal_class.full_signature: @Override public ZookeeperClient connect(URL url)
focal_class.identifier: connect
focal_class.modifiers: @Override public
focal_class.parameters: (URL url)
focal_class.return: ZookeeperClient
focal_class.signature: ZookeeperClient connect(URL url)
focal_class.class_method_signature: AbstractZookeeperTransporter.createZookeeperClient(URL url)
focal_class.full_signature: protected abstract ZookeeperClient createZookeeperClient(URL url)
focal_class.identifier: createZookeeperClient
focal_class.modifiers: protected abstract
focal_class.parameters: (URL url)
focal_class.return: ZookeeperClient
focal_class.signature: ZookeeperClient createZookeeperClient(URL url)
focal_class.class_method_signature: AbstractZookeeperTransporter.fetchAndUpdateZookeeperClientCache(List<String> addressList)
focal_class.full_signature:  ZookeeperClient fetchAndUpdateZookeeperClientCache(List<String> addressList)
focal_class.identifier: fetchAndUpdateZookeeperClientCache
focal_class.parameters: (List<String> addressList)
focal_class.return: ZookeeperClient
focal_class.signature: ZookeeperClient fetchAndUpdateZookeeperClientCache(List<String> addressList)
focal_class.class_method_signature: AbstractZookeeperTransporter.getURLBackupAddress(URL url)
focal_class.full_signature:  List<String> getURLBackupAddress(URL url)
focal_class.identifier: getURLBackupAddress
focal_class.parameters: (URL url)
focal_class.return: List<String>
focal_class.signature: List<String> getURLBackupAddress(URL url)
focal_class.class_method_signature: AbstractZookeeperTransporter.writeToClientMap(List<String> addressList, ZookeeperClient zookeeperClient)
focal_class.full_signature:  void writeToClientMap(List<String> addressList, ZookeeperClient zookeeperClient)
focal_class.identifier: writeToClientMap
focal_class.parameters: (List<String> addressList, ZookeeperClient zookeeperClient)
focal_class.return: void
focal_class.signature: void writeToClientMap(List<String> addressList, ZookeeperClient zookeeperClient)
focal_class.class_method_signature: AbstractZookeeperTransporter.toClientURL(URL url)
focal_class.full_signature:  URL toClientURL(URL url)
focal_class.identifier: toClientURL
focal_class.parameters: (URL url)
focal_class.return: URL
focal_class.signature: URL toClientURL(URL url)
focal_class.class_method_signature: AbstractZookeeperTransporter.getZookeeperClientMap()
focal_class.full_signature:  Map<String, ZookeeperClient> getZookeeperClientMap()
focal_class.identifier: getZookeeperClientMap
focal_class.parameters: ()
focal_class.return: Map<String, ZookeeperClient>
focal_class.signature: Map<String, ZookeeperClient> getZookeeperClientMap()
focal_method.body: List<String> getURLBackupAddress(URL url) {
          List<String> addressList = new ArrayList<String>();
          addressList.add(url.getAddress());
          addressList.addAll(url.getParameter(RemotingConstants.BACKUP_KEY, Collections.EMPTY_LIST));
  
          String authPrefix = null;
          if (StringUtils.isNotEmpty(url.getUsername())) {
              StringBuilder buf = new StringBuilder();
              buf.append(url.getUsername());
              if (StringUtils.isNotEmpty(url.getPassword())) {
                  buf.append(":");
                  buf.append(url.getPassword());
              }
              buf.append("@");
              authPrefix = buf.toString();
          }
  
          if (StringUtils.isNotEmpty(authPrefix)) {
              List<String> authedAddressList = new ArrayList<>(addressList.size());
              for (String addr : addressList) {
                  authedAddressList.add(authPrefix + addr);
              }
              return authedAddressList;
          }
  
  
          return addressList;
      }
focal_method.class_method_signature: AbstractZookeeperTransporter.getURLBackupAddress(URL url)
focal_method.full_signature:  List<String> getURLBackupAddress(URL url)
focal_method.identifier: getURLBackupAddress
focal_method.invocations: add getAddress addAll getParameter isNotEmpty getUsername append getUsername isNotEmpty getPassword append append getPassword append toString isNotEmpty size add
focal_method.parameters: (URL url)
focal_method.return: List<String>
focal_method.signature: List<String> getURLBackupAddress(URL url)