Home
last modified time | relevance | path

Searched +hist:7 +hist:eff8cd8 (Results 1 - 20 of 20) sorted by path

/Couchbase_NET_Client_v3.0/
H A D.gitignorediff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
/Couchbase_NET_Client_v3.0/src/Couchbase/Core/IO/Operations/
H A DAdd.csdiff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DConfig.csdiff 63f3c266 Sun Dec 06 16:52:08 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DGet.csdiff 63f3c266 Sun Dec 06 16:52:08 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DGetK.csdiff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DGetQ.csdiff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DGetT.csdiff fc440704 Tue Dec 29 05:53:48 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> NCBC-2722: Refactor K/V cancellation tokens and timeouts

Motivation
----------
Currently, cancellation tokens are registered to set the IOperation to
canceled in multiple spots, which is inefficient, disorganized, and
causes excess heap allocations.

Additionally, some of the registrations related to bootstrapping are
linked to the CancellationTokenSource of the DataFlowConnectionPool,
preventing garbage collection of the the registrations and the boostrap
operations.

It is also conceivable that a cancellation token from a previous
operation attempt could be triggered while in a subsequent attempt, and
it would then mark the operation cancelled. This probably isn't an issue
now given the retry structure but could cause problems in future design
iterations.

Timeouts are not currently handled in a way that matches the RFC, and
there is some inconsistency in how exceptions are bubbled up for
externally requested cancellations versus timeouts. There is also the
possibility of creating unnecessary ambiguity in mutation state when
requesting external cancellation of a mutation operation.

Modifications
-------------
Change cancellation token logic for sending operations to be defined as
only cancelling the send, not the IOperation. This removes token
registration from both the DataFlowConnectionPool
and OperationBase.SendAsync.

Pass the CancellationToken through to IConnection.SendAsync so the
actual send may be cancelled if it is still queued on the Socket,
rather than only being cancellable while in the connection pool queue.

Instead, register the cancellation token, if any, wherever
IOperation.Completed is being awaited. That way it may dispose of the
registration after the operation is completed, regardless of how it
completes. There are two such locations in ClusterNode and in
SaslMechanismBase.

Make the logic in AsyncState a bit smarter so that it may not be
completed more than once from multiple threads.

For K/V operations, pass CancellationTokenPair from CouchbaseCollection
down the stack through to ClusterNode.ExecuteAsync. This allows smart
behaviors in ClusterNode.ExecuteAsync and RetryOrchestrator so that
internal timeout OperationCanceledExceptions can be differentiated from
exceptions triggered by external cancellation.

Results
-------
Cleaner and easier to understand cancellation logic for operations,
which is also more efficient.

Bootstrap operations aren't left dangling and holding heap space.

Retries won't accidentally get marked cancelled if a previous attempt's
token is cancelled.

Externally requested cancellation will trigger generally bubble up the
OperationCanceledException. However, if a mutation operation has already
been sent on the wire it will instead ignore the cancellation, wait for
the result, and bubble that exception.

Timeout based cancellations will now correctly bubble up Ambiguious or
Unambiguous timeout exceptions based on whether the operation was a
mutation and if the operation has been sent on the wire.

CouchbaseCollection now correctly applies timeouts when an external
cancellation token is supplied. Previously, the external token
superceded timeouts.

Timeout/cancellation behavior: https://gist.github.com/brantburnett/7a562876b1d53015310ce38b69da18d7

Change-Id: Icf181739354409df389f173dc542c663b03d66d0
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/142715
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DHello.csdiff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DIOperation.csdiff fc440704 Tue Dec 29 05:53:48 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> NCBC-2722: Refactor K/V cancellation tokens and timeouts

Motivation
----------
Currently, cancellation tokens are registered to set the IOperation to
canceled in multiple spots, which is inefficient, disorganized, and
causes excess heap allocations.

Additionally, some of the registrations related to bootstrapping are
linked to the CancellationTokenSource of the DataFlowConnectionPool,
preventing garbage collection of the the registrations and the boostrap
operations.

