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 forBookKeeper
client.- Since:
- 4.6
-
-
Constructor Summary
Constructors Constructor Description BookKeeperBuilderImpl(ClientConfiguration conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BookKeeperBuilder
allocator(io.netty.buffer.ByteBufAllocator allocator)
Configure the bookkeeper client with a providedByteBufAllocator
.BookKeeper
build()
Start and initialize a new BookKeeper client.BookKeeperBuilder
dnsResolver(DNSToSwitchMapping dnsResolver)
Configure the bookkeeper client to use the provided dns resolverDNSToSwitchMapping
.BookKeeperBuilder
eventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
Configure the bookkeeper client with a provided Netty EventLoopGroup.BookKeeperBuilder
featureProvider(FeatureProvider featureProvider)
Configure the bookkeeper client to use a providedFeatureProvider
.BookKeeperBuilder
requestTimer(io.netty.util.HashedWheelTimer requeestTimer)
Configure the bookkeeper client to use a provided Netty HashedWheelTimer.BookKeeperBuilder
statsLogger(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:BookKeeperBuilder
Configure the bookkeeper client with a provided Netty EventLoopGroup.- Specified by:
eventLoopGroup
in interfaceBookKeeperBuilder
- Parameters:
eventLoopGroup
- an externalEventLoopGroup
to use by the bookkeeper client.- Returns:
- client builder.
-
allocator
public BookKeeperBuilder allocator(io.netty.buffer.ByteBufAllocator allocator)
Description copied from interface:BookKeeperBuilder
Configure the bookkeeper client with a providedByteBufAllocator
.- Specified by:
allocator
in interfaceBookKeeperBuilder
- Parameters:
allocator
- an externalByteBufAllocator
to use by the bookkeeper client.- Returns:
- client builder.
-
statsLogger
public BookKeeperBuilder statsLogger(StatsLogger statsLogger)
Description copied from interface:BookKeeperBuilder
Configure the bookkeeper client with a providedStatsLogger
.- Specified by:
statsLogger
in interfaceBookKeeperBuilder
- Parameters:
statsLogger
- anStatsLogger
to 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:BookKeeperBuilder
Configure the bookkeeper client to use the provided dns resolverDNSToSwitchMapping
.- Specified by:
dnsResolver
in 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:BookKeeperBuilder
Configure the bookkeeper client to use a provided Netty HashedWheelTimer.- Specified by:
requestTimer
in 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:BookKeeperBuilder
Configure the bookkeeper client to use a providedFeatureProvider
.- Specified by:
featureProvider
in 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:BookKeeperBuilder
Start and initialize a new BookKeeper client.- Specified by:
build
in interfaceBookKeeperBuilder
- Returns:
- the client
- Throws:
java.lang.InterruptedException
BKException
java.io.IOException
-
-