New Features and Behaviour Changes in 1.1-dp2
The set() and
delete() methods now support the
ability to observe the persistence on the master and replicas.
Using these methods, it's possible to set the persistence
requirements for the data on the nodes.
These methods are supported in Couchbase server build 1554 or higher.
The persistence requirements can be specified in terms of how
the data should be persisted on the master and the replicas
using PeristTo and
ReplicateTo respectively.
The client library will poll the server until the persistence requirements are met. The method will return FALSE if the requirments are impossible to meet based on the configuration (inadequate number of replicas) or even after a set amount of retries the persistence requirments could not be met.
The program snippet below illustrates how to specify a requirement that the data should be persisted on 4 nodes (master and three replicas).
// Perist to all four nodes including master OperationFuture<Boolean> setOp = c.set("key", 0, "value", PersistTo.FOUR); System.out.printf("Result was %b", setOp.get());
The program snippet below illustrates how to specify a requirement that the data deletion should be persisted on 4 nodes (master and three replicas).
// Perist of delete to all four nodes including master OperationFuture<Boolean> deleteOp = c.delete("key", PersistTo.FOUR); System.out.printf("Result was %b",deleteOp.get());
The program snippet below illustrates how to specify a requirement that the data deletion should be persisted on 4 nodes (master and three replicas).
// Perist of delete to all four nodes including master OperationFuture<Boolean> deleteOp = c.delete("key", PersistTo.FOUR); System.out.printf("Result was %b",deleteOp.get());
The peristence requirements can be specified for both the master and replicas. In the case above, it's required that the key and value is persisted on all the 4 nodes (including replicas).
The same persistence requirment can be specified in a slightly different form as below.
// Perist to master and three replicas OperationFuture<Boolean> setOp = c.set("key", 0, "value", PersistTo.MASTER, ReplicateTo.THREE); System.out.printf("Result was %b", setOp.get());
The same persistence requirment can be specified in a slightly different form as below.
// Perist of delete to master and three replicas OperationFuture<Boolean> deleteOp = c.delete("key", PersistTo.MASTER, ReplicateTo.THREE); System.out.printf("Result was %b", deleteOp.get());
The Java client library throws exception for non-200 http view responses.
Issues: JCBC-72
The issue is now fixed.
Issues: JCBC-20
The Getting Started has a brief explanation of JSON and has a simple example of persisting JSON data.
Issues: JCBC-97
This issue is now fixed.
Issues: JCBC-68
This issue is now fixed.
Issues: JCBC-69
unlock() method does not check for server errors. The method should check for the error and raise an exception.
Issues: SPY-97