It is also conceivable that a cancellation token from a previous
operation attempt could be triggered while in a subsequent attempt, and
it would then mark the operation cancelled. This probably isn't an issue
now given the retry structure but could cause problems in future design
iterations.

Timeouts are not currently handled in a way that matches the RFC, and
there is some inconsistency in how exceptions are bubbled up for
externally requested cancellations versus timeouts. There is also the
possibility of creating unnecessary ambiguity in mutation state when
requesting external cancellation of a mutation operation.

Modifications
-------------
Change cancellation token logic for sending operations to be defined as
only cancelling the send, not the IOperation. This removes token
registration from both the DataFlowConnectionPool
and OperationBase.SendAsync.

Pass the CancellationToken through to IConnection.SendAsync so the
actual send may be cancelled if it is still queued on the Socket,
rather than only being cancellable while in the connection pool queue.

Instead, register the cancellation token, if any, wherever
IOperation.Completed is being awaited. That way it may dispose of the
registration after the operation is completed, regardless of how it
completes. There are two such locations in ClusterNode and in
SaslMechanismBase.

Make the logic in AsyncState a bit smarter so that it may not be
completed more than once from multiple threads.

For K/V operations, pass CancellationTokenPair from CouchbaseCollection
down the stack through to ClusterNode.ExecuteAsync. This allows smart
behaviors in ClusterNode.ExecuteAsync and RetryOrchestrator so that
internal timeout OperationCanceledExceptions can be differentiated from
exceptions triggered by external cancellation.

Results
-------
Cleaner and easier to understand cancellation logic for operations,
which is also more efficient.

Bootstrap operations aren't left dangling and holding heap space.

Retries won't accidentally get marked cancelled if a previous attempt's
token is cancelled.

Externally requested cancellation will trigger generally bubble up the
OperationCanceledException. However, if a mutation operation has already
been sent on the wire it will instead ignore the cancellation, wait for
the result, and bubble that exception.

Timeout based cancellations will now correctly bubble up Ambiguious or
Unambiguous timeout exceptions based on whether the operation was a
mutation and if the operation has been sent on the wire.

CouchbaseCollection now correctly applies timeouts when an external
cancellation token is supplied. Previously, the external token
superceded timeouts.

Timeout/cancellation behavior: https://gist.github.com/brantburnett/7a562876b1d53015310ce38b69da18d7

Change-Id: Icf181739354409df389f173dc542c663b03d66d0
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/142715
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7cc1ea3f Fri Jan 08 05:18:26 UTC 2021 Jeff Morris <jeffry.morris@couchbase.com> NCBC-2782: Replica methods randomly completed with NotMyVBucket

Motivation
----------
Fixes a bug where replica reads may timeout after a series of
NotMyVBucket responses from the server.

Modifications
-------------
- Add IsReplicaRead flag to IOperation and set to true for ReplicaRead
implementation; the rest of the operations get false. This is more
performant than checking the Type of the operation at run time.
- In CouchbaseBucket.SendAsync use this flag to determine which mthod
to call to resolve the endpoint.

Result
------
The replica endpoint will properly be used if ReplicaRead is the
operation and there are replicas.

Change-Id: I4407deb98d8a99b5874019e26ca60abbb21dffa5
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/143017
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Brant Burnett <bburnett@centeredgesoftware.com>
Reviewed-by: <richard.ponton@couchbase.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DMutationOperationBase'.csdiff fc440704 Tue Dec 29 05:53:48 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> NCBC-2722: Refactor K/V cancellation tokens and timeouts

Motivation
----------
Currently, cancellation tokens are registered to set the IOperation to
canceled in multiple spots, which is inefficient, disorganized, and
causes excess heap allocations.

Additionally, some of the registrations related to bootstrapping are
linked to the CancellationTokenSource of the DataFlowConnectionPool,
preventing garbage collection of the the registrations and the boostrap
operations.

