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(fieldName); } catch (Exception e) { exceptions.add(e); } } ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions); }
/** * 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); } }
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); }
/** * 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); }
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); } }
ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions); if (files.size() > 0) {
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(fieldName); } catch (Exception e) { exceptions.add(e); } } ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions); }
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); }
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(fieldName); } catch (Exception e) { exceptions.add(e); } } ExceptionsHelper.maybeThrowRuntimeAndSuppress(exceptions); }
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); }
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); }
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); }
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); }
/** * 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); } }
/** * 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); } }
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); }
/** * 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); } }
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); } }
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); } }
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); } }