/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given username (which is a Couchbase Bucket) and password. /// </summary> /// <param name="ioService">The <see cref="IOService"/>to use for I/O.</param> /// <param name="username">The name of the Bucket you are connecting to.</param> /// <param name="password">The password for the Bucket.</param> /// <param name="transcoder"></param> public CramMd5Mechanism(IIOService ioService, string username, string password, ITypeTranscoder transcoder) { _ioService = ioService; Username = username; Password = password; _transcoder = transcoder; }
/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given username (which is a Couchbase Bucket) and password. /// </summary> /// <param name="ioStrategy">The <see cref="IOStrategy"/>to use for I/O.</param> /// <param name="username">The name of the Bucket you are connecting to.</param> /// <param name="password">The password for the Bucket.</param> /// <param name="transcoder"></param> public CramMd5Mechanism(IOStrategy ioStrategy, string username, string password, ITypeTranscoder transcoder) { _ioStrategy = ioStrategy; Username = username; Password = password; _transcoder = transcoder; }
/// <summary> /// Ctor for <see cref="KeyObserver"/>. /// </summary> /// <param name="configInfo">The <see cref="IConfigInfo"/> object which represents the current cluster and client configuration.</param> /// <param name="transcoder"></param> /// <param name="interval">The interval to poll.</param> /// <param name="timeout">The max time to wait for the durability requirements to be met.</param> public KeyObserver(IConfigInfo configInfo, ITypeTranscoder transcoder, int interval, int timeout) { _configInfo = configInfo; _interval = interval; _timeout = timeout; _transcoder = transcoder; }
public PlainTextMechanism(IIOService service, string username, string password, ITypeTranscoder transcoder) { _service = service; Username = username; Password = password; _transcoder = transcoder; }
public PlainTextMechanism(IOStrategy strategy, string username, string password, ITypeTranscoder transcoder) { _strategy = strategy; Username = username; Password = password; _transcoder = transcoder; }
public PlainTextMechanism(string username, string password, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) { Username = username; Password = password; _transcoder = transcoder; Log = loggerFactory.CreateLogger<CramMd5Mechanism>(); }
public CouchbaseConfigContext(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, ITypeTranscoder transcoder) : base(bucketConfig, clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, transcoder) { }
/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given username (which is a Couchbase Bucket) and password. /// </summary> /// <param name="ioService">The <see cref="IOService"/>to use for I/O.</param> /// <param name="username">The name of the Bucket you are connecting to.</param> /// <param name="password">The password for the Bucket.</param> /// <param name="transcoder"></param> public CramMd5Mechanism(IIOService ioService, string username, string password, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) { Log = loggerFactory.CreateLogger<CramMd5Mechanism>(); _ioService = ioService; Username = username; Password = password; _transcoder = transcoder; }
public virtual void TestFixtureSetUp() { EndPoint = UriExtensions.GetEndPoint(Address); var connectionPoolConfig = new PoolConfiguration(); _connectionPool = new ConnectionPool<Connection>(connectionPoolConfig, EndPoint); _ioService = new PooledIOService(_connectionPool); Transcoder = new DefaultTranscoder(); }
public MemcachedConfigContext(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, ITypeTranscoder transcoder) : base(bucketConfig, clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, transcoder) { }
public HttpStreamingProvider(ClientConfiguration clientConfig, Func<IConnectionPool, ILoggerFactory, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) : base(clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, converter, transcoder, loggerFactory) { }
public HttpStreamingProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, transcoder) { }
public MemcachedConfigContext(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool,ILoggerFactory, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) : base(bucketConfig, clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, transcoder, loggerFactory) { _loggerFactory = loggerFactory; Log = _loggerFactory.CreateLogger<MemcachedConfigContext>(); }
public CouchbaseConfigContext(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, ITypeTranscoder transcoder) : base(bucketConfig, clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, transcoder) { //for caching query plans QueryCache = new ConcurrentDictionary<string, QueryPlan>(); }
protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) { Key = key; Transcoder = transcoder; Opaque = opaque; CreationTime = DateTime.UtcNow; Timeout = timeout; VBucket = vBucket; Converter = transcoder.Converter; MaxRetries = DefaultRetries; Data = new MemoryStream(); Header = new OperationHeader {Status = ResponseStatus.None}; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, transcoder) { if (ClientConfig.EnableConfigHeartBeat) _heartBeat = new Timer(_heartBeat_Elapsed, null, ClientConfig.HeartbeatConfigInterval, Timeout.Infinite); else _heartBeat = new Timer(_heartBeat_Elapsed, null, Timeout.Infinite, Timeout.Infinite); }
protected ConfigContextBase(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, ITypeTranscoder transcoder) { _bucketConfig = bucketConfig; _clientConfig = clientConfig; IOStrategyFactory = ioStrategyFactory; ConnectionPoolFactory = connectionPoolFactory; _creationTime = DateTime.Now; SaslFactory = saslFactory; Transcoder = transcoder; }
protected ConfigProviderBase(ClientConfiguration clientConfig, Func<IConnectionPool, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) { _clientConfig = clientConfig; _ioServiceFactory = ioServiceFactory; _connectionPoolFactory = connectionPoolFactory; _saslFactory = saslFactory; Converter = converter; Transcoder = transcoder; }
public ClusterController(ClientConfiguration clientConfig, Func<IConnectionPool, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) { _clientConfig = clientConfig; _ioServiceFactory = ioServiceFactory; _connectionPoolFactory = connectionPoolFactory; _saslFactory = saslFactory; Converter = converter; Transcoder = transcoder; Initialize(); }
protected ConfigContextBase(IBucketConfig bucketConfig, ClientConfiguration clientConfig, Func<IConnectionPool, ILoggerFactory, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; Log = _loggerFactory.CreateLogger<ConfigContextBase>(); _bucketConfig = bucketConfig; _clientConfig = clientConfig; IOServiceFactory = ioServiceFactory; ConnectionPoolFactory = connectionPoolFactory; _creationTime = DateTime.Now; SaslFactory = saslFactory; Transcoder = transcoder; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, IOStrategy> ioStrategyFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IOStrategy, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder) : base(clientConfig, ioStrategyFactory, connectionPoolFactory, saslFactory, converter, transcoder) { _heartBeat = new Timer { Interval = ClientConfig.HeartbeatConfigInterval, Enabled = ClientConfig.EnableConfigHeartBeat, AutoReset = false }; _heartBeat.Elapsed += _heartBeat_Elapsed; }
public CarrierPublicationProvider(ClientConfiguration clientConfig, Func<IConnectionPool, ILoggerFactory, IIOService> ioServiceFactory, Func<PoolConfiguration, IPEndPoint, IConnectionPool> connectionPoolFactory, Func<string, string, IIOService, ITypeTranscoder, ISaslMechanism> saslFactory, IByteConverter converter, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) : base(clientConfig, ioServiceFactory, connectionPoolFactory, saslFactory, converter, transcoder, loggerFactory) { AutoResetEvent autoEvent = new AutoResetEvent(false); _heartBeat = new Timer(_heartBeat_Elapsed, autoEvent, Timeout.Infinite, Timeout.Infinite); if (ClientConfig.EnableConfigHeartBeat) { _heartBeat.Change((int) ClientConfig.HeartbeatConfigInterval, Timeout.Infinite); } }
protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) { if (RequiresKey && string.IsNullOrWhiteSpace(key)) { throw new MissingKeyException(); } Key = key; Transcoder = transcoder; Opaque = opaque; CreationTime = DateTime.UtcNow; Timeout = timeout; VBucket = vBucket; Converter = transcoder.Converter; MaxRetries = DefaultRetries; Data = new MemoryStream(); Header = new OperationHeader {Status = ResponseStatus.None}; }
public SaslList(ITypeTranscoder transcoder, uint timeout) : this(string.Empty, null, transcoder, null, SequenceGenerator.GetNext(), timeout) { }
protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : this(key, vBucket, transcoder, SequenceGenerator.GetNext(), timeout) { }
public SubDocDelete(MutateInBuilder <T> builder, string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(builder, key, vBucket, transcoder, SequenceGenerator.GetNext(), timeout) { CurrentSpec = builder.FirstSpec(); Path = CurrentSpec.Path; }
public Touch(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, vBucket, transcoder, timeout) { }
protected SubDocSingularLookupBase(ISubDocBuilder <T> builder, string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(builder, key, vBucket, transcoder, timeout) { }
public Delete(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, vBucket, transcoder, timeout) { }
public ObserveSeqno(MutationToken mutationToken, ITypeTranscoder transcoder, uint timeout) : base(null, null, transcoder, timeout) { MutationToken = mutationToken; }
public MultiLookup(string key, LookupInBuilder <T> builder, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, vBucket, transcoder, timeout) { _builder = builder; }
private Set(string key, T value, ITypeTranscoder transcoder, IVBucket vBucket, uint opaque, uint timeout) : base(key, value, vBucket, transcoder, opaque, timeout) { }
private Increment(string key, ulong initial, ulong delta, uint expiration, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) : base(key, initial, vBucket, transcoder, opaque, timeout) { _delta = delta; _initial = initial; _expiration = expiration; }
public Set(string key, T value, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, value, vBucket, transcoder, SequenceGenerator.GetNext(), timeout) { }
protected SubDocSingularMutationBase(ISubDocBuilder <T> builder, string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) : base(builder, key, vBucket, transcoder, opaque, timeout) { }
public Hello(string key, short[] value, ITypeTranscoder transcoder, uint opaque, uint timeout) : base(key, value, null, transcoder, opaque, timeout) { }
public SelectBucket(string key, ITypeTranscoder transcoder, uint timeout) : base(key, null, transcoder, timeout) { }
protected OperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : this(key, default(T), vBucket, transcoder, SequenceGenerator.GetNext(), timeout) { }
public ClusterNode(ClusterContext context, ITypeTranscoder transcoder, ICircuitBreaker circuitBreaker) { _context = context; _transcoder = transcoder; _circuitBreaker = circuitBreaker; }
public GetReplicaResult(IMemoryOwner <byte> contentBytes, ITypeTranscoder transcoder) : base(contentBytes, transcoder) { }
public FakeSubDocumentOperation(ISubDocBuilder <T> builder, string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(builder, key, vBucket, transcoder, timeout) { }
private ReplicaRead(string key, ITypeTranscoder transcoder, IVBucket vBucket, uint opaque, uint timeout) : base(key, default(T), vBucket, transcoder, opaque, timeout) { }
/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given <see cref="IOService"/>. /// </summary> /// <param name="ioService">The I/O service to use.</param> /// <param name="transcoder"></param> public CramMd5Mechanism(IIOService ioService, ITypeTranscoder transcoder) { _ioService = ioService; _transcoder = transcoder; }
public ReplicaRead(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, vBucket, transcoder, timeout) { }
public MultiMutation(string key, MutateInBuilder <T> mutateInBuilder, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, vBucket, transcoder, timeout) { _builder = mutateInBuilder; Cas = _builder.Cas; }
public static async Task SelectBucket(this IConnection connection, string bucketName, ITypeTranscoder transcoder) { var completionSource = new TaskCompletionSource <bool>(); using var selectBucketOp = new SelectBucket { Transcoder = transcoder, Key = bucketName, Completed = s => { completionSource.TrySetResult(s.Status == ResponseStatus.Success); return(completionSource.Task); } }; await selectBucketOp.SendAsync(connection).ConfigureAwait(false); }
protected GetK(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) : base(key, vBucket, transcoder, opaque, timeout) { }
/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given <see cref="IOStrategy"/>. /// </summary> /// <param name="ioStrategy">The I/O strategy to use.</param> /// <param name="transcoder"></param> public CramMd5Mechanism(IOStrategy ioStrategy, ITypeTranscoder transcoder) { _ioStrategy = ioStrategy; _transcoder = transcoder; }
public SaslStep(string key, string value, ITypeTranscoder transcoder, IVBucket vBucket, uint opaque, uint timeout) : base(key, value, vBucket, transcoder, opaque, timeout) { }
protected MutationOperationBase(string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, vBucket, transcoder, timeout) { }
public SaslStep(string key, string value, ITypeTranscoder transcoder, uint timeout) : base(key, value, null, transcoder, SequenceGenerator.GetNext(), timeout) { }
public Increment(string key, ulong initial, ulong delta, uint expiration, IVBucket vBucket, IByteConverter converter, ITypeTranscoder transcoder) : base(key, vBucket, converter, transcoder) { _delta = delta; _initial = initial; _expiration = expiration; }
internal static async Task <uint?> GetCid(this IConnection connection, string name, ITypeTranscoder transcoder) { var completionSource = new TaskCompletionSource <IMemoryOwner <byte> >(); using var getCid = new GetCid { Key = name, Transcoder = transcoder, Opaque = SequenceGenerator.GetNext(), Content = null, Completed = s => { completionSource.TrySetResult(s.ExtractData()); return(completionSource.Task); } }; await getCid.SendAsync(connection).ConfigureAwait(false); var gitCidBytes = await completionSource.Task.ConfigureAwait(false); await getCid.ReadAsync(gitCidBytes).ConfigureAwait(false); var resultWithValue = getCid.GetResultWithValue(); return(resultWithValue.Content); }
public Add(string key, T value, ulong cas, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(key, value, vBucket, transcoder, SequenceGenerator.GetNext(), timeout) { Cas = cas; }
internal static async Task <Manifest> GetManifest(this IConnection connection, ITypeTranscoder transcoder) { var completionSource = new TaskCompletionSource <IMemoryOwner <byte> >(); using var manifestOp = new GetManifest { Transcoder = transcoder, Opaque = SequenceGenerator.GetNext(), Completed = s => { completionSource.TrySetResult(s.ExtractData()); return(completionSource.Task); } }; await manifestOp.SendAsync(connection).ConfigureAwait(false); var manifestBytes = await completionSource.Task.ConfigureAwait(false); await manifestOp.ReadAsync(manifestBytes).ConfigureAwait(false); var manifestResult = manifestOp.GetResultWithValue(); return(manifestResult.Content); }
public ClusterNode(ClusterContext context, IConnectionPoolFactory connectionPoolFactory, ILogger <ClusterNode> logger, ITypeTranscoder transcoder, ICircuitBreaker circuitBreaker, ISaslMechanismFactory saslMechanismFactory, IRedactor redactor, IPEndPoint endPoint, BucketType bucketType, NodeAdapter nodeAdapter, IRequestTracer tracer) { _context = context ?? throw new ArgumentNullException(nameof(context)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _transcoder = transcoder ?? throw new ArgumentNullException(nameof(transcoder)); _circuitBreaker = circuitBreaker ?? throw new ArgumentException(nameof(circuitBreaker)); _saslMechanismFactory = saslMechanismFactory ?? throw new ArgumentException(nameof(saslMechanismFactory)); _redactor = redactor ?? throw new ArgumentNullException(nameof(redactor)); _tracer = tracer; BucketType = bucketType; EndPoint = endPoint ?? throw new ArgumentNullException(nameof(endPoint)); _cachedToString = $"{EndPoint}-{_id}"; KeyEndPoints = new ReadOnlyObservableCollection <IPEndPoint>(_keyEndPoints); UpdateKeyEndPoints(); ((INotifyCollectionChanged)_keyEndPoints).CollectionChanged += (_, e) => OnKeyEndPointsChanged(e); if (connectionPoolFactory == null) { throw new ArgumentNullException(nameof(connectionPoolFactory)); } ConnectionPool = connectionPoolFactory.Create(this); if (nodeAdapter != null) { NodesAdapter = nodeAdapter; } }
/// <summary> /// Creates a <see cref="CramMd5Mechanism"/> object using a given <see cref="IOService"/>. /// </summary> /// <param name="ioService">The I/O service to use.</param> /// <param name="transcoder"></param> public CramMd5Mechanism(IIOService ioService, ITypeTranscoder transcoder, ILoggerFactory loggerFactory) { _ioService = ioService; _transcoder = transcoder; Log = loggerFactory.CreateLogger<CramMd5Mechanism>(); }
public SubExists(LookupInBuilder <T> builder, string key, IVBucket vBucket, ITypeTranscoder transcoder, uint timeout) : base(builder, key, vBucket, transcoder, timeout) { CurrentSpec = builder.FirstSpec(); Path = CurrentSpec.Path; }
public Unlock(string key, ITypeTranscoder transcoder, IVBucket vBucket, uint timeout) : base(key, vBucket, transcoder, timeout) { }
protected OperationBase(string key, T value, IVBucket vBucket, ITypeTranscoder transcoder, uint opaque, uint timeout) : base(key, vBucket, transcoder, opaque, timeout) { _value = value; }