类 ReplicationConnectionUrl

    • 构造器详细资料

      • ReplicationConnectionUrl

        public ReplicationConnectionUrl​(ConnectionUrlParser connStrParser,
                                        Properties info)
        Constructs an instance of ReplicationConnectionUrl, performing all the required initializations.
        参数:
        connStrParser - a ConnectionUrlParser instance containing the parsed version of the original connection string
        info - the connection arguments map
      • ReplicationConnectionUrl

        public ReplicationConnectionUrl​(List<HostInfo> masters,
                                        List<HostInfo> slaves,
                                        Map<String,​String> properties)
        Constructs an instance of a ReplicationConnectionUrl based on a list of master hosts, a list of slave hosts and a global set of properties instead of connection string parsing. ConnectionUrl instances created by this process are not cached.
        参数:
        masters - the master hosts list to use in this connection string
        slaves - the slave hosts list to use in this connection string
        properties - the properties common to all hosts
    • 方法详细资料

      • getHostsList

        public List<HostInfo> getHostsList​(HostsListView view)
        Returns a list of the hosts in this connection URL, filtered for the given view.
        覆盖:
        getHostsList 在类中 ConnectionUrl
        参数:
        view - the type of the view to use in the returned list of hosts.
        返回:
        the hosts list from this connection URL, filtered for the given view.
      • getMasterHostOrSpawnIsolated

        public HostInfo getMasterHostOrSpawnIsolated​(String hostPortPair)
        Returns an existing master host info with the same host:port part or spawns a new isolated host info based on this connection URL if none was found.
        参数:
        hostPortPair - the host:port part to search for
        返回:
        the existing host info or a new independent one
      • getMastersListAsHostPortPairs

        public List<String> getMastersListAsHostPortPairs()
        Returns a list of this connection URL master hosts in the form of host:port pairs.
        返回:
        a list of this connection URL master hosts in the form of host:port pairs
      • getMasterHostsListFromHostPortPairs

        public List<HostInfo> getMasterHostsListFromHostPortPairs​(Collection<String> hostPortPairs)
        Returns the list of HostInfo instances that matches the given collection of host:port pairs in the corresponding hosts list. Isolated host info elements are spawned for the missing elements.
        参数:
        hostPortPairs - a list of host:port pairs
        返回:
        a list of HostInfo instances corresponding to the given host:port pairs
      • getSlaveHostOrSpawnIsolated

        public HostInfo getSlaveHostOrSpawnIsolated​(String hostPortPair)
        Returns an existing slave host info with the same host:port part or spawns a new isolated host info based on this connection URL if none was found.
        参数:
        hostPortPair - the host:port part to search for
        返回:
        the existing host info or a new independent one
      • getSlavesListAsHostPortPairs

        public List<String> getSlavesListAsHostPortPairs()
        Returns a list of this connection URL master hosts in the form of host:port pairs.
        返回:
        a list of this connection URL master hosts in the form of host:port pairs
      • getSlaveHostsListFromHostPortPairs

        public List<HostInfo> getSlaveHostsListFromHostPortPairs​(Collection<String> hostPortPairs)
        Returns the list of HostInfo instances that matches the given collection of host:port pairs in the corresponding hosts list. Isolated host info elements are spawned for the missing elements.
        参数:
        hostPortPairs - a list of host:port pairs
        返回:
        a list of HostInfo instances corresponding to the given host:port pairs