use of org.apache.bookkeeper.clients.config.StorageClientSettings in project bookkeeper by apache.
the class TestLocationClientImpl method doSetup.
@Override
protected void doSetup() throws Exception {
StorageClientSettings settings = StorageClientSettings.newBuilder().managedChannelBuilder(InProcessChannelBuilder.forName(serverName).directExecutor()).usePlaintext(true).build();
locationClient = new LocationClientImpl(settings, scheduler);
locationServiceDefinition = locationService.bindService();
serviceRegistry.addService(locationServiceDefinition);
}
use of org.apache.bookkeeper.clients.config.StorageClientSettings in project bookkeeper by apache.
the class StreamCluster method createDefaultNamespaces.
private void createDefaultNamespaces() throws Exception {
StorageClientSettings settings = StorageClientSettings.newBuilder().addEndpoints(getRpcEndpoints().toArray(new Endpoint[getRpcEndpoints().size()])).usePlaintext(true).build();
log.info("RpcEndpoints are : {}", settings.endpoints());
String namespaceName = "default";
try (StorageAdminClient admin = StorageClientBuilder.newBuilder().withSettings(settings).buildAdmin()) {
System.out.println("Creating namespace '" + namespaceName + "' ...");
try {
NamespaceProperties nsProps = result(admin.createNamespace(namespaceName, NamespaceConfiguration.newBuilder().setDefaultStreamConf(DEFAULT_STREAM_CONF).build()));
System.out.println("Successfully created namespace '" + namespaceName + "':");
System.out.println(nsProps);
} catch (NamespaceExistsException nee) {
System.out.println("Namespace '" + namespaceName + "' already exists.");
}
}
}
use of org.apache.bookkeeper.clients.config.StorageClientSettings in project bookkeeper by apache.
the class StorageAdminClientTest method doSetup.
@Override
protected void doSetup() throws Exception {
scheduler = OrderedScheduler.newSchedulerBuilder().name("admin-client-test").numThreads(1).build();
StorageClientSettings settings = StorageClientSettings.newBuilder().addEndpoints(cluster.getRpcEndpoints().toArray(new Endpoint[cluster.getRpcEndpoints().size()])).usePlaintext(true).build();
adminClient = StorageClientBuilder.newBuilder().withSettings(settings).buildAdmin();
defaultBackendUri = URI.create("distributedlog://" + cluster.getZkServers() + "/stream/storage");
}
use of org.apache.bookkeeper.clients.config.StorageClientSettings in project bookkeeper by apache.
the class LocationClientTest method doSetup.
@Override
protected void doSetup() throws Exception {
scheduler = OrderedScheduler.newSchedulerBuilder().name("location-client-test").numThreads(1).build();
StorageClientSettings settings = StorageClientSettings.newBuilder().addEndpoints(cluster.getRpcEndpoints().toArray(new Endpoint[cluster.getRpcEndpoints().size()])).usePlaintext(true).build();
client = new LocationClientImpl(settings, scheduler);
}
use of org.apache.bookkeeper.clients.config.StorageClientSettings in project bookkeeper by apache.
the class StorageClientTest method doSetup.
@Override
protected void doSetup() throws Exception {
defaultBackendUri = URI.create("distributedlog://" + cluster.getZkServers() + "/stream/storage");
StorageClientSettings settings = StorageClientSettings.newBuilder().addEndpoints(cluster.getRpcEndpoints().toArray(new Endpoint[cluster.getRpcEndpoints().size()])).usePlaintext(true).build();
adminClient = StorageClientBuilder.newBuilder().withSettings(settings).buildAdmin();
nsName = "test_namespace";
FutureUtils.result(adminClient.createNamespace(nsName, colConf));
client = StorageClientBuilder.newBuilder().withSettings(settings).withNamespace(nsName).build();
streamName = "test_stream";
createStream(streamName);
}
Aggregations