vendor/bundle/jruby/2.3.0/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/transport/base.rb
# Rebuilds the connections collection in the transport.
#
# The methods *adds* new connections from the passed hosts to the collection,
# and *removes* all connections not contained in the passed hosts.
#
# @return [Connections::Collection]
# @api private
#
Rebuilds the connections collection in the transport.
The methods *adds* new connections from the passed hosts to the collection,
and *removes* all connections not contained in the passed hosts.
Rebuilds the connections collection in the transport . The methods * adds * new connections from the passed hosts to the collection and * removes * all connections not contained in the passed hosts .
def __rebuild_connections(arguments={})
          @state_mutex.synchronize do
            @hosts       = arguments[:hosts]    || []
            @options     = arguments[:options]  || {}
            __close_connections
            new_connections = __build_connections
            stale_connections = @connections.all.select  { |c| ! new_connections.include?(c) }
            new_connections = new_connections.reject { |c| @connections.include?(c) }
            @connections.remove(stale_connections)
            @connections.add(new_connections)
            @connections
          end
        end
def __rebuild_connections ( arguments = { } ) @state_mutex . synchronize do @hosts = arguments [ :hosts ] || [ ] @options = arguments [ :options ] || { } __close_connections new_connections = __build_connections stale_connections = @connections . all . select { | c | ! new_connections . include? ( c ) } new_connections = new_connections . reject { | c | @connections . include? ( c ) } @connections . remove ( stale_connections ) @connections . add ( new_connections ) @connections end end
Rebuilds the connections collection in the transport.
Rebuilds the connections collection in the transport .
None
Connections::Collection
arguments
<not_specific>
api
None