use of org.infinispan.persistence.spi.MarshallableEntry in project wildfly by wildfly.
the class HotRodStore method batch.
@Override
public CompletionStage<Void> batch(int publisherCount, Publisher<SegmentedPublisher<Object>> removePublisher, Publisher<SegmentedPublisher<MarshallableEntry<K, V>>> writePublisher) {
Completable removeCompletable = Flowable.fromPublisher(removePublisher).flatMap(sp -> Flowable.fromPublisher(sp), publisherCount).flatMapCompletable(key -> Completable.fromCompletionStage(this.cache.removeAsync(this.marshalKey(key))), false, this.batchSize);
Completable writeCompletable = Flowable.fromPublisher(writePublisher).flatMap(sp -> Flowable.fromPublisher(sp), publisherCount).flatMapCompletable(entry -> Completable.fromCompletionStage(this.cache.putAsync(entry.getKeyBytes(), this.marshalValue(entry.getMarshalledValue()))), false, this.batchSize);
return removeCompletable.mergeWith(writeCompletable).toCompletionStage(null);
}
Aggregations