code: public static Observable<Boolean> flush(final ClusterFacade core, final String bucket, final String username, final String password) {
         return createMarkerDocuments(core, bucket)
             .flatMap(new Func1<List<String>, Observable<Boolean>>() {
                 @Override
                 public Observable<Boolean> call(List<String> strings) {
                     return initiateFlush(core, bucket, username, password);
                 }
             })
             .flatMap(new Func1<Boolean, Observable<Boolean>>() {
                 @Override
                 public Observable<Boolean> call(Boolean isDone) {
                     return isDone ? Observable.just(true) : pollMarkerDocuments(core, bucket);
                 }
             });
      }
docs: Flush the bucket and make sure flush is complete before completing the observable.
  
  @param core the core reference.
  @param bucket the bucket to flush.
  @param username the user authorized for the bucket.
  @param password the password of the user.
  @return an observable which is completed once the flush process is done.