Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 150a9956 14-Dec-2021 Jeff Morris <jeffry.morris@couchbase.com>

NCBC-2980: missing server_duration in tracing and reports

Motivation
----------
The server_duration which is the time the server took to complete and
operation should be captured

NCBC-2980: missing server_duration in tracing and reports

Motivation
----------
The server_duration which is the time the server took to complete and
operation should be captured in tracing and made available in the
various reports.

Modification
------------
- Ensure that server_duration is read when returned by the server
- Add the server_duration to the Span

Result
------
The server_duration is now availabe.

Change-Id: Ib5d7a575309ec3f6aa71f5e48f0198efc9da7cbe
Reviewed-on: https://review.couchbase.org/c/couchbase-net-client/+/167597
Reviewed-by: Richard Ponton <richard.ponton@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...


Revision tags: 3.2.5, 3.2.5-DI, 3.2.4, 3.2.3, 3.2.1, 3.2.0, 3.1.7, 3.1.5, 2.7.25, 3.1.4, 2.7.24, 3.1.3
# 1a28374e 04-Feb-2021 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-2813: Cleanup IOperation and OperationBase code

Motivation
----------
Reduce DLL size, improve performance, and reduce complexity (and
therefore the risk of future bugs).

NCBC-2813: Cleanup IOperation and OperationBase code

Motivation
----------
Reduce DLL size, improve performance, and reduce complexity (and
therefore the risk of future bugs).

Modifications
-------------
Remove members from IOperation and IOperation<T> which are not used via
the interface. Also make properties readonly which are never set via the
interface. Organize members better, add XML doc comments, and enable
nullable reference types.

Remove unused members from OperationBase, and adjust the visibility of
members to be the minimum required. Remove the virtual keyword from
members that are never overridden, and remove no-op overrides from
descendants. Organize the members and add XML doc comments.

Since IRequest.Idempotent and IOperation.IsReadOnly are basically the
same thing, remove the implementation of Idempotent and forward the
requests to IsReadOnly. This also drops a backing field.

Drop backing fields from ClientContextId and Statement, which are never
set on operations.

Drop IsReplicaRead in favor of making ReplicaIdx nullable.

Drop GetResultWithValue returning IOperationResult<T> since every call
site was only reading .Content, which is available directly from
GetValue(). This allowed removing several other supporting methods that
were effectively unused, such as GetMessage() and its supporting
methods.

Drop ErrorMap/ErrorCode handling from reading the operation header, as
this was unused.

Renamed IOperation.GetConfig to ReadConfig to be more clear.

Results
-------
- Smaller DLL due to removed unused code
- There should be a marginal performance gain because OperationBase is
smaller, reducing memory allocations and cost to zero memory
- There should also be a marginal performance gain due to elimating a
few virtual method calls
- The code is much cleaner and easier to understand, which should make
further work in this area easier and less likely to introduce bugs

Change-Id: Ib5836078440e26ba1417efe4b46c95e9b04d1df9
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/145154
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...


Revision tags: 3.1.2, 2.7.23, 3.1.1
# 63f3c266 06-Dec-2020 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-2736: Optimize key/value operation flag handling

Motivation
----------
Improve the performance of key/value operations.

Modifications
-------------
Drop BitUtil

NCBC-2736: Optimize key/value operation flag handling

Motivation
----------
Improve the performance of key/value operations.

Modifications
-------------
Drop BitUtils, which was handling one bit at a time, in favor of grouped
bit shifting. Move the read and write logic to shared methods in the
Flags structure.

Fix incorrect read logic for Compression, which was reading bits 4-6
instead of 5-7.

Drop duplicate storage of DataFormat and Compression enums directly on
the operation and within the Flags structure, instead storing them
only in the Flags structure. Getters are left in place as property
getters which should be inlined for speed.

Results
-------
Reduced heap size of OperationBase.

Approximately 50% performance improvement for ReadExtras, gains should
be similar on WriteExtras. Since both of these are called on most
key/value operations, gains should be significant.

BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19042
Intel Core i7-9750H CPU 2.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET Core SDK=5.0.100
[Host] : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT
DefaultJob : .NET Core 3.1.9 (CoreCLR 4.700.20.47201, CoreFX 4.700.20.47203), X64 RyuJIT

