當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。