/** * Get a chunk from the store but first look into the cache of indexable chunks * @param path the chunk's path * @return the chunk */ private Single<ChunkReadStream> getChunkFromStore(String path) { Buffer chunk = IndexableChunkCache.getInstance().get(path); if (chunk != null) { return Single.just(new DelegateChunkReadStream(chunk)); } return store.rxGetOne(path); }
.map(RxStoreCursor::new) .flatMapObservable(RxStoreCursor::toObservable) .flatMapSingle(p -> store.rxGetOne(p.getRight()) .flatMap(crs -> merger.merge(crs, p.getLeft(), out)