Interface ChannelPool

    • Method Detail

      • offer

        boolean offer​(io.netty.channel.Channel channel,
                      Object partitionKey)
        Add a channel to the pool
        Parameters:
        channel - an I/O channel
        partitionKey - a key used to retrieve the cached channel
        Returns:
        true if added.
      • poll

        @Nullable
        @Nullable io.netty.channel.Channel poll​(Object partitionKey)
        Remove the channel associated with the uri.
        Parameters:
        partitionKey - the partition used when invoking offer
        Returns:
        the channel associated with the uri
      • removeAll

        boolean removeAll​(io.netty.channel.Channel channel)
        Remove all channels from the cache. A channel might have been associated with several uri.
        Parameters:
        channel - a channel
        Returns:
        the true if the channel has been removed
      • isOpen

        boolean isOpen()
        Return true if a channel can be cached. An implementation can decide based on some rules to allow caching Calling this method is equivalent of checking the returned value of offer(Channel, Object)
        Returns:
        true if a channel can be cached.
      • destroy

        void destroy()
        Destroy all channels that has been cached by this instance.
      • flushPartitions

        void flushPartitions​(Predicate<Object> predicate)
        Flush partitions based on a predicate
        Parameters:
        predicate - the predicate
      • getIdleChannelCountPerHost

        Map<String,​Long> getIdleChannelCountPerHost()
        Returns:
        The number of idle channels per host.