public class BookKeeperAdmin extends Object
Constructor and Description |
---|
BookKeeperAdmin(ClientConfiguration conf)
Constructor that takes in a configuration object so we know
how to connect to ZooKeeper to retrieve information about the BookKeeper
cluster.
|
BookKeeperAdmin(String zkServers)
Constructor that takes in a ZooKeeper servers connect string so we know
how to connect to ZooKeeper to retrieve information about the BookKeeper
cluster.
|
Modifier and Type | Method and Description |
---|---|
void |
asyncRecoverBookieData(InetSocketAddress bookieSrc,
InetSocketAddress bookieDest,
AsyncCallback.RecoverCallback cb,
Object context)
Async method to rebuild and recover the ledger fragments data that was
stored on the source bookie.
|
void |
close()
Gracefully release resources that this client uses.
|
void |
recoverBookieData(InetSocketAddress bookieSrc,
InetSocketAddress bookieDest)
Synchronous method to rebuild and recover the ledger fragments data that
was stored on the source bookie.
|
public BookKeeperAdmin(String zkServers) throws IOException, InterruptedException, org.apache.zookeeper.KeeperException
zkServers
- Comma separated list of hostname:port pairs for the ZooKeeper
servers cluster.IOException
- throws this exception if there is an error instantiating the
ZooKeeper client.InterruptedException
- Throws this exception if there is an error instantiating the
BookKeeper client.org.apache.zookeeper.KeeperException
- Throws this exception if there is an error instantiating the
BookKeeper client.public BookKeeperAdmin(ClientConfiguration conf) throws IOException, InterruptedException, org.apache.zookeeper.KeeperException
conf
- Client Configuration ObjectIOException
- throws this exception if there is an error instantiating the
ZooKeeper client.InterruptedException
- Throws this exception if there is an error instantiating the
BookKeeper client.org.apache.zookeeper.KeeperException
- Throws this exception if there is an error instantiating the
BookKeeper client.public void close() throws InterruptedException, BKException
InterruptedException
- if there is an error shutting down the clients that this
class uses.BKException
public void recoverBookieData(InetSocketAddress bookieSrc, InetSocketAddress bookieDest) throws InterruptedException, BKException
bookieSrc
- Source bookie that had a failure. We want to replicate the
ledger fragments that were stored there.bookieDest
- Optional destination bookie that if passed, we will copy all
of the ledger fragments from the source bookie over to it.InterruptedException
BKException
public void asyncRecoverBookieData(InetSocketAddress bookieSrc, InetSocketAddress bookieDest, AsyncCallback.RecoverCallback cb, Object context)
bookieSrc
- Source bookie that had a failure. We want to replicate the
ledger fragments that were stored there.bookieDest
- Optional destination bookie that if passed, we will copy all
of the ledger fragments from the source bookie over to it.cb
- RecoverCallback to invoke once all of the data on the dead
bookie has been recovered and replicated.context
- Context for the RecoverCallback to call.Copyright © 2014 The Apache Software Foundation. All Rights Reserved.