Search in sources :

Example 1 with BucketOpenInitiatedEvent

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)));
}
Also used : BucketOpenedEvent(com.couchbase.client.core.cnc.events.core.BucketOpenedEvent) InitGlobalConfigFailedEvent(com.couchbase.client.core.cnc.events.core.InitGlobalConfigFailedEvent) WatchdogInvalidStateIdentifiedEvent(com.couchbase.client.core.cnc.events.core.WatchdogInvalidStateIdentifiedEvent) CoreCreatedEvent(com.couchbase.client.core.cnc.events.core.CoreCreatedEvent) ReconfigurationIgnoredEvent(com.couchbase.client.core.cnc.events.core.ReconfigurationIgnoredEvent) ShutdownCompletedEvent(com.couchbase.client.core.cnc.events.core.ShutdownCompletedEvent) BucketOpenedEvent(com.couchbase.client.core.cnc.events.core.BucketOpenedEvent) BucketOpenFailedEvent(com.couchbase.client.core.cnc.events.core.BucketOpenFailedEvent) BucketClosedEvent(com.couchbase.client.core.cnc.events.core.BucketClosedEvent) ShutdownInitiatedEvent(com.couchbase.client.core.cnc.events.core.ShutdownInitiatedEvent) ReconfigurationCompletedEvent(com.couchbase.client.core.cnc.events.core.ReconfigurationCompletedEvent) BucketOpenInitiatedEvent(com.couchbase.client.core.cnc.events.core.BucketOpenInitiatedEvent) ServiceReconfigurationFailedEvent(com.couchbase.client.core.cnc.events.core.ServiceReconfigurationFailedEvent) ReconfigurationErrorDetectedEvent(com.couchbase.client.core.cnc.events.core.ReconfigurationErrorDetectedEvent) Event(com.couchbase.client.core.cnc.Event) WatchdogRunFailedEvent(com.couchbase.client.core.cnc.events.core.WatchdogRunFailedEvent) BucketOpenFailedEvent(com.couchbase.client.core.cnc.events.core.BucketOpenFailedEvent) AlreadyShutdownException(com.couchbase.client.core.error.AlreadyShutdownException) BucketOpenInitiatedEvent(com.couchbase.client.core.cnc.events.core.BucketOpenInitiatedEvent)

Aggregations

Event (com.couchbase.client.core.cnc.Event)1 BucketClosedEvent (com.couchbase.client.core.cnc.events.core.BucketClosedEvent)1 BucketOpenFailedEvent (com.couchbase.client.core.cnc.events.core.BucketOpenFailedEvent)1 BucketOpenInitiatedEvent (com.couchbase.client.core.cnc.events.core.BucketOpenInitiatedEvent)1 BucketOpenedEvent (com.couchbase.client.core.cnc.events.core.BucketOpenedEvent)1 CoreCreatedEvent (com.couchbase.client.core.cnc.events.core.CoreCreatedEvent)1 InitGlobalConfigFailedEvent (com.couchbase.client.core.cnc.events.core.InitGlobalConfigFailedEvent)1 ReconfigurationCompletedEvent (com.couchbase.client.core.cnc.events.core.ReconfigurationCompletedEvent)1 ReconfigurationErrorDetectedEvent (com.couchbase.client.core.cnc.events.core.ReconfigurationErrorDetectedEvent)1 ReconfigurationIgnoredEvent (com.couchbase.client.core.cnc.events.core.ReconfigurationIgnoredEvent)1 ServiceReconfigurationFailedEvent (com.couchbase.client.core.cnc.events.core.ServiceReconfigurationFailedEvent)1 ShutdownCompletedEvent (com.couchbase.client.core.cnc.events.core.ShutdownCompletedEvent)1 ShutdownInitiatedEvent (com.couchbase.client.core.cnc.events.core.ShutdownInitiatedEvent)1 WatchdogInvalidStateIdentifiedEvent (com.couchbase.client.core.cnc.events.core.WatchdogInvalidStateIdentifiedEvent)1 WatchdogRunFailedEvent (com.couchbase.client.core.cnc.events.core.WatchdogRunFailedEvent)1 AlreadyShutdownException (com.couchbase.client.core.error.AlreadyShutdownException)1