use of com.couchbase.client.core.cnc.events.core.BucketOpenInitiatedEvent in project couchbase-jvm-clients by couchbase.
the class Core method openBucket.
/**
* Attempts to open a bucket and fails the {@link Mono} if there is a persistent error
* as the reason.
*/
@Stability.Internal
public void openBucket(final String name) {
eventBus.publish(new BucketOpenInitiatedEvent(coreContext, name));
long start = System.nanoTime();
configurationProvider.openBucket(name).subscribe(v -> {
}, t -> {
Event.Severity severity = t instanceof AlreadyShutdownException ? Event.Severity.DEBUG : Event.Severity.WARN;
eventBus.publish(new BucketOpenFailedEvent(name, severity, Duration.ofNanos(System.nanoTime() - start), coreContext, t));
}, () -> eventBus.publish(new BucketOpenedEvent(Duration.ofNanos(System.nanoTime() - start), coreContext, name)));
}
Aggregations