Removed blocking call
Motivation
Explain here the context, and why you're making that change. What is the problem you're trying to solve.
Modifications
Describe the modifications you've done.
@@ -34,12 +34,14 @@ import net.jodah.typetools.TypeResolver;
import org.apache.bookkeeper.api.StorageClient;
import org.apache.bookkeeper.api.kv.Table;
import org.apache.bookkeeper.clients.StorageClientBuilder;
+import org.apache.bookkeeper.clients.admin.SimpleStorageAdminClientImpl;
import org.apache.bookkeeper.clients.admin.StorageAdminClient;
import org.apache.bookkeeper.clients.config.StorageClientSettings;
import org.apache.bookkeeper.clients.exceptions.ClientException;
import org.apache.bookkeeper.clients.exceptions.InternalServerException;
import org.apache.bookkeeper.clients.exceptions.NamespaceNotFoundException;
import org.apache.bookkeeper.clients.exceptions.StreamNotFoundException;
+import org.apache.bookkeeper.clients.utils.ClientResources;
import org.apache.bookkeeper.common.util.Backoff.Jitter;
import org.apache.bookkeeper.common.util.Backoff.Jitter.Type;
import org.apache.bookkeeper.stream.proto.NamespaceConfiguration;
@@ -331,9 +333,9 @@ public class JavaInstanceRunnable implements AutoCloseable, Runnable {
}
private void createStateTable(String tableNs, String tableName, StorageClientSettings settings) throws Exception {
- try (StorageAdminClient storageAdminClient = StorageClientBuilder.newBuilder()
- .withSettings(settings)
- .buildAdmin()) {
+ try (StorageAdminClient storageAdminClient = new SimpleStorageAdminClientImpl(
+ StorageClientSettings.newBuilder().serviceUri(stateStorageServiceUrl).build(),
+ ClientResources.create().scheduler())){
StreamConfiguration streamConf = StreamConfiguration.newBuilder(DEFAULT_STREAM_CONF)
.setInitialNumRanges(4)
.setMinNumRanges(4)
