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


Java U.convertException方法代码示例

本文整理汇总了Java中org.apache.ignite.internal.util.typedef.internal.U.convertException方法的典型用法代码示例。如果您正苦于以下问题:Java U.convertException方法的具体用法?Java U.convertException怎么用?Java U.convertException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.ignite.internal.util.typedef.internal.U的用法示例。


在下文中一共展示了U.convertException方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deployKeyAffinitySingleton

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void deployKeyAffinitySingleton(String name, Service svc, @Nullable String cacheName,
    Object affKey) {
    A.notNull(name, "name");
    A.notNull(svc, "svc");
    A.notNull(affKey, "affKey");

    guard();

    try {
        saveOrGet(ctx.service().deployKeyAffinitySingleton(name, svc, cacheName, affKey));
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:IgniteServicesImpl.java

示例2: affinityRunAsync0

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Affinity run implementation.
 *
 * @param cacheName Cache name.
 * @param affKey Affinity key.
 * @param job Job.
 * @return Internal future.
 */
private IgniteInternalFuture<?> affinityRunAsync0(String cacheName, Object affKey, IgniteRunnable job) {
    A.notNull(affKey, "affKey");
    A.notNull(job, "job");

    guard();

    try {
        // In case cache key is passed instead of affinity key.
        final Object affKey0 = ctx.affinity().affinityKey(cacheName, affKey);
        int partId = ctx.affinity().partition(cacheName, affKey0);

        if (partId < 0)
            throw new IgniteCheckedException("Failed map key to partition: [cache=" + cacheName + " key="
                + affKey + ']');

        return ctx.closure().affinityRun(Collections.singletonList(cacheName), partId, job, prj.nodes(), execName);
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:33,代码来源:IgniteComputeImpl.java

示例3: pingNode

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public boolean pingNode(UUID nodeId) {
    A.notNull(nodeId, "nodeId");

    guard();

    try {
        return ctx.discovery().pingNode(nodeId);
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:IgniteClusterImpl.java

示例4: commit

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void commit() {
    enter();

    try {
        IgniteInternalFuture<IgniteInternalTx> commitFut = cctx.commitTxAsync(tx);

        if (async)
            saveFuture(commitFut);
        else
            commitFut.get();
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        leave();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:TransactionProxyImpl.java

示例5: countDownLatch

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Nullable @Override public IgniteCountDownLatch countDownLatch(String name,
    int cnt,
    boolean autoDel,
    boolean create) {
    guard();

    try {
        checkClusterState();

        return ctx.dataStructures().countDownLatch(name, null, cnt, autoDel, create);
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:20,代码来源:IgniteKernal.java

示例6: get

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public long get() {
    checkRemoved();

    try {
        GridCacheAtomicLongValue val = cacheView.get(key);

        if (val == null)
            throw new IgniteException("Failed to find atomic long: " + name);

        return val.get();
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:GridCacheAtomicLongImpl.java

示例7: affinityCallAsync0

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/**
 * Affinity call implementation.

 * @param cacheName Cache name.
 * @param affKey Affinity key.
 * @param job Job.
 * @return Internal future.
 */
private <R> IgniteInternalFuture<R> affinityCallAsync0(String cacheName, Object affKey,
    IgniteCallable<R> job) {
    A.notNull(affKey, "affKey");
    A.notNull(job, "job");

    guard();

    try {
        // In case cache key is passed instead of affinity key.
        final Object affKey0 = ctx.affinity().affinityKey(cacheName, affKey);
        int partId = ctx.affinity().partition(cacheName, affKey0);

        if (partId < 0)
            throw new IgniteCheckedException("Failed map key to partition: [cache=" + cacheName + " key="
                + affKey + ']');

        return ctx.closure().affinityCall(Collections.singletonList(cacheName), partId, job, prj.nodes(), execName);
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:34,代码来源:IgniteComputeImpl.java

示例8: pingNodeByAddress

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public boolean pingNodeByAddress(String host) {
    guard();

    try {
        for (ClusterNode n : cluster().nodes())
            if (n.addresses().contains(host))
                return ctx.discovery().pingNode(n.id());

        return false;
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:19,代码来源:IgniteKernal.java

示例9: run

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override protected VisorCacheSqlMetadata run(VisorCacheMetadataTaskArg arg) {
    try {
        IgniteInternalCache<Object, Object> cache = ignite.cachex(arg.getCacheName());

        if (cache != null) {
            GridCacheSqlMetadata meta = F.first(cache.context().queries().sqlMetadata());

            if (meta != null)
                return new VisorCacheSqlMetadata(meta);

            return null;
        }

        throw new IgniteException("Cache not found: " + escapeName(arg.getCacheName()));
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:21,代码来源:VisorCacheMetadataTask.java

示例10: get

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public T get() {
    checkRemoved();

    try {
        GridCacheAtomicReferenceValue<T> ref = cacheView.get(key);

        if (ref == null)
            throw new IgniteCheckedException("Failed to find atomic reference with given name: " + name);

        return ref.get();
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:GridCacheAtomicReferenceImpl.java

示例11: localQuery

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public <T extends Event> Collection<T> localQuery(IgnitePredicate<T> p, @Nullable int... types) {
    A.notNull(p, "p");

    guard();

    try {
        return ctx.event().localEvents(compoundPredicate(p, types));
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:17,代码来源:IgniteEventsImpl.java

示例12: cancelAll

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void cancelAll(Collection<String> names) {
    guard();

    try {
        saveOrGet(ctx.service().cancelAll(names));
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        unguard();
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:15,代码来源:IgniteServicesImpl.java

示例13: availablePermits

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public int availablePermits() {
    ctx.kernalContext().gateway().readLock();

    int ret;
    try {
        initializeSemaphore();

        ret = retryTopologySafe(new Callable<Integer>() {
            @Override public Integer call() throws Exception {
                try (
                    GridNearTxLocal tx = CU.txStartInternal(ctx,
                        cacheView, PESSIMISTIC, REPEATABLE_READ)
                ) {
                    GridCacheSemaphoreState val = cacheView.get(key);

                    if (val == null)
                        throw new IgniteException("Failed to find semaphore with given name: " + name);

                    int cnt = val.getCount();

                    tx.rollback();

                    return cnt;
                }
            }
        });
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
    finally {
        ctx.kernalContext().gateway().readUnlock();
    }

    return ret;
}
 
开发者ID:apache,项目名称:ignite,代码行数:38,代码来源:GridCacheSemaphoreImpl.java

示例14: close

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void close() {
    if (!rmvd) {
        try {
            ctx.kernalContext().dataStructures().removeCountDownLatch(name, ctx.group().name());
        }
        catch (IgniteCheckedException e) {
            throw U.convertException(e);
        }
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:12,代码来源:GridCacheCountDownLatchImpl.java

示例15: run

import org.apache.ignite.internal.util.typedef.internal.U; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override public void run(Collection<? extends IgniteRunnable> jobs) {
    try {
        saveOrGet(runAsync0(jobs));
    }
    catch (IgniteCheckedException e) {
        throw U.convertException(e);
    }
}
 
开发者ID:apache,项目名称:ignite,代码行数:10,代码来源:IgniteComputeImpl.java


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