@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (r instanceof AbstractRunnable) { if (((AbstractRunnable) r).isForceExecution()) { BlockingQueue<Runnable> queue = executor.getQueue(); if (!(queue instanceof SizeBlockingQueue)) { throw new IllegalStateException("forced execution, but expected a size queue"); } try { ((SizeBlockingQueue) queue).forcePut(r); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("forced execution, but got interrupted", e); } return; } } rejected.inc(); throw new EsRejectedExecutionException("rejected execution of " + r + " on " + executor, executor.isShutdown()); }
@Override protected void onAfterInLifecycle() { try { threadPool.schedule(pingInterval, ThreadPool.Names.GENERIC, this); } catch (EsRejectedExecutionException ex) { if (ex.isExecutorShutdown()) { logger.debug("couldn't schedule new ping execution, executor is shutting down", ex); } else { throw ex; } } }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { try { executor.getQueue().put(r); } catch (InterruptedException e) { //should never happen since we never wait throw new EsRejectedExecutionException(e); } }
@Override protected void onAfterInLifecycle() { try { threadPool.schedule(pingSchedule, ThreadPool.Names.GENERIC, this); } catch (EsRejectedExecutionException ex) { if (ex.isExecutorShutdown()) { logger.debug("couldn't schedule new ping execution, executor is shutting down", ex); } else { throw ex; } } }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { try { executor.getQueue().put(r); } catch (InterruptedException e) { //should never happen since we never wait throw new EsRejectedExecutionException(e); } }
@Override protected void onAfterInLifecycle() { try { threadPool.schedule(pingSchedule, ThreadPool.Names.GENERIC, this); } catch (EsRejectedExecutionException ex) { if (ex.isExecutorShutdown()) { logger.debug("couldn't schedule new ping execution, executor is shutting down", ex); } else { throw ex; } } }
final ElasticsearchException ex = new ElasticsearchException(this); final boolean isExecutorShutdown = readBoolean(); return (T) new EsRejectedExecutionException(ex.getMessage(), isExecutorShutdown); case 18: final boolean isExecutorShutdown = readBoolean(); return (T) readStackTrace(new EsRejectedExecutionException(readOptionalString(), isExecutorShutdown), this); default: throw new IOException("no such exception for id: " + key);
writeVInt(59); ex.writeTo(this); writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown()); return; } else { writeVInt(18); writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown()); writeCause = false;
private Throwable buildWithoutCause() { requireNonNull(type, "[type] is required"); requireNonNull(reason, "[reason] is required"); switch (type) { // Make some effort to use the right exceptions case "es_rejected_execution_exception": return new EsRejectedExecutionException(reason); case "parsing_exception": XContentLocation location = null; if (line != null && column != null) { location = new XContentLocation(line, column); } return new ParsingException(location, reason); // But it isn't worth trying to get it perfect.... default: return new RuntimeException(type + ": " + reason); } }
writeVInt(59); ex.writeTo(this); writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown()); return; } else { writeVInt(18); writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown()); writeCause = false;
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (r instanceof AbstractRunnable) { if (((AbstractRunnable) r).isForceExecution()) { BlockingQueue<Runnable> queue = executor.getQueue(); if (!(queue instanceof SizeBlockingQueue)) { throw new IllegalStateException("forced execution, but expected a size queue"); } try { ((SizeBlockingQueue) queue).forcePut(r); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("forced execution, but got interrupted", e); } return; } } rejected.inc(); throw new EsRejectedExecutionException("rejected execution of " + r + " on " + executor, executor.isShutdown()); }
} else { writeVInt(18); writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown()); writeCause = false;
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (r instanceof AbstractRunnable) { if (((AbstractRunnable) r).isForceExecution()) { BlockingQueue<Runnable> queue = executor.getQueue(); if (!(queue instanceof SizeBlockingQueue)) { throw new IllegalStateException("forced execution, but expected a size queue"); } try { ((SizeBlockingQueue) queue).forcePut(r); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("forced execution, but got interrupted", e); } return; } } rejected.inc(); throw new EsRejectedExecutionException("rejected execution of " + r + " on " + executor, executor.isShutdown()); }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (r instanceof AbstractRunnable) { if (((AbstractRunnable) r).isForceExecution()) { BlockingQueue<Runnable> queue = executor.getQueue(); if (!(queue instanceof SizeBlockingQueue)) { throw new IllegalStateException("forced execution, but expected a size queue"); } try { ((SizeBlockingQueue) queue).forcePut(r); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("forced execution, but got interrupted", e); } return; } } rejected.inc(); throw new EsRejectedExecutionException("rejected execution of " + r + " on " + executor, executor.isShutdown()); }
@Override public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { if (r instanceof AbstractRunnable) { if (((AbstractRunnable) r).isForceExecution()) { BlockingQueue<Runnable> queue = executor.getQueue(); if (!(queue instanceof SizeBlockingQueue)) { throw new IllegalStateException("forced execution, but expected a size queue"); } try { ((SizeBlockingQueue) queue).forcePut(r); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new IllegalStateException("forced execution, but got interrupted", e); } return; } } rejected.inc(); throw new EsRejectedExecutionException("rejected execution of " + r + " on " + executor, executor.isShutdown()); }
final ElasticsearchException ex = new ElasticsearchException(this); final boolean isExecutorShutdown = readBoolean(); return (T) new EsRejectedExecutionException(ex.getMessage(), isExecutorShutdown); case 18: final boolean isExecutorShutdown = readBoolean(); return (T) readStackTrace(new EsRejectedExecutionException(readOptionalString(), isExecutorShutdown), this); default: throw new IOException("no such exception for id: " + key);
final ElasticsearchException ex = new ElasticsearchException(this); final boolean isExecutorShutdown = readBoolean(); return (T) new EsRejectedExecutionException(ex.getMessage(), isExecutorShutdown); case 18: final boolean isExecutorShutdown = readBoolean(); return (T) readStackTrace(new EsRejectedExecutionException(readOptionalString(), isExecutorShutdown), this); default: throw new IOException("no such exception for id: " + key);