It is also conceivable that a cancellation token from a previous
operation attempt could be triggered while in a subsequent attempt, and
it would then mark the operation cancelled. This probably isn't an issue
now given the retry structure but could cause problems in future design
iterations.

Timeouts are not currently handled in a way that matches the RFC, and
there is some inconsistency in how exceptions are bubbled up for
externally requested cancellations versus timeouts. There is also the
possibility of creating unnecessary ambiguity in mutation state when
requesting external cancellation of a mutation operation.

Modifications
-------------
Change cancellation token logic for sending operations to be defined as
only cancelling the send, not the IOperation. This removes token
registration from both the DataFlowConnectionPool
and OperationBase.SendAsync.

Pass the CancellationToken through to IConnection.SendAsync so the
actual send may be cancelled if it is still queued on the Socket,
rather than only being cancellable while in the connection pool queue.

Instead, register the cancellation token, if any, wherever
IOperation.Completed is being awaited. That way it may dispose of the
registration after the operation is completed, regardless of how it
completes. There are two such locations in ClusterNode and in
SaslMechanismBase.

Make the logic in AsyncState a bit smarter so that it may not be
completed more than once from multiple threads.

For K/V operations, pass CancellationTokenPair from CouchbaseCollection
down the stack through to ClusterNode.ExecuteAsync. This allows smart
behaviors in ClusterNode.ExecuteAsync and RetryOrchestrator so that
internal timeout OperationCanceledExceptions can be differentiated from
exceptions triggered by external cancellation.

Results
-------
Cleaner and easier to understand cancellation logic for operations,
which is also more efficient.

Bootstrap operations aren't left dangling and holding heap space.

Retries won't accidentally get marked cancelled if a previous attempt's
token is cancelled.

Externally requested cancellation will trigger generally bubble up the
OperationCanceledException. However, if a mutation operation has already
been sent on the wire it will instead ignore the cancellation, wait for
the result, and bubble that exception.

Timeout based cancellations will now correctly bubble up Ambiguious or
Unambiguous timeout exceptions based on whether the operation was a
mutation and if the operation has been sent on the wire.

CouchbaseCollection now correctly applies timeouts when an external
cancellation token is supplied. Previously, the external token
superceded timeouts.

Timeout/cancellation behavior: https://gist.github.com/brantburnett/7a562876b1d53015310ce38b69da18d7

Change-Id: Icf181739354409df389f173dc542c663b03d66d0
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/142715
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DObserve.csdiff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DOperationBase.csdiff fc440704 Tue Dec 29 05:53:48 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> NCBC-2722: Refactor K/V cancellation tokens and timeouts

Motivation
----------
Currently, cancellation tokens are registered to set the IOperation to
canceled in multiple spots, which is inefficient, disorganized, and
causes excess heap allocations.

Additionally, some of the registrations related to bootstrapping are
linked to the CancellationTokenSource of the DataFlowConnectionPool,
preventing garbage collection of the the registrations and the boostrap
operations.

It is also conceivable that a cancellation token from a previous
operation attempt could be triggered while in a subsequent attempt, and
it would then mark the operation cancelled. This probably isn't an issue
now given the retry structure but could cause problems in future design
iterations.

Timeouts are not currently handled in a way that matches the RFC, and
there is some inconsistency in how exceptions are bubbled up for
externally requested cancellations versus timeouts. There is also the
possibility of creating unnecessary ambiguity in mutation state when
requesting external cancellation of a mutation operation.

Modifications
-------------
Change cancellation token logic for sending operations to be defined as
only cancelling the send, not the IOperation. This removes token
registration from both the DataFlowConnectionPool
and OperationBase.SendAsync.

Pass the CancellationToken through to IConnection.SendAsync so the
actual send may be cancelled if it is still queued on the Socket,
rather than only being cancellable while in the connection pool queue.

Instead, register the cancellation token, if any, wherever
IOperation.Completed is being awaited. That way it may dispose of the
registration after the operation is completed, regardless of how it
completes. There are two such locations in ClusterNode and in
SaslMechanismBase.

