本文整理了Java中rx.Observable.countLong()
方法的一些代码示例,展示了Observable.countLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Observable.countLong()
方法的具体详情如下:
包路径:rx.Observable
类名称:Observable
方法名:countLong
暂无
代码示例来源:origin: apache/usergrid
@Override
public long performEntityCount() {
//TODO, this really needs to be a task that writes this data somewhere since this will get
//progressively slower as the system expands
return (Long) getAllEntitiesObservable().countLong().toBlocking().last();
}
代码示例来源:origin: apache/usergrid
}, 10 );
observable.countLong().toBlocking().last();
代码示例来源:origin: apache/usergrid
@Override
public Long call() throws Exception {
GraphManager gm = factory.createEdgeManager( scope );
while ( !Thread.currentThread().isInterrupted() ) {
//do a read to eventually trigger our group compaction. Take 2 pages of columns
final long returnedEdgeCount = generator.doSearch( gm )
.doOnNext( edge -> readMeter.mark() )
.countLong().toBlocking().last();
logger.info( "Completed reading {} edges", returnedEdgeCount );
if ( writeCount != returnedEdgeCount ) {
logger.warn( "Unexpected edge count returned!!! Expected {} but was {}", writeCount,
returnedEdgeCount );
}
assertEquals( "Expected to read same edge count", writeCount, returnedEdgeCount );
}
return 0L;
}
}
代码示例来源:origin: apache/usergrid
})
.flatMap( edge -> manager.markEdge( edge ))
.flatMap( edge -> manager.deleteEdge( edge ) ).countLong().toBlocking().last();
代码示例来源:origin: apache/usergrid
})
.flatMap( edge -> manager.markEdge( edge ))
.flatMap( edge -> manager.deleteEdge( edge ) ).countLong().toBlocking().last();
.countLong().toBlocking().last();
.countLong().toBlocking().last();
代码示例来源:origin: com.netflix.eureka/eureka2-core
@Override
public Observable<Long> evictAllExcept(final Source.SourceMatcher retainMatcher) {
return getHolders()
.doOnNext(new Action1<MultiSourcedDataHolder<InstanceInfo>>() {
@Override
public void call(MultiSourcedDataHolder<InstanceInfo> holder) {
for (Source source : holder.getAllSources()) {
if (!retainMatcher.match(source)) {
holder.remove(source).subscribe(new NoOpSubscriber<MultiSourcedDataHolder.Status>());
}
}
}
})
.countLong()
.doOnError(new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
logger.error("Error evicting registry", throwable);
}
})
.doOnCompleted(new Action0() {
@Override
public void call() {
logger.info("Completed evicting registry");
}
});
}
代码示例来源:origin: com.netflix.eureka/eureka2-core
/**
* Evict by sending to the evictionQueue instead of directly.
*/
@Override
public Observable<Long> evictAllExcept(final Source.SourceMatcher retainMatcher) {
return eurekaRegistry.getHolders()
.doOnNext(new Action1<MultiSourcedDataHolder<InstanceInfo>>() {
@Override
public void call(MultiSourcedDataHolder<InstanceInfo> holder) {
for (Source source : holder.getAllSources()) {
if (!retainMatcher.match(source)) {
evictionQueue.add(holder.get(source), source);
}
}
}
})
.countLong()
.doOnError(new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
logger.error("Error adding items to eviction queue", throwable);
}
})
.doOnCompleted(new Action0() {
@Override
public void call() {
logger.info("Completed adding items to eviction queue");
}
});
}
内容来源于网络,如有侵权,请联系作者删除!