Package org.apache.bookkeeper.client
Class BookKeeper.Builder
- java.lang.Object
-
- org.apache.bookkeeper.client.BookKeeper.Builder
-
- Enclosing class:
- BookKeeper
public static class BookKeeper.Builder extends java.lang.ObjectBookKeeper Client Builder to build client instances.- See Also:
BookKeeperBuilder
-
-
Field Summary
Fields Modifier and Type Field Description (package private) io.netty.buffer.ByteBufAllocatorallocator(package private) ClientConfigurationconf(package private) DNSToSwitchMappingdnsResolver(package private) io.netty.channel.EventLoopGroupeventLoopGroup(package private) FeatureProviderfeatureProvider(package private) io.netty.util.HashedWheelTimerrequestTimer(package private) StatsLoggerstatsLogger(package private) org.apache.zookeeper.ZooKeeperzk
-
Constructor Summary
Constructors Constructor Description Builder(ClientConfiguration conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BookKeeper.Builderallocator(io.netty.buffer.ByteBufAllocator allocator)Configure the bookkeeper client with a providedByteBufAllocator.BookKeeperbuild()BookKeeper.BuilderdnsResolver(DNSToSwitchMapping dnsResolver)Configure the bookkeeper client to use the provided dns resolverDNSToSwitchMapping.BookKeeper.BuildereventLoopGroup(io.netty.channel.EventLoopGroup f)Configure the bookkeeper client with a providedEventLoopGroup.BookKeeper.BuilderfeatureProvider(FeatureProvider featureProvider)Feature Provider.BookKeeper.BuilderrequestTimer(io.netty.util.HashedWheelTimer requestTimer)Configure the bookkeeper client to use a providedHashedWheelTimer.BookKeeper.BuildersetEventLoopGroup(io.netty.channel.EventLoopGroup f)Deprecated.since 4.5, useeventLoopGroup(EventLoopGroup)BookKeeper.BuildersetStatsLogger(StatsLogger statsLogger)Deprecated.since 4.5, usestatsLogger(StatsLogger)BookKeeper.BuildersetZookeeper(org.apache.zookeeper.ZooKeeper zk)Deprecated.since 4.5, usezk(ZooKeeper)BookKeeper.BuilderstatsLogger(StatsLogger statsLogger)Configure the bookkeeper client with a providedStatsLogger.BookKeeper.Builderzk(org.apache.zookeeper.ZooKeeper zk)Deprecated.
-
-
-
Field Detail
-
conf
final ClientConfiguration conf
-
zk
org.apache.zookeeper.ZooKeeper zk
-
eventLoopGroup
io.netty.channel.EventLoopGroup eventLoopGroup
-
allocator
io.netty.buffer.ByteBufAllocator allocator
-
statsLogger
StatsLogger statsLogger
-
dnsResolver
DNSToSwitchMapping dnsResolver
-
requestTimer
io.netty.util.HashedWheelTimer requestTimer
-
featureProvider
FeatureProvider featureProvider
-
-
Constructor Detail
-
Builder
Builder(ClientConfiguration conf)
-
-
Method Detail
-
setEventLoopGroup
@Deprecated public BookKeeper.Builder setEventLoopGroup(io.netty.channel.EventLoopGroup f)
Deprecated.since 4.5, useeventLoopGroup(EventLoopGroup)Configure the bookkeeper client with a providedEventLoopGroup.- Parameters:
f- an externalEventLoopGroupto use by the bookkeeper client.- Returns:
- client builder.
- See Also:
eventLoopGroup(EventLoopGroup)
-
setZookeeper
@Deprecated public BookKeeper.Builder setZookeeper(org.apache.zookeeper.ZooKeeper zk)
Deprecated.since 4.5, usezk(ZooKeeper)Configure the bookkeeper client with a providedZooKeeperclient.- Parameters:
zk- an externalZooKeeperclient to use by the bookkeeper client.- Returns:
- client builder.
- See Also:
zk(ZooKeeper)
-
setStatsLogger
@Deprecated public BookKeeper.Builder setStatsLogger(StatsLogger statsLogger)
Deprecated.since 4.5, usestatsLogger(StatsLogger)Configure the bookkeeper client with a providedStatsLogger.- Parameters:
statsLogger- anStatsLoggerto use by the bookkeeper client to collect stats generated by the client.- Returns:
- client builder.
- See Also:
statsLogger(StatsLogger)
-
eventLoopGroup
public BookKeeper.Builder eventLoopGroup(io.netty.channel.EventLoopGroup f)
Configure the bookkeeper client with a providedEventLoopGroup.- Parameters:
f- an externalEventLoopGroupto 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 providedByteBufAllocator.- Parameters:
allocator- an externalByteBufAllocatorto 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 providedZooKeeperclient.- Parameters:
zk- an externalZooKeeperclient 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 providedStatsLogger.- Parameters:
statsLogger- anStatsLoggerto 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 resolverDNSToSwitchMapping.- 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 providedHashedWheelTimer.- Parameters:
requestTimer- request timer for client to manage timer related tasks.- Returns:
- client builder
- Since:
- 4.5
-
featureProvider
public BookKeeper.Builder featureProvider(FeatureProvider featureProvider)
Feature Provider.- Parameters:
featureProvider-- Returns:
-
build
public BookKeeper build() throws java.io.IOException, java.lang.InterruptedException, BKException
- Throws:
java.io.IOExceptionjava.lang.InterruptedExceptionBKException
-
-