Make the logic in AsyncState a bit smarter so that it may not be
completed more than once from multiple threads.

For K/V operations, pass CancellationTokenPair from CouchbaseCollection
down the stack through to ClusterNode.ExecuteAsync. This allows smart
behaviors in ClusterNode.ExecuteAsync and RetryOrchestrator so that
internal timeout OperationCanceledExceptions can be differentiated from
exceptions triggered by external cancellation.

Results
-------
Cleaner and easier to understand cancellation logic for operations,
which is also more efficient.

Bootstrap operations aren't left dangling and holding heap space.

Retries won't accidentally get marked cancelled if a previous attempt's
token is cancelled.

Externally requested cancellation will trigger generally bubble up the
OperationCanceledException. However, if a mutation operation has already
been sent on the wire it will instead ignore the cancellation, wait for
the result, and bubble that exception.

Timeout based cancellations will now correctly bubble up Ambiguious or
Unambiguous timeout exceptions based on whether the operation was a
mutation and if the operation has been sent on the wire.

CouchbaseCollection now correctly applies timeouts when an external
cancellation token is supplied. Previously, the external token
superceded timeouts.

Timeout/cancellation behavior: https://gist.github.com/brantburnett/7a562876b1d53015310ce38b69da18d7

Change-Id: Icf181739354409df389f173dc542c663b03d66d0
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/142715
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7cc1ea3f Fri Jan 08 05:18:26 UTC 2021 Jeff Morris <jeffry.morris@couchbase.com> NCBC-2782: Replica methods randomly completed with NotMyVBucket

Motivation
----------
Fixes a bug where replica reads may timeout after a series of
NotMyVBucket responses from the server.

Modifications
-------------
- Add IsReplicaRead flag to IOperation and set to true for ReplicaRead
implementation; the rest of the operations get false. This is more
performant than checking the Type of the operation at run time.
- In CouchbaseBucket.SendAsync use this flag to determine which mthod
to call to resolve the endpoint.

Result
------
The replica endpoint will properly be used if ReplicaRead is the
operation and there are replicas.

Change-Id: I4407deb98d8a99b5874019e26ca60abbb21dffa5
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/143017
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Brant Burnett <bburnett@centeredgesoftware.com>
Reviewed-by: <richard.ponton@couchbase.com>
diff 63f3c266 Sun Dec 06 16:52:08 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> 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>
diff 7f02f123 Wed Feb 19 17:21:46 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> NCBC-2392: Reduce heap allocations around MultiplexingConnection async state

Motivation
----------
Improve key/value operation performance by reducing the number of
objects allocated on the heap for each operation.

Modifications
-------------
Change completion callback to take the IMemoryOwner<byte> and
ResponseStatus directly (these were the only properties of
SocketAsyncState being used). Drop the SocketAsyncState class.

Move tracking of in-flight operations to the new InFlightOperationSet
class. As part of this move, change the operation timeout system to
reference a member directly instead of a lambda.

Rework AsyncState's TaskCompletionSource to be allocated on demand only.
Drop the IState interface, as there is only one implementation. Also
drop the creation of Exception objects on state.

Results
-------
The heap allocation to build SocketAsyncState on every operation upon
completion has been eliminated.

The closure of the timer lambda no longer results in a heap allocation
on every operation.

Most operations will never allocate an extra TaskCompletionSource in
AsyncState, since the CompletionTask property is only used during
graceful shutdown of connections.

Management of in-flight states is better contained in its own class,
with supporting unit tests.

Dropping the use of the IState interface will provide a marginal
improvement since use of a virtual method table is no longer required
when calling AsyncState.Complete.

Change-Id: I7e298db39174a59bef23c767e4397e48655c42a8
Reviewed-on: http://review.couchbase.org/122531
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DPrepend.csdiff 63f3c266 Sun Dec 06 16:52:08 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DTouch.csdiff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DUnlock.csdiff fc440704 Tue Dec 29 05:53:48 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> NCBC-2722: Refactor K/V cancellation tokens and timeouts

