简体   繁体   English

不存在类型变量U的实例,因此Row符合Iterable <? extends U>

[英]no instance(s) of type variable(s) U exists so that Row conforms to Iterable<? extends U>

I have a method that returns an Observable of ResultSet: 我有一个返回ResultSet的Observable的方法:

public static Observable<ResultSet> queryAllAsObservable(Session session, String query, Object... partitionKeys) {
    List<ResultSetFuture> futures = sendQueries(session, query, partitionKeys);
    Scheduler scheduler = Schedulers.io();
    List<Observable<ResultSet>> observables = Lists.transform(futures, (ResultSetFuture future) -> Observable.fromFuture(future, scheduler));
    return Observable.merge(observables);
}

Now I need to create a version of this method that returns an Observable of Row instead. 现在,我需要创建此方法的版本,而不是返回一个Observable of Row。 This is what I've tried: 这是我尝试过的:

public static Observable<Row> queryAllAsRowObservable(Session session, String query, Object... partitionKeys) {
    List<ResultSetFuture> futures = sendQueries(session, query, partitionKeys);
    Scheduler scheduler = Schedulers.io();
    List<Observable<ResultSet>> observables = Lists.transform(futures, (ResultSetFuture future) -> Observable.fromFuture(future, scheduler));
    return Observable.merge(observables).flatMapIterable(item -> item.one());
}

But item -> item.one() is marked by an error: 但是item -> item.one()被错误标记:

no instance(s) of type variable(s) U exists so that Row conforms to Iterable<? extends U>

flatMapIterable has the wrong type for what you're trying to do at the point you're trying to do it. 在您尝试执行此操作时, flatMapIterable的类型错误。 You could use map instead of flatMapIterable , or reconsider your use of merge . 您可以使用map代替flatMapIterable ,或者重新考虑使用merge

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不存在类型变量 U 的实例,因此 Foo 符合 CompletionStage - no instance(s) of type variable(s) U exist so that Foo conforms to CompletionStage<U> 不存在类型变量 U 的实例,因此 void 符合 U - No instance(s) of type variable(s) U exist so that void conforms to U 不存在类型变量U的实例,因此Optional <U>符合Response</u> - No instance(s) of type variable(s) U exist so that Optional<U> conforms to Response Comparator - thenComparing() 方法产生'不存在 U 类型变量的实例,因此 Object 符合 Comparable<!--? super U--> ' - Comparator - thenComparing() method produces 'no instance(s) of type variable(s) U exist so that Object conforms to Comparable<? super U>' Decimal128 的排序问题 | 不存在类型变量 U 的实例,因此 Decimal128 符合 Comparable<!--? super U--> - Sorting issue for Decimal128 | no instance(s) of type variable(s) U exist so that Decimal128 conforms to Comparable<? super U> Webflux 错误 - 不存在类型变量 R 的实例,因此 Flux<uuid> 符合 Mono&lt;&gt;</uuid> - Webflux error - no instance(s) of type variable(s) R exists so that Flux<UUID> conforms to Mono<> 不存在类型变量的实例,因此T符合注释 - No instance(s) of type variable(s) exist so that T conforms to Annotation Java 错误:不兼容的类型:不存在类型变量 T 的实例,因此可选<t>符合 Iterable<availablelicence></availablelicence></t> - Java error: incompatible types: no instance(s) of type variable(s) T exist so that Optional<T> conforms to Iterable<AvailableLicence> 编译时间:没有类型变量的实例U存在 - compile time: no instance(s) of type variable(s) U exist 不存在类型变量 V 的实例,因此 ExpectedCondition<Boolean> 符合功能<? super WebDriver, V> - No instance(s) of type variable(s) V exist so that ExpectedCondition<Boolean> conforms to Function<? super WebDriver, V>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM