Package org.apache.bookkeeper.proto
Class BookieServer
java.lang.Object
org.apache.bookkeeper.proto.BookieServer
Implements the server-side part of the BookKeeper protocol.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ServerConfiguration(package private) org.apache.bookkeeper.proto.BookieServer.DeathWatcher(package private) int(package private) BookieNettyServer(package private) UncleanShutdownDetection -
Constructor Summary
ConstructorsConstructorDescriptionBookieServer(ServerConfiguration conf, Bookie bookie, StatsLogger statsLogger, io.netty.buffer.ByteBufAllocator allocator, UncleanShutdownDetection uncleanShutdownDetection) -
Method Summary
Modifier and TypeMethodDescriptionintbooleanWhether bookie is running?booleanvoidjoin()static voidLegacy Method to run bookie server.static BookieServernewBookieServer(ServerConfiguration conf, Bookie bookie, StatsLogger statsLogger, io.netty.buffer.ByteBufAllocator allocator, UncleanShutdownDetection uncleanShutdownDetection) voidResume processing requests in the bookie (for testing).voidsetExceptionHandler(Thread.UncaughtExceptionHandler exceptionHandler) Currently the uncaught exception handler is used for DeathWatcher to notify lifecycle management that a bookie is dead for some reasons.voidshutdown()voidstart()voidSuspend processing of requests in the bookie (for testing).toString()
-
Field Details
-
conf
-
nettyServer
BookieNettyServer nettyServer -
deathWatcher
org.apache.bookkeeper.proto.BookieServer.DeathWatcher deathWatcher -
uncleanShutdownDetection
UncleanShutdownDetection uncleanShutdownDetection -
exitCode
int exitCode
-
-
Constructor Details
-
BookieServer
public BookieServer(ServerConfiguration conf, Bookie bookie, StatsLogger statsLogger, io.netty.buffer.ByteBufAllocator allocator, UncleanShutdownDetection uncleanShutdownDetection) throws IOException, org.apache.zookeeper.KeeperException, InterruptedException, BookieException, ReplicationException.UnavailableException, ReplicationException.CompatibilityException, SecurityException - Throws:
IOExceptionorg.apache.zookeeper.KeeperExceptionInterruptedExceptionBookieExceptionReplicationException.UnavailableExceptionReplicationException.CompatibilityExceptionSecurityException
-
-
Method Details
-
newBookieServer
public static BookieServer newBookieServer(ServerConfiguration conf, Bookie bookie, StatsLogger statsLogger, io.netty.buffer.ByteBufAllocator allocator, UncleanShutdownDetection uncleanShutdownDetection) throws ReplicationException.CompatibilityException, ReplicationException.UnavailableException, SecurityException, IOException, InterruptedException, org.apache.zookeeper.KeeperException, BookieException - Throws:
ReplicationException.CompatibilityExceptionReplicationException.UnavailableExceptionSecurityExceptionIOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperExceptionBookieException
-
setExceptionHandler
Currently the uncaught exception handler is used for DeathWatcher to notify lifecycle management that a bookie is dead for some reasons.in future, we can register this exceptionHandler to critical threads so when those threads are dead, it will automatically trigger lifecycle management to shutdown the process.
-
start
- Throws:
InterruptedExceptionIOException
-
getLocalAddress
- Throws:
UnknownHostException
-
getBookieId
- Throws:
UnknownHostException
-
getBookie
-
getBookieRequestProcessor
-
suspendProcessing
public void suspendProcessing()Suspend processing of requests in the bookie (for testing). -
resumeProcessing
public void resumeProcessing()Resume processing requests in the bookie (for testing). -
shutdown
public void shutdown() -
isRunning
public boolean isRunning() -
isBookieRunning
public boolean isBookieRunning()Whether bookie is running?- Returns:
- true if bookie is running, otherwise return false
-
join
- Throws:
InterruptedException
-
getExitCode
public int getExitCode() -
main
Legacy Method to run bookie server. -
toString
-