final PersistTo persistTo, final ReplicateTo replicateTo) {
return Observable.defer(new Func0<Observable<ObserveResponse>>() {
@Override
public Observable<ObserveResponse> call() {
return core
.<GetClusterConfigResponse>send(new GetClusterConfigRequest())
.map(new Func1<GetClusterConfigResponse, Integer>() {
@Override
public Integer call(GetClusterConfigResponse response) {
CouchbaseBucketConfig conf = (CouchbaseBucketConfig) response.config().bucketConfig(bucket);
return conf.numberOfReplicas();