public async Task <IClusterNode> CreateAndConnectAsync(HostEndpointWithPort endPoint, NodeAdapter?nodeAdapter, CancellationToken cancellationToken = default)
        {
            var clusterNode = new ClusterNode(_clusterContext, _connectionPoolFactory, _logger,
                                              _operationBuilderPool, _circuitBreaker, _saslMechanismFactory, _redactor, endPoint,
                                              nodeAdapter, _tracer);

            //ensure server calls are made to set the state
            await clusterNode.InitializeAsync().ConfigureAwait(false);

            return(clusterNode);
        }
Exemple #2
0
        public async Task <IClusterNode> CreateAndConnectAsync(HostEndpoint endPoint, CancellationToken cancellationToken = default)
        {
            var ipEndPoint = await _ipEndPointService.GetIpEndPointAsync(endPoint.Host, endPoint.Port.GetValueOrDefault(), cancellationToken).ConfigureAwait(false);

            var clusterNode = new ClusterNode(_clusterContext, _connectionPoolFactory, _logger,
                                              _transcoder, _circuitBreaker, _saslMechanismFactory, _redactor, ipEndPoint)
            {
                BootstrapEndpoint = endPoint
            };

            //ensure server calls are made to set the state
            await clusterNode.InitializeAsync().ConfigureAwait(false);

            return(clusterNode);
        }
        public async Task <IClusterNode> CreateAndConnectAsync(HostEndpoint endPoint, BucketType bucketType, NodeAdapter?nodeAdapter, CancellationToken cancellationToken = default)
        {
            var ipEndPoint = await _ipEndPointService.GetIpEndPointAsync(endPoint.Host, endPoint.Port.GetValueOrDefault(), cancellationToken).ConfigureAwait(false);

            //for recording k/v latencies per request
            var valueRecorder = _meter.ValueRecorder(OuterRequestSpans.ServiceSpan.Kv.Name);

            var clusterNode = new ClusterNode(_clusterContext, _connectionPoolFactory, _logger,
                                              _operationBuilderPool, _circuitBreaker, _saslMechanismFactory, _redactor, ipEndPoint, bucketType,
                                              nodeAdapter, _tracer, valueRecorder)
            {
                BootstrapEndpoint = endPoint
            };

            //ensure server calls are made to set the state
            await clusterNode.InitializeAsync().ConfigureAwait(false);

            return(clusterNode);
        }