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


Java ExceptionsHelper.maybeThrowRuntimeAndSuppress方法代码示例

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


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

示例1: cancel

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
synchronized void cancel(IndexShard shard, String reason) {
    final ShardRecoveryContext shardRecoveryContext = ongoingRecoveries.get(shard);
    if (shardRecoveryContext != null) {
        final List<Exception> failures = new ArrayList<>();
        for (RecoverySourceHandler handlers : shardRecoveryContext.recoveryHandlers) {
            try {
                handlers.cancel(reason);
            } catch (Exception ex) {
                failures.add(ex);
            } finally {
                shard.recoveryStats().decCurrentAsSource();
            }
        }
        ExceptionsHelper.maybeThrowRuntimeAndSuppress(failures);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:PeerRecoverySourceService.java

示例2: onResponse

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
/**
 * Notifies every given listener with the response passed to {@link #onResponse(Object)}. If a listener itself throws an exception
 * the exception is forwarded to {@link #onFailure(Exception)}. If in turn {@link #onFailure(Exception)} fails all remaining
 * listeners will be processed and the caught exception will be re-thrown.
 */
static <Response> void onResponse(Iterable<ActionListener<Response>> listeners, Response response) {
    List<Exception> exceptionList = new ArrayList<>();
    for (ActionListener<Response> listener : listeners) {
        try {
            listener.onResponse(response);
        } catch (Exception ex) {
            try {
                listener.onFailure(ex);
            } catch (Exception ex1) {
                exceptionList.add(ex1);
            }
        }
    }
    ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptionList);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:21,代码来源:ActionListener.java

示例3: cancel

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
synchronized void cancel(IndexShard shard, String reason) {
    final Set<RecoverySourceHandler> shardRecoveryHandlers = ongoingRecoveries.get(shard);
    if (shardRecoveryHandlers != null) {
        final List<Exception> failures = new ArrayList<>();
        for (RecoverySourceHandler handlers : shardRecoveryHandlers) {
            try {
                handlers.cancel(reason);
            } catch (Exception ex) {
                failures.add(ex);
            } finally {
                shard.recoveryStats().decCurrentAsSource();
            }
        }
        ExceptionsHelper.maybeThrowRuntimeAndSuppress(failures);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:17,代码来源:BlobRecoverySource.java

示例4: clear

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public synchronized void clear() {
    List<Exception> exceptions = new ArrayList<>(0);
    final Collection<IndexFieldDataCache> fieldDataCacheValues = fieldDataCaches.values();
    for (IndexFieldDataCache cache : fieldDataCacheValues) {
        try {
            cache.clear();
        } catch (Exception e) {
            exceptions.add(e);
        }
    }
    fieldDataCacheValues.clear();
    ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:IndexFieldDataService.java

示例5: clearField

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public synchronized void clearField(final String fieldName) {
    List<Exception> exceptions = new ArrayList<>(0);
    final IndexFieldDataCache cache = fieldDataCaches.remove(fieldName);
    if (cache != null) {
        try {
            cache.clear();
        } catch (Exception e) {
            exceptions.add(e);
        }
    }
    ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:IndexFieldDataService.java

示例6: onFailure

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
/**
 * Notifies every given listener with the failure passed to {@link #onFailure(Exception)}. If a listener itself throws an exception
 * all remaining listeners will be processed and the caught exception will be re-thrown.
 */
static <Response> void onFailure(Iterable<ActionListener<Response>> listeners, Exception failure) {
    List<Exception> exceptionList = new ArrayList<>();
    for (ActionListener<Response> listener : listeners) {
        try {
            listener.onFailure(failure);
        } catch (Exception ex) {
            exceptionList.add(ex);
        }
    }
    ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptionList);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:ActionListener.java

示例7: clear

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public synchronized void clear() {
    parentIndexFieldData = null;
    List<Throwable> exceptions = new ArrayList<>(0);
    final Collection<IndexFieldDataCache> fieldDataCacheValues = fieldDataCaches.values();
    for (IndexFieldDataCache cache : fieldDataCacheValues) {
        try {
            cache.clear();
        } catch (Throwable t) {
            exceptions.add(t);
        }
    }
    fieldDataCacheValues.clear();
    ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:IndexFieldDataService.java

示例8: clearField

import org.elasticsearch.ExceptionsHelper; //导入方法依赖的package包/类
public synchronized void clearField(final String fieldName) {
    if (ParentFieldMapper.NAME.equals(fieldName)) {
        parentIndexFieldData = null;
    }
    List<Throwable> exceptions = new ArrayList<>(0);
    final IndexFieldDataCache cache = fieldDataCaches.remove(fieldName);
    if (cache != null) {
        try {
            cache.clear();
        } catch (Throwable t) {
            exceptions.add(t);
        }
    }
    ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:IndexFieldDataService.java


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