| Method | Mean | Error | StdDev | Ratio | Rank |
|-------- |----------:|----------:|----------:|------:|-----:|
| Current | 18.228 ns | 0.0676 ns | 0.0564 ns | 1.00 | 2 |
| New | 8.501 ns | 0.0287 ns | 0.0224 ns | 0.47 | 1 |

Change-Id: I2745337a37cc143ca990c896f67788ecaf71b6ef
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/141557
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: <richard.ponton@couchbase.com>

show more ...


Revision tags: 3.1.0, 2.7.22, 3.0.7, 3.0.5, 2.7.20, 3.0.4, 2.7.19, 3.0.3, 3.0.2, 3.0.1, 2.7.18, 2.7.17, 3.0.0, 2.7.16
# 9260824b 04-Feb-2020 Jeff Morris <jeffry.morris@couchbase.com>

NCBC-2325: Add SCRAM-SHA Sasl Authentication

Motivation
----------
Add SCRAM-SHA1 authentication for non-tls connections; tls connections
default to SASL-PLAIN.

Modifica

NCBC-2325: Add SCRAM-SHA Sasl Authentication

Motivation
----------
Add SCRAM-SHA1 authentication for non-tls connections; tls connections
default to SASL-PLAIN.

Modifications
-------------
- Port and refactor ScramShaMechanism from SDK2
- Add base SaslMechanismClass and move duplicate login into it
- Refactor MechanismType into an enum
- Add ISaslMechanismFactory and SaslMechanismFactory and integrate
into DI
- Remove Authenticate from ConnectionExtensions
- Make ClusterNode use SaslMechanismFactory to Authenticate
- Add SaslTests to integrationtests and ScramShaAuthenticationTests to unit tests
- Add SaslMechanismFactoryTests to unit tests

Result
------
The SDK now uses SCRAM-SHA1 for non-tls and SASL-PLAIN for tls
connections. Note that SCRAM-SHA256 and SCRAM-SHA512 are not supported
due to performance implications of generating the hash; this may change
in the future.

Change-Id: If08f9bf4c835256e17d71a6317bfce86ec257c58
Reviewed-on: http://review.couchbase.org/121607
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Brant Burnett <bburnett@centeredgesoftware.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 3.0.0-beta4, 3.0.0-beta3, 2.7.14, 3.0.0-beta2
# e308481b 07-Nov-2019 Jeff Morris <jeffry.morris@couchbase.com>

NCBC-2174: Port Error Map from 2.X and integrate into 3.x

Motivation
----------
Removes legacy namespace and enables operations to use the ErrorMap
after processing.

Mod

NCBC-2174: Port Error Map from 2.X and integrate into 3.x

Motivation
----------
Removes legacy namespace and enables operations to use the ErrorMap
after processing.

Modifications
-------------
- Move Couchbase.Core.IO.Operations.Legacy to Couchbase.Core.IO.Operations
- Hook up ErrorMap in operation completed callback
- Write unit tests

Result
------
ErrorMap is now used to add additional error information to Exceptions
if thrown.

Change-Id: I93a9d741613a16a7d1c202392e2e3e4b84f4a659
Reviewed-on: http://review.couchbase.org/117475
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: David Nault <david.nault@couchbase.com>

show more ...


Revision tags: 3.0.0-beta1, 2.7.12, 2.7.11, 2.7.10, 2.7.9, 2.7.8, 3.0.0-alpha4, 3.0.0-alpha3, 2.7.7
# d938dda3 08-Apr-2019 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-1900: Write extras to OperationBuilder

Motivation
----------
Improve efficiency of extras generation by reducing heap allocations.

Modifications
-------------
R

NCBC-1900: Write extras to OperationBuilder

Motivation
----------
Improve efficiency of extras generation by reducing heap allocations.

Modifications
-------------
Replace CreateExtras with WriteExtras, which accepts an
OperationBuilder. Use stack allocated spans for building the block
to write to the stream instead of heap allocated byte arrays.

Results
-------
Reduced heap allocations. There is still an extra bitblit taking place
to the shared memory pool. This will be addressed on .NET Core 2.1 with
a future improvement to RecyclableMemoryStream.

Change-Id: I931bc07b2630984e376e55a25fcda0111917b4c8
Reviewed-on: http://review.couchbase.org/107480
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Mike Goldsmith <goldsmith.mike@gmail.com>

