Class BookKeeperBuilderImpl
- java.lang.Object
-
- org.apache.bookkeeper.client.impl.BookKeeperBuilderImpl
-
- All Implemented Interfaces:
BookKeeperBuilder
public class BookKeeperBuilderImpl extends java.lang.Object implements BookKeeperBuilder
Internal builder forBookKeeperclient.- Since:
- 4.6
-
-
Constructor Summary
Constructors Constructor Description BookKeeperBuilderImpl(ClientConfiguration conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BookKeeperBuilderallocator(io.netty.buffer.ByteBufAllocator allocator)Configure the bookkeeper client with a providedByteBufAllocator.BookKeeperbuild()Start and initialize a new BookKeeper client.BookKeeperBuilderdnsResolver(DNSToSwitchMapping dnsResolver)Configure the bookkeeper client to use the provided dns resolverDNSToSwitchMapping.BookKeeperBuildereventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)Configure the bookkeeper client with a provided Netty EventLoopGroup.BookKeeperBuilderfeatureProvider(FeatureProvider featureProvider)Configure the bookkeeper client to use a providedFeatureProvider.BookKeeperBuilderrequestTimer(io.netty.util.HashedWheelTimer requeestTimer)Configure the bookkeeper client to use a provided Netty HashedWheelTimer.BookKeeperBuilderstatsLogger(StatsLogger statsLogger)Configure the bookkeeper client with a providedStatsLogger.
-
-
-
Constructor Detail
-
BookKeeperBuilderImpl
public BookKeeperBuilderImpl(ClientConfiguration conf)
-
-
Method Detail
-
eventLoopGroup
public BookKeeperBuilder eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Description copied from interface:BookKeeperBuilderConfigure the bookkeeper client with a provided Netty EventLoopGroup.- Specified by:
eventLoopGroupin interfaceBookKeeperBuilder- Parameters:
eventLoopGroup- an externalEventLoopGroupto use by the bookkeeper client.- Returns:
- client builder.
-
allocator
public BookKeeperBuilder allocator(io.netty.buffer.ByteBufAllocator allocator)
Description copied from interface:BookKeeperBuilderConfigure the bookkeeper client with a providedByteBufAllocator.- Specified by:
allocatorin interfaceBookKeeperBuilder- Parameters:
allocator- an externalByteBufAllocatorto use by the bookkeeper client.- Returns:
- client builder.
-
statsLogger
public BookKeeperBuilder statsLogger(StatsLogger statsLogger)
Description copied from interface:BookKeeperBuilderConfigure the bookkeeper client with a providedStatsLogger.- Specified by:
statsLoggerin interfaceBookKeeperBuilder- Parameters:
statsLogger- anStatsLoggerto use by the bookkeeper client to collect stats generated by the client.- Returns:
- client builder.
-
dnsResolver
public BookKeeperBuilder dnsResolver(DNSToSwitchMapping dnsResolver)
Description copied from interface:BookKeeperBuilderConfigure the bookkeeper client to use the provided dns resolverDNSToSwitchMapping.- Specified by:
dnsResolverin interfaceBookKeeperBuilder- Parameters:
dnsResolver- dns resolver for placement policy to use for resolving network locations.- Returns:
- client builder
-
requestTimer
public BookKeeperBuilder requestTimer(io.netty.util.HashedWheelTimer requeestTimer)
Description copied from interface:BookKeeperBuilderConfigure the bookkeeper client to use a provided Netty HashedWheelTimer.- Specified by:
requestTimerin interfaceBookKeeperBuilder- Parameters:
requeestTimer- request timer for client to manage timer related tasks.- Returns:
- client builder
-
featureProvider
public BookKeeperBuilder featureProvider(FeatureProvider featureProvider)
Description copied from interface:BookKeeperBuilderConfigure the bookkeeper client to use a providedFeatureProvider.- Specified by:
featureProviderin interfaceBookKeeperBuilder- Parameters:
featureProvider- the feature provider- Returns:
- client builder
-
build
public BookKeeper build() throws java.lang.InterruptedException, BKException, java.io.IOException
Description copied from interface:BookKeeperBuilderStart and initialize a new BookKeeper client.- Specified by:
buildin interfaceBookKeeperBuilder- Returns:
- the client
- Throws:
java.lang.InterruptedExceptionBKExceptionjava.io.IOException
-
-