Motivation
----------
Currently, cancellation tokens are registered to set the IOperation to
canceled in multiple spots, which is inefficient, disorganized, and
causes excess heap allocations.

Additionally, some of the registrations related to bootstrapping are
linked to the CancellationTokenSource of the DataFlowConnectionPool,
preventing garbage collection of the the registrations and the boostrap
operations.

It is also conceivable that a cancellation token from a previous
operation attempt could be triggered while in a subsequent attempt, and
it would then mark the operation cancelled. This probably isn't an issue
now given the retry structure but could cause problems in future design
iterations.

Timeouts are not currently handled in a way that matches the RFC, and
there is some inconsistency in how exceptions are bubbled up for
externally requested cancellations versus timeouts. There is also the
possibility of creating unnecessary ambiguity in mutation state when
requesting external cancellation of a mutation operation.

Modifications
-------------
Change cancellation token logic for sending operations to be defined as
only cancelling the send, not the IOperation. This removes token
registration from both the DataFlowConnectionPool
and OperationBase.SendAsync.

Pass the CancellationToken through to IConnection.SendAsync so the
actual send may be cancelled if it is still queued on the Socket,
rather than only being cancellable while in the connection pool queue.

Instead, register the cancellation token, if any, wherever
IOperation.Completed is being awaited. That way it may dispose of the
registration after the operation is completed, regardless of how it
completes. There are two such locations in ClusterNode and in
SaslMechanismBase.

Make the logic in AsyncState a bit smarter so that it may not be
completed more than once from multiple threads.

For K/V operations, pass CancellationTokenPair from CouchbaseCollection
down the stack through to ClusterNode.ExecuteAsync. This allows smart
behaviors in ClusterNode.ExecuteAsync and RetryOrchestrator so that
internal timeout OperationCanceledExceptions can be differentiated from
exceptions triggered by external cancellation.

Results
-------
Cleaner and easier to understand cancellation logic for operations,
which is also more efficient.

Bootstrap operations aren't left dangling and holding heap space.

Retries won't accidentally get marked cancelled if a previous attempt's
token is cancelled.

Externally requested cancellation will trigger generally bubble up the
OperationCanceledException. However, if a mutation operation has already
been sent on the wire it will instead ignore the cancellation, wait for
the result, and bubble that exception.

Timeout based cancellations will now correctly bubble up Ambiguious or
Unambiguous timeout exceptions based on whether the operation was a
mutation and if the operation has been sent on the wire.

CouchbaseCollection now correctly applies timeouts when an external
cancellation token is supplied. Previously, the external token
superceded timeouts.

Timeout/cancellation behavior: https://gist.github.com/brantburnett/7a562876b1d53015310ce38b69da18d7

Change-Id: Icf181739354409df389f173dc542c663b03d66d0
Reviewed-on: http://review.couchbase.org/c/couchbase-net-client/+/142715
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
/Couchbase_NET_Client_v3.0/src/Couchbase/Core/IO/Operations/Authentication/
H A DSaslList.csdiff 63f3c266 Sun Dec 06 16:52:08 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DSaslStart.csdiff 63f3c266 Sun Dec 06 16:52:08 UTC 2020 Brant Burnett <bburnett@centeredgesoftware.com> 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
H A DSelectBucket.csdiff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
/Couchbase_NET_Client_v3.0/src/Couchbase/Core/IO/Operations/EnhancedDurability/
H A DObserveSeqno.csdiff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7c9cf8a7 Thu Aug 11 12:08:03 UTC 2016 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1168: Resolve compiler warnings

MOTIVATION
----------
There are ~100 compiler warnings when building the solution. There are
made up from a mix of using depreciated enums & classes, unused variables
and others. We should not have any compiler warnings.