show more ...


# 21843b11 07-Apr-2019 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-1909: Consolidate OperationBase.SendAsync

Motivation
----------
Considate the SendAsync behavior under a single implementation in
OperationBase, implementing per-operation b

NCBC-1909: Consolidate OperationBase.SendAsync

Motivation
----------
Considate the SendAsync behavior under a single implementation in
OperationBase, implementing per-operation behavioral differences
using other methods.

Modifications
-------------
For all non-subdoc operations, removed SendAsync. Added overrides to
CreateXXX where required to return empty arrays wherever that operation
was skipping that segment.

Removed the unnecessary CreateHeader(...) overload that accepted
byte arrays for each segment, this is now handled solely by
OperationBuilder.

Added BeginSend virtual method to call before writing begins to
allow methods to set values in advance, rather than relying on setting
them during CreateExtras.

Results
-------
Cleaner and more understandable code, and the groundwork is now laid
for gradually replacing `byte[] CreateXXX` methods with
`void WriteXXX(OperationBuilder)` methods which will be more efficient.

Change-Id: I9ff8394df98a2c24602ba258dbda3a2d38c86c53
Reviewed-on: http://review.couchbase.org/107394
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Mike Goldsmith <goldsmith.mike@gmail.com>

show more ...


Revision tags: 2.7.6
# cd4ac9ff 02-Apr-2019 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-1903: Refactor IOperation.Write to SendAsync

Motivation
----------
Allow the use of ReadOnlyMemory<byte> instead of byte[] in
IConnection.SendAsync without adding complex me

NCBC-1903: Refactor IOperation.Write to SendAsync

Motivation
----------
Allow the use of ReadOnlyMemory<byte> instead of byte[] in
IConnection.SendAsync without adding complex memory ownership
requirements.

Modifications
-------------
Instead of using IOperation.Write to return the operation as a byte
array, call IOperation.SendAsync and pass the connection. The operation
then writes itself directly to the connection.

Changed IOperation.SendAsync to accept ReadOnlyMemory<byte> instead of a
byte array.

Add "netcoreapp2.1" to integration tests target frameworks so that tests
hit both the more efficient ReadOnlySpan<byte> based Socket overloads in
.NET Core 2.1 and the legacy ArraySegment<byte> based Socket overloads
in other frameworks.

Results
-------
Callers no longer need to juggle op.Write and op.Completed to call
IConnection.SendAsync, so the API feels cleaner.

Any kind of memory construct may be written by IOperation.SendAsync,
allowing further optimization in future commits around memory pools.

It is now easy and efficient to slice the memory being passed to
IConnection.SendAsync, which will make dealing with variable length
request extras easier (unused bytes at the end of the buffer may be
sliced off).

Change-Id: Ic4a219028bdd542e406c57d9d2d0e2c3b516e492
Reviewed-on: http://review.couchbase.org/107137
Reviewed-by: Mike Goldsmith <goldsmith.mike@gmail.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...


# f2dba43c 24-Mar-2019 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-1887: Convert ReadExtras to ReadOnlySpan<T>

Motivation
----------
Incremental step towards overall operation efficiency improvements.

Modifications
-------------

NCBC-1887: Convert ReadExtras to ReadOnlySpan<T>

Motivation
----------
Incremental step towards overall operation efficiency improvements.

Modifications
-------------
Change ReadExtras to accept `ReadOnlySpan<byte>` instead of `byte[]`.
Adjust calls to DefaultConverter to use span-based overloads.

Results
-------
Future development of ReadAsync will be able to use Memory<byte>
constructs.

Change-Id: I3ebf3d7b1551aee7a6fab17ff0a201d1dd7e0ec2
Reviewed-on: http://review.couchbase.org/106675
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


# 26d5de2d 23-Mar-2019 Brant Burnett <bburnett@centeredgesoftware.com>

NCBC-1886: Use Array.Empty for empty byte arrays

Motivation
----------
Empty byte arrays are effectively immutable objects, so creating a new
one on the heap every time is unnece

NCBC-1886: Use Array.Empty for empty byte arrays

Motivation
----------
Empty byte arrays are effectively immutable objects, so creating a new
one on the heap every time is unnecessary. Efficiency can be improved by
using a singleton.

