@Override
    public void close() throws Exception {
        try {
            this.servers.stream().filter(Objects::nonNull).forEach(BookieServer::shutdown);
            if (this.zkServer.get() != null) {
                this.zkServer.get().close();
            }
        } finally {
            cleanupDirectories();
        }

        Thread c = this.cleanup.getAndSet(null);
        if (c != null) {
            Runtime.getRuntime().removeShutdownHook(c);
        }
    }
@ Override public void close ( ) throws Exception { try { this . servers . stream ( ) . filter ( Objects :: nonNull ) . forEach ( BookieServer :: shutdown ) ; if ( this . zkServer . get ( ) != null ) { this . zkServer . get ( ) . close ( ) ; } } finally { cleanupDirectories ( ) ; } Thread c = this . cleanup . getAndSet ( null ) ; if ( c != null ) { Runtime . getRuntime ( ) . removeShutdownHook ( c ) ; } }
region AutoCloseable Implementation