MODIFICATIONS
-------------
- Use #pragma keywords to ignore internal depreciated class and enum
usage
- Remove usunued variables
- Remove > -1 checks against uint properties
- Convert backing fields to auto properties
- Stored the output of TryRemove out param into a local variable instead
of the variable that was under lock
- Replace usage of ManualByteConverter with DefaultConverter
- Removed overriden Id property in DocumentFramgent`.cs
- Make ObserveSeqno.cs Id property override instead of virtual

RESULT
------
All related warnings are no longer present during build.

NOTE: The was one unusual build warning in Couchbase.IO.ConnectionPool.cs
line 275 that needed a code change. The warning is because the object used
in the synchronisation lock command is being modified during the lock. I
fixed this by assigning the output param from the
ConcurrentDictionary.TryGet to a local variable instead of to the main conn
variable.

Change-Id: Iceb6d21acff0b113b8c99ddd3a091a773423e556
Reviewed-on: http://review.couchbase.org/66723
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
Tested-by: Jeffry Morris <jeffrymorris@gmail.com>
/Couchbase_NET_Client_v3.0/src/Couchbase/Utils/
H A DExceptionUtil.csdiff 7d8db365 Tue Oct 03 14:25:48 UTC 2017 Mike Goldsmith <goldsmith.mike@gmail.com> NCBC-1524: Add missing license information

MOTIVATION
----------
All files in the Couchbase SDK should have appropriate license
information. This is done using a LICENSE file in the root of the
repository and each file should have a region at the end with
license details.

MODIFICATIONS
-------------
- add LICENSE file to root of repository with license information
- add missing license region to all files in Couchbase project

RESULT
------
License information is now available both through a LICENSE file in the
root of the repository and in each file in the Couchbase project.

Change-Id: I271da98ef2d5491ed2e12f547397833a075c9e8f
Reviewed-on: http://review.couchbase.org/83959
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jeffry Morris <jeffrymorris@gmail.com>
diff 7c7b59a0 Wed Feb 08 16:31:06 UTC 2017 MikeGoldsmith <goldsmith.mike@gmail.com> NCBC-1249: Add Analytics Query Support as Uncommitted

MOTIVATION
----------
An upcoming server feature will be Couchbase Analytics (CBAS). This is a
new service with an API very similar to the N1QL API. This is the first
commit to introduce the new Analytics bucket level queries.

MODIFICATIONS
-------------
- Add AnalyticsRequest, AnalyticsResult with supporting interfaces and
data mapping classes
- Add Query and QueryAsync methods to Bucket, and supporting
implementations
- Extend Configuration to support retrieving an Analytics service URIs
- Add basic tests to illustrate usage

RESULT
------
It is possible to submit an analytics query via an IBucket. Only simple
queries are possible right now.

NOTES:
Analytics requests currently do not support:
- Positional or named parameters
- Prepared statements and/or caching
- Cluster level querying
- The query endpoint is always enabled, and uses hardcoded ports 8095
or 18095 for SSL

Change-Id: I934b75d5edb77b4bc490eb7482d78ac6d0940453
Reviewed-on: http://review.couchbase.org/73315
Tested-by: Mike Goldsmith <goldsmith.mike@gmail.com>
Reviewed-by: Mike Goldsmith <goldsmith.mike@gmail.com>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7eff8cd8 Fri Aug 12 09:09:33 UTC 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 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>
diff 7fff341f Tue Jan 12 01:36:57 UTC 2016 jeffrymorris <jeffrymorris@gmail.com> NCBC-1057: Don't fail fast when service is unavailable

Motivation
----------
If the cluster does not contain a candidate node for a client request
(data, index, query) instead of failing fast, the client should return
back a failed response with a ServiceUnavailableException populating the
IRequest.Exception field.

Modifications
-------------
Modified the appropriate methods for each request type to return the
ServiceUnavailableException rather than throw the exception.

Result
------
In certain situations such a node swap, returning the exception is preferable
to throwing an exception since the failure likely temporary and the node will
soon be back online.

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

Completed in 210 milliseconds