Modifications
-------------
Replace all instances of `new byte[0]` with `Array.Empty<byte>()` to
use the system-wide empty array singlton.

Results
-------
A significant reduction in unnecessary heap allocations, especially when
writing operations.

Change-Id: I2903d46cffbd238f126238edb101dbd4f3f25c95
Reviewed-on: http://review.couchbase.org/106668
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 3.0.0-alpha2, 3.0.0-alpha1
# 43cf091c 08-Mar-2019 Mike Goldsmith <goldsmith.mike@gmail.com>

NCBC-1857: Move SDK v3 source into Gerrit

MOTIVATION
----------
The .NET SDK v3 development was taking place in another repository.
This should be moved to the main repository.

NCBC-1857: Move SDK v3 source into Gerrit

MOTIVATION
----------
The .NET SDK v3 development was taking place in another repository.
This should be moved to the main repository.

MODIFICATIONS
-------------
- migrate .NET SDK v3 to gerrit

RESULT
------
The SDK v3 source code for .NET is now on Gerrit.

Change-Id: Id8eaa49dba3d10fd9069f6377160f4ebec8586e2
Reviewed-on: http://review.couchbase.org/105924
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 2.7.5, 2.7.3, 2.7.2, 2.7.1, 2.7.4, 2.7.0, 2.6.2, 2.6.1, 2.6.0, 2.5.12, 2.5.11
# e9b52b79 24-Apr-2018 Mike Goldsmith <goldsmith.mike@gmail.com>

NCBC-1625: Refactor operation header length usage

Change-Id: Ie58981f913df3c3e992160b073250ca54b969bd5
Reviewed-on: http://review.couchbase.org/93192
Reviewed-by: Jeffry Morris <jeff

NCBC-1625: Refactor operation header length usage

Change-Id: Ie58981f913df3c3e992160b073250ca54b969bd5
Reviewed-on: http://review.couchbase.org/93192
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
Tested-by: Build Bot <build@couchbase.com>

show more ...


Revision tags: 2.5.10, 2.6.0-beta, 2.5.9, 2.5.8, 2.5.7, 2.5.6, 2.6.0-dp1, 2.5.5
# 6e97fb87 15-Jan-2018 Mike Goldsmith <goldsmith.mike@gmail.com>

NCBC-1616: Add per-operation tracing (OpenTracing)

MOTIVATION
----------
It is desirable for operations of all types to record granular
information to help diagnose and solve per

NCBC-1616: Add per-operation tracing (OpenTracing)

MOTIVATION
----------
It is desirable for operations of all types to record granular
information to help diagnose and solve performance issues. An open
source solution is OpenTracing, which describes an API and describes how
span structures can be recorded and organised.

This change introduces the OpenTracing API dependency and attempts to
solve a common scenario of Slow Operation tracking.

More information on OpenTracing can be found here: http://opentracing.io/

MODIFICATIONS
-------------
- Add the OpenTracing API nuget dependency
- Add the ThresholdLoggingTracer implementation with supporting
configurations options
- Add basic implementations of other required OpenTracing strucutures,
such as SpanBuilder, Span and SpanContext.
- Extend each operation type (KV, View, N1QL, FTS and Analytics) to
maintain an active span property
- Extend each service layer to track encoding, dispatch and decoding of
each operation
- Provide additional testing and fix broken unit tests

RESULT
------
An OpenTracing complication ThresholdLoggingTracer is used to track and log
slow operation at a given interval. The SDK has been upgraded to track
and record Spans for discrete phases of an operation life cycle.

There are a number of configurations available to control service
thresholds, sample size and log interval. The tracing feature can also
be disabled entirely with a NullTracer being used instead which does not
record any activity.

NOTE: The OpenTracing implementation is not committed and my change in
the future.

Change-Id: Ie57df90860f94cb813ca7a538693aac28aa9db02
Reviewed-on: http://review.couchbase.org/87536
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 2.5.4, 2.5.3, 2.5.2, 2.5.1, 2.5.0, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.11, 2.3.10, 2.3.9, core-dp1, 2.3.8
# 7eff8cd8 12-Aug-2016 Mike Goldsmith <goldsmith.mike@gmail.com>

NCBC-1141: When Id is not present in doc fail-fast

MOTIVATION
----------
Whenever mn insert, replace, append or prepend command is executed without a
key property an exception is

