本文整理汇总了Java中com.hazelcast.core.IList.destroy方法的典型用法代码示例。如果您正苦于以下问题:Java IList.destroy方法的具体用法?Java IList.destroy怎么用?Java IList.destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.core.IList
的用法示例。
在下文中一共展示了IList.destroy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toArray
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public double[] toArray() {
IList<Double> list = inner.collect(DistributedCollectors.toIList(uniqueListName()));
try {
double[] array = new double[list.size()];
int index = 0;
for (Double d : list) {
array[index++] = d;
}
return array;
} finally {
list.destroy();
}
}
示例2: reduce
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public Boolean reduce(StreamContext context, Pipe<? extends T> upstream) {
String listName = uniqueListName();
DAG dag = new DAG();
Vertex previous = upstream.buildDAG(dag);
Vertex anyMatch = dag.newVertex("any-match", () -> new AnyMatchP<>(predicate));
Vertex writer = dag.newVertex("write-" + listName, SinkProcessors.writeListP(listName));
dag.edge(between(previous, anyMatch))
.edge(between(anyMatch, writer));
executeJob(context, dag);
IList<Boolean> results = context.getJetInstance().getList(listName);
boolean result = anyMatch(results);
results.destroy();
return result;
}
示例3: toArray
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public long[] toArray() {
IList<Long> list = inner.collect(DistributedCollectors.toIList(uniqueListName()));
try {
long[] array = new long[list.size()];
int index = 0;
for (Long l : list) {
array[index++] = l;
}
return array;
} finally {
list.destroy();
}
}
示例4: toArray
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public Object[] toArray() {
IList<E_OUT> list = collect(toIList(uniqueListName()));
Object[] array = list.toArray();
list.destroy();
return array;
}
示例5: findFirst
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public Optional<E_OUT> findFirst() {
IList<E_OUT> first = this.limit(1).collect(toIList(uniqueListName()));
Optional<E_OUT> value = first.size() == 0 ? Optional.empty() : Optional.of(first.get(0));
first.destroy();
return value;
}
示例6: toArray
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public int[] toArray() {
IList<Integer> list = inner.collect(DistributedCollectors.toIList(uniqueListName()));
try {
int[] array = new int[list.size()];
int index = 0;
for (Integer i : list) {
array[index++] = i;
}
return array;
} finally {
list.destroy();
}
}
示例7: 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);
}
示例8: 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);
}
示例9: destroy
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Test
public void destroy() {
HazelcastClient hClient = getHazelcastClient();
IList<Integer> list = hClient.getList("destroy");
for (int i = 0; i < 100; i++) {
assertTrue(list.add(i));
}
IList<Integer> list2 = hClient.getList("destroy");
assertTrue(list == list2);
assertTrue(list.getId().equals(list2.getId()));
list.destroy();
list2 = hClient.getList("destroy");
assertFalse(list == list2);
}
示例10: removeList
import com.hazelcast.core.IList; //导入方法依赖的package包/类
public void removeList(String name) {
DistList list = listMap.get(name);
if (list != null) {
IList ilist = (IList) list;
ilist.removeItemListener(list.getListenerId());
listMap.remove(list);
ilist.destroy();
}
}
示例11: removeList
import com.hazelcast.core.IList; //导入方法依赖的package包/类
/**
* Remove a list from the object provider.
*
* @param name
*/
@Override
public void removeList(String name) {
if (listsMap.containsKey(name)) {
if (isClustered()) {
IList list = (IList) listsMap.get(name);
listProvider.removeList(name);
list.destroy();
}
listsMap.remove(name);
}
}
示例12: forEach
import com.hazelcast.core.IList; //导入方法依赖的package包/类
@Override
public void forEach(Consumer<? super E_OUT> action) {
IList<E_OUT> list = this.collect(toIList(uniqueListName()));
list.forEach(action::accept);
list.destroy();
}