类 LoadBalanceConnectionUrl

    • 构造器详细资料

      • LoadBalanceConnectionUrl

        public LoadBalanceConnectionUrl​(ConnectionUrlParser connStrParser,
                                        Properties info)
        Constructs an instance of LoadBalanceConnectionUrl, performing all the required initializations and validations. A load-balanced connection cannot deal with multiple hosts with same host:port.
        参数:
        connStrParser - a ConnectionUrlParser instance containing the parsed version of the original connection string
        info - the connection arguments map
      • LoadBalanceConnectionUrl

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

      • injectPerTypeProperties

        protected void injectPerTypeProperties​(Map<String,​String> props)
        Injects additional properties into the connection arguments while it's being constructed.
        覆盖:
        injectPerTypeProperties 在类中 ConnectionUrl
        参数:
        props - the properties already containing all known connection arguments
      • getHostInfoListAsHostPortPairs

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

        public List<HostInfo> getHostInfoListFromHostPortPairs​(Collection<String> hostPortPairs)
        Returns the list of HostInfo instances that matches the given collection of host:port pairs. 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