Class BookKeeper.Builder

  • Enclosing class:
    BookKeeper

    public static class BookKeeper.Builder
    extends java.lang.Object
    BookKeeper Client Builder to build client instances.
    See Also:
    BookKeeperBuilder
    • Field Detail

      • zk

        org.apache.zookeeper.ZooKeeper zk
      • eventLoopGroup

        io.netty.channel.EventLoopGroup eventLoopGroup
      • allocator

        io.netty.buffer.ByteBufAllocator allocator
      • requestTimer

        io.netty.util.HashedWheelTimer requestTimer
    • Method Detail

      • setZookeeper

        @Deprecated
        public BookKeeper.Builder setZookeeper​(org.apache.zookeeper.ZooKeeper zk)
        Deprecated.
        since 4.5, use zk(ZooKeeper)
        Configure the bookkeeper client with a provided ZooKeeper client.
        Parameters:
        zk - an external ZooKeeper client to use by the bookkeeper client.
        Returns:
        client builder.
        See Also:
        zk(ZooKeeper)
      • eventLoopGroup

        public BookKeeper.Builder eventLoopGroup​(io.netty.channel.EventLoopGroup f)
        Configure the bookkeeper client with a provided EventLoopGroup.
        Parameters:
        f - an external EventLoopGroup to use by the bookkeeper client.
        Returns:
        client builder.
        Since:
        4.5
      • allocator

        public BookKeeper.Builder allocator​(io.netty.buffer.ByteBufAllocator allocator)
        Configure the bookkeeper client with a provided ByteBufAllocator.
        Parameters:
        allocator - an external ByteBufAllocator to use by the bookkeeper client.
        Returns:
        client builder.
        Since:
        4.9
      • zk

        @Deprecated
        public BookKeeper.Builder zk​(org.apache.zookeeper.ZooKeeper zk)
        Deprecated.
        Configure the bookkeeper client with a provided ZooKeeper client.
        Parameters:
        zk - an external ZooKeeper client to use by the bookkeeper client.
        Returns:
        client builder.
        Since:
        4.5
      • statsLogger

        public BookKeeper.Builder statsLogger​(StatsLogger statsLogger)
        Configure the bookkeeper client with a provided StatsLogger.
        Parameters:
        statsLogger - an StatsLogger to use by the bookkeeper client to collect stats generated by the client.
        Returns:
        client builder.
        Since:
        4.5
      • dnsResolver

        public BookKeeper.Builder dnsResolver​(DNSToSwitchMapping dnsResolver)
        Configure the bookkeeper client to use the provided dns resolver DNSToSwitchMapping.
        Parameters:
        dnsResolver - dns resolver for placement policy to use for resolving network locations.
        Returns:
        client builder
        Since:
        4.5
      • requestTimer

        public BookKeeper.Builder requestTimer​(io.netty.util.HashedWheelTimer requestTimer)
        Configure the bookkeeper client to use a provided HashedWheelTimer.
        Parameters:
        requestTimer - request timer for client to manage timer related tasks.
        Returns:
        client builder
        Since:
        4.5
      • build

        public BookKeeper build()
                         throws java.io.IOException,
                                java.lang.InterruptedException,
                                BKException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
        BKException