本文整理汇总了Java中com.hazelcast.core.IList.get方法的典型用法代码示例。如果您正苦于以下问题:Java IList.get方法的具体用法?Java IList.get怎么用?Java IList.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.core.IList
的用法示例。
在下文中一共展示了IList.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sourceList
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Test
public void sourceList() throws InterruptedException {
IStreamList<Integer> list = getList();
fillList(list);
IList<Integer> result = list
.stream()
.filter(f -> f < 100)
.collect(DistributedCollectors.toIList(randomString()));
assertEquals(100, result.size());
for (int i = 0; i < 100; i++) {
int val = result.get(i);
assertEquals(i, val);
}
}
示例2: execute
import com.hazelcast.core.IList; //导入方法依赖的package包/类
private static <T> Optional<T> execute(StreamContext context, DAG dag, Vertex combiner) {
String listName = uniqueListName();
Vertex writeList = dag.newVertex("write-" + listName, SinkProcessors.writeListP(listName));
dag.edge(between(combiner, writeList));
IList<T> list = context.getJetInstance().getList(listName);
executeJob(context, dag);
if (list.isEmpty()) {
list.destroy();
return Optional.empty();
}
T result = list.get(0);
list.destroy();
return Optional.of(result);
}
示例3: execute
import com.hazelcast.core.IList; //导入方法依赖的package包/类
static <A, R> R execute(StreamContext context, DAG dag, Vertex combiner, Function<A, R> finisher) {
String listName = uniqueListName();
Vertex writer = dag.newVertex("write-" + listName, SinkProcessors.writeListP(listName));
dag.edge(between(combiner, writer));
executeJob(context, dag);
IList<A> list = context.getJetInstance().getList(listName);
A result = list.get(0);
list.destroy();
return finisher.apply(result);
}