@Override
public Observable<Boolean> flush() {
final String markerKey = "__flush_marker";
return core
.send(new UpsertRequest(markerKey, Unpooled.copiedBuffer(markerKey, CharsetUtil.UTF_8), bucket))
.flatMap(new Func1<CouchbaseResponse, Observable<FlushResponse>>() {
@Override
public Observable<FlushResponse> call(CouchbaseResponse res) {
return core.send(new FlushRequest(bucket, password));
}