NCBC-1141: When Id is not present in doc fail-fast

MOTIVATION
----------
Whenever mn insert, replace, append or prepend command is executed without a
key property an exception is thrown during serialization. It would be
better to fail-fast if the key was null or empty.

Whenever an operation that requires a key is executed without a valid
key an exception is thrown during serialization. It would be better to
fail-fast and throw an exception when the operation is created with an
invalid key.

MODIFICATIONS
-------------
Add new KeyException that sets the message to "Key cannot be null or
empty.".

Thorw KeyException during construction if key is null or empty for:
- Get, GetL, GetQ, GetQ and GetT
- Hello
- Add, Append, Decrement, Delete, Prepend, Replace and Set
- Observe
- ReplicaRead
- Touch
- Unlock

- All Subdocument operations

Added tests to prove a null or empty key throws for each operation type
correctly.

Also added local.config to .gitignore so we can have local appSettings
that don't need to be added to source control.

RESULT
------
If an insert command is executed without a valid key the operation now
fails quickley before trying to serialize the operation.

Change-Id: I8a155c6909204ac60059b1c4ce3becddd3153510
Reviewed-on: http://review.couchbase.org/66725
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 2.3.5, 2.3.3, 2.3.1, 2.3.0, 2.3.6, 2.2.7, 2.2.8, 2.2.6, 1.3.13, 2.2.4, 2.2.5, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.2.0-dp1, 2.1.4, 2.1.3, 2.1.2
# e7737a56 13-Jun-2015 jeffrymorris <jeffrymorris@gmail.com>

NCBC-895: BufferAllocator is created per Connection

Motivation
----------
Makes the buffer for K/V IO a contiguous buffer per cluster node.

Modifications
-------------

NCBC-895: BufferAllocator is created per Connection

Motivation
----------
Makes the buffer for K/V IO a contiguous buffer per cluster node.

Modifications
-------------
Refactored so that BufferAllocator is now allocated at the ConnectionPool
level, instead of per connection. Changed the connection logic to use the
Offset of the SAEA assigned to itself as the offset for reading and
writing to the contiguous buffer.

Result
------
The SDK now uses the full range of indexes available and allocates the
buffer for each cluster node as a contiguous buffer.

Change-Id: If66e3eba88af5cb6ae801dbbace5cf9dd52a8e83
Reviewed-on: http://review.couchbase.org/52038
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
Reviewed-by: Simon Baslé <simon@couchbase.com>

show more ...


# d2e8bd67 11-Jun-2015 jeffrymorris <jeffrymorris@gmail.com>

NCBC-886: Check opaque of response header against op Opaque

Motivation
----------
Adds a comparison of the opaque returned in the packet with the
operation object's opaque field

NCBC-886: Check opaque of response header against op Opaque

Motivation
----------
Adds a comparison of the opaque returned in the packet with the
operation object's opaque field to ensure that they match.

Modifications
-------------
The Read method in OperationBase now does a opaque comparison after
reading the header; if the two are not equal, a ClientFailure will be
returned and a message indicating the expected and actual opaque values.
Some of the SASL operation's didn't send an opaque, so they were modified
to do so. The Connection class now sets IsDead to true if the read request
ends up returning 0 bytes.

Results
-------
If the response of the operation does match the request, the client will
return an error.

Change-Id: I0c89c1b8d8560263507ebdc7efc8386cd9c4e1da
Reviewed-on: http://review.couchbase.org/51933
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
Reviewed-by: Simon Baslé <simon@couchbase.com>

show more ...


Revision tags: 2.1.1, 2.1.0
# 8108e5a6 18-Apr-2015 jeffrymorris <jeffrymorris@gmail.com>

NCBC-676: Make JSON Serializer "Pluggable"

Motivation
----------
The Couchbase .NET SDK uses JSON.NET as the default serializer and it
previously was tightly coupled to the inter

NCBC-676: Make JSON Serializer "Pluggable"

Motivation
----------
The Couchbase .NET SDK uses JSON.NET as the default serializer and it
previously was tightly coupled to the internals of the client. This commit
makes it possible to create and plug-in custom serializers using whatever
serialization dependency you chose to use.

