当前位置: 首页>>代码示例>>Java>>正文


Java IList.destroy方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:17,代码来源:DoublePipeline.java

示例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;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:21,代码来源:AnyMatchReducer.java

示例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();
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:16,代码来源:LongPipe.java

示例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;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:8,代码来源:AbstractPipe.java

示例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;
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:8,代码来源:AbstractPipe.java

示例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();
    }
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:16,代码来源:IntPipeline.java

示例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);
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:15,代码来源:Reducers.java

示例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);
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:11,代码来源:CollectorReducer.java

示例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);
}
 
开发者ID:mdogan,项目名称:hazelcast-archive,代码行数:15,代码来源:HazelcastClientListTest.java

示例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();
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:10,代码来源:HazelcastDistributedListProvider.java

示例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);
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:17,代码来源:HazelcastDistributedObjectProvider.java

示例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();
}
 
开发者ID:hazelcast,项目名称:hazelcast-jet,代码行数:7,代码来源:AbstractPipe.java


注:本文中的com.hazelcast.core.IList.destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。