compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (9)

View Page History
h2. Java

The Java client library, and it's dependencies, will require changes to return the CAS value through the OperationStatus object.

The first approach is a synchronous (possibly the simplest from a developer viewpoint) approach
This allows specifying requirements across the cluster (2 persists and

try {
c1.set("a", client.set("a", 0 "foo", PersistTo.4); // this blocks until 4 copies persisted to disk
c1.set("b", client.set("b", 0, "foo", ReplicateTo.2); // this blocks until 2 replicas are complete
c2.add("c", 0, "foo", PersistTo.2, ReplicateTo.2); // this blocks until 2 copies persisted to disk and 2 replicas complete on cluster
client.add("c", 0, "foo", PersistTo.2, ReplicateTo.2); // this blocks until 2 copies persisted
// to disk and 2 replicas complete on cluster
client.add("d", 0, "foo", PersistTo.TWO, ReplicateTo.ONE); // throws InvalidArgumentException
} catch (ObservedException ex) {
// Warn if observe requirements are more stringent than bucket settings
{code}

Note that we likely will implement the shorthand as seen in the .NET client where one may do something like ReplicateTo.MASTER_SLAVE.

It's possible to take an asynchronous approach as well, but, the api usage becomes a bit
more involved.

The Java client library, and it's dependencies, will require changes to return the CAS value through the OperationStatus object.

The basic idea is that given the OperationStatus object (or optionally, multiple OperationStatus objects), an Observer can report on whether or not the operation has been replicated, persisted, or processed for indexing.

{code}

It's With this more complex approach, it's possible to do multiple operations asynchronously. However, the downside of this
approach is that it would not be possible to use multiple connections
(on different buckets) with different replication factors which makes it confusing.


There are pros and cons (as listed) to the different approaches. We will go with the
simplest approach with a likelihood of a course correction at some point.

h2. .NET