code: private static Observable<List<String>> createMarkerDocuments(final ClusterFacade core, final String bucket) {
          return Observable
              .from(FLUSH_MARKERS)
              .flatMap(new Func1<String, Observable<UpsertResponse>>() {
                  @Override
                  public Observable<UpsertResponse> call(final String id) {
                      return deferAndWatch(new Func1<Subscriber, Observable<? extends UpsertResponse>>() {
                          @Override
                          public Observable<? extends UpsertResponse> call(final Subscriber subscriber) {
                              UpsertRequest request = new UpsertRequest(id, Unpooled.copiedBuffer(id, CharsetUtil.UTF_8), bucket);
                              request.subscriber(subscriber);
                              return core.send(request);
                          }
                      });
                  }
              })
              .doOnNext(new Action1<UpsertResponse>() {
                  @Override
                  public void call(UpsertResponse response) {
                      if (response.content() != null && response.content().refCnt() > 0) {
                          response.content().release();
                      }
                  }
              })
              .last()
              .map(new Func1<UpsertResponse, List<String>>() {
                  @Override
                  public List<String> call(UpsertResponse response) {
                      return FLUSH_MARKERS;
                  }
              });
      }
docs: Helper method to create marker documents for each partition.
  
  @param core the core reference.
  @param bucket the name of the bucket.
  @return a list of created flush marker IDs once they are completely upserted.