Modifications
-------------
A new interface, ITypeSerializer, was added that defines the methods which
need to be implemented by your custom serializer. A default serializer
that uses JSON.NET was added; it is aptly named the DefaultSerializer. A
SerializerFactory was added that returns Func<ITypeSerializer> objects;
the configuration has added support for creating ITypeSerializers from a
<serializer type="" name=""/> element in the App.Config. Finally, the
constructors of all operations were refactored so that they used the value
returned by the Func<ITypeSerializer>.

Results
-------
Now, if the DefaultSerializer based off JSON.NET does not suit your fancy,
you can create a custom one (ServiceStack.Text, Jil, etc) and inject it into the client.

Change-Id: If765552821cbea6b19e14f5e61032a7ff38f1434

Conflicts:
Src/Couchbase/CouchbaseBucket.cs
Src/Couchbase/MemcachedBucket.cs
Change-Id: I8cfcd71e45ab8e575c21971380b71246ecd81823
Reviewed-on: http://review.couchbase.org/50209
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 1.3.12, 2.0.3
# a53409d9 02-Mar-2015 Simon Baslé <simon.basle@gmail.com>

NCBC-811: Make operation lifespan configurable

Motivation
----------
Currently, operations have a lifespan, a timeout for the whole thing to
finish. It is defined as Timeout prop

NCBC-811: Make operation lifespan configurable

Motivation
----------
Currently, operations have a lifespan, a timeout for the whole thing to
finish. It is defined as Timeout property but its default value is in
OperationBase'.cs (2500ms).
This default value should be customizable, both programmaticaly and via
the App.config file. It should also be possible to define it on a per
bucket basis (overriding the value at cluster level).

Modifications
-------------
Removed the DefaultTimeout in OperationBase' and made so that all ctors
of operations now require the timeout.

Added the notion of OperationLifespanTimeout in ClientConfiguration +
BucketConfiguration (programmatic API) and in CouchbaseClientSection +
BucketElement (app.config).
Programmatic API will track if default value has changed and update the
bucket config accordingly.

Each bucket implementation will extract the default operation lifespan
from the BucketConfiguration (and fallback to using ClientConfiguration
if no bucket configuration matches) at instantiation. After that, each
call to an operation except those that may already have passed in a
timeout will use this default operation lifespan.

KeyObserver and SaslFactory both require the timeout to create a few
operations, but they don't have a reference to the configuration. They
now have their own DefaultTimeout (set to 2500ms for backward compat.).

All tests use a default 2500ms timeout, when possible defined in a
parent class (like OperationTestBase.cs), except TimerTests and
FakeOperation that use 500ms.

Added a few tests to validate configuration behavior.

Result
------
WORK IN PROGRESS - need to fully run tests
The lifespan timeout used by default for every operation can now be
customized via configuration. Note that it only affect buckets created
after the customization has been done as they cache the timeout value.

Change-Id: If1f0e8faa44c9747f97152dca4bb855659ce0fed
Reviewed-on: http://review.couchbase.org/47555
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: 1.3.11, 2.0.2, 2.0.1, 2.0ga, 1.3.10, 2.0-beta2
# 72b06be3 19-Sep-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-608: Implement Common Flags

Change-Id: I31dadb83b1b1680ba9d85b6f33512c87d38007dc
Reviewed-on: http://review.couchbase.org/41479
Reviewed-by: Brett Lawson <brett19@gmail.com>

NCBC-608: Implement Common Flags

Change-Id: I31dadb83b1b1680ba9d85b6f33512c87d38007dc
Reviewed-on: http://review.couchbase.org/41479
Reviewed-by: Brett Lawson <brett19@gmail.com>
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>

show more ...


Revision tags: Beta20, 1.3.9, 1.3.8
# 6a9633f6 08-Jul-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-421: Refactor and Improve IO layer


# 3ad5ac66 24-Jun-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-524: Refactor OperationBase and other classes to not use ArraySegment


# a39674d0 21-Jun-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-523: Refactor operations to use Converter


# 439f3242 19-Jun-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-521: Ensure one copy of ITypeSerializer is used per client instance


# 95a1dbbd 19-Jun-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-521: Ensure one copy of ITypeSerializer is used per client instance


# 448bba20 18-Jun-2014 jeffrymorris <jeffrymorris@gmail.com>

NCBC-512: Switch from custom BinaryConverter to IByteConverter


12