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.Object
BookKeeper Client Builder to build client instances.- See Also:
BookKeeperBuilder
-
-
Field Summary
Fields Modifier and Type Field Description (package private) io.netty.buffer.ByteBufAllocator
allocator
(package private) ClientConfiguration
conf
(package private) DNSToSwitchMapping
dnsResolver
(package private) io.netty.channel.EventLoopGroup
eventLoopGroup
(package private) FeatureProvider
featureProvider
(package private) io.netty.util.HashedWheelTimer
requestTimer
(package private) StatsLogger
statsLogger
(package private) org.apache.zookeeper.ZooKeeper
zk
-
Constructor Summary
Constructors Constructor Description Builder(ClientConfiguration conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BookKeeper.Builder
allocator(io.netty.buffer.ByteBufAllocator allocator)
Configure the bookkeeper client with a providedByteBufAllocator
.BookKeeper
build()
BookKeeper.Builder
dnsResolver(DNSToSwitchMapping dnsResolver)
Configure the bookkeeper client to use the provided dns resolverDNSToSwitchMapping
.BookKeeper.Builder
eventLoopGroup(io.netty.channel.EventLoopGroup f)
Configure the bookkeeper client with a providedEventLoopGroup
.BookKeeper.Builder
featureProvider(FeatureProvider featureProvider)
Feature Provider.BookKeeper.Builder
requestTimer(io.netty.util.HashedWheelTimer requestTimer)
Configure the bookkeeper client to use a providedHashedWheelTimer
.BookKeeper.Builder
setEventLoopGroup(io.netty.channel.EventLoopGroup f)
Deprecated.since 4.5, useeventLoopGroup(EventLoopGroup)
BookKeeper.Builder
setStatsLogger(StatsLogger statsLogger)
Deprecated.since 4.5, usestatsLogger(StatsLogger)
BookKeeper.Builder
setZookeeper(org.apache.zookeeper.ZooKeeper zk)
Deprecated.since 4.5, usezk(ZooKeeper)
BookKeeper.Builder
statsLogger(StatsLogger statsLogger)
Configure the bookkeeper client with a providedStatsLogger
.BookKeeper.Builder
zk(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 externalEventLoopGroup
to 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 providedZooKeeper
client.- Parameters:
zk
- an externalZooKeeper
client 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
- anStatsLogger
to 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 externalEventLoopGroup
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 providedByteBufAllocator
.- Parameters:
allocator
- an externalByteBufAllocator
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 providedZooKeeper
client.- Parameters:
zk
- an externalZooKeeper
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 providedStatsLogger
.- Parameters:
statsLogger
- anStatsLogger
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 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.IOException
java.lang.InterruptedException
BKException
-
-