@Override public void run() { while (service.isActive()) { try { NodeAssignments nodeAssignments = this.service.nextAssignments(queueIndex); sendAssignmentsToNode(nodeAssignments); } catch (InterruptedException e) { if (service.isActive()) { LOG.error("Get an unexpected interrupt when distributing assignments to node, {}", e.getCause()); } else { // service is off now just interrupt it. Thread.currentThread().interrupt(); } } } }
throw new RuntimeException(e); } catch (InterruptedException e) { LOG.error("InterruptedException " + e.getCause()); } catch (TimeoutException e) {
public void serializer(KryoTupleSerializer serializer) { LOG.debug("start serializer of task: {}", taskId); if (!AsyncLoopRunnable.getShutdown().get()) { //note: sleep 1ms to reduce cpu usage when serializeQueue is empty if (serializeQueue.population() == 0) { Utils.sleep(1); return; } try { List<Object> objects = serializeQueue.retreiveAvailableBatch(); for (Object object : objects) { if (object == null) { continue; } serialize(serializer, object); } } catch (InterruptedException e) { LOG.error("InterruptedException " + e.getCause()); } catch (TimeoutException ignored) { } catch (AlertException e) { LOG.error(e.getMessage(), e); throw new RuntimeException(e); } } }
public boolean deserializer(KryoTupleDeserializer deserializer, boolean forceConsume) { //LOG.debug("start Deserializer of task, {}", taskId); boolean isIdling = true; DisruptorQueue exeQueue = innerTaskTransfer.get(taskId); if (!taskStatus.isShutdown()) { if ((deserializeQueue.population() > 0 && exeQueue.pctFull() < 1.0) || forceConsume) { try { List<Object> objects = deserializeQueue.retreiveAvailableBatch(); for (Object object : objects) { deserialize(deserializer, (byte[]) object, exeQueue); } isIdling = false; } catch (InterruptedException e) { LOG.error("InterruptedException " + e.getCause()); return true; } catch (TimeoutException e) { return true; } catch (Throwable e) { if (Utils.exceptionCauseIsInstanceOf(KryoException.class, e)) { throw new RuntimeException(e); } else if (!taskStatus.isShutdown()) { LOG.error("Unknown exception ", e); } } } } else { task.unregisterDeserializeQueue(); } return isIdling; }
throw new RuntimeException(e); } catch (InterruptedException e) { LOG.error("InterruptedException " + e.getCause());
synchronized void startAll() throws IOException { try { UserGroupInformation.getLoginUser().doAs( new PrivilegedExceptionAction<Object>() { @Override public Object run() throws Exception { for (BPOfferService bpos : offerServices) { bpos.start(); } return null; } }); } catch (InterruptedException ex) { IOException ioe = new IOException(); ioe.initCause(ex.getCause()); throw ioe; } }
ex.initCause( e.getCause() ); throw ex;
public List<List<Object>> execute(String queryString) throws SQLException { QueryExecution queryExecution = queryExecutorService.executeQuery( project, queryString, null, null, ZoneOffset.UTC, DEFAULT_QUERY_RESULT_COUNT); try { QueryResult queryResult = queryExecution.getResult().get(); if (queryResult.isFailed()) { throw new SQLException(queryResult.getError().message); } return queryResult.getResult(); } catch (InterruptedException e) { throw new SQLException(e.getCause()); } catch (ExecutionException e) { throw new SQLException(e.getCause()); } } }
} catch (InterruptedException ex) { IOException ioe = new IOException(); ioe.initCause(ex.getCause()); throw ioe;
future.get(); } catch (InterruptedException e) { Assert.fail("Interrupted because of: " + e.getCause().getMessage()); } catch (ExecutionException ee) { Assert.fail(ee.getCause().getMessage());
@Override public List<String> getListInBundle(String namespace, String bundleRange) throws PulsarAdminException { try { return getListInBundleAsync(namespace, bundleRange).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public List<String> getList(String namespace) throws PulsarAdminException { try { return getListAsync(namespace).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public List<String> getListInBundle(String namespace, String bundleRange) throws PulsarAdminException { try { return getListInBundleAsync(namespace, bundleRange).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public void createPartitionedTopic(String topic, int numPartitions) throws PulsarAdminException { try { createPartitionedTopicAsync(topic, numPartitions).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public JsonObject getInternalInfo(String topic) throws PulsarAdminException { try { return getInternalInfoAsync(topic).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public void expireMessagesForAllSubscriptions(String topic, long expireTimeInSeconds) throws PulsarAdminException { try { expireMessagesForAllSubscriptionsAsync(topic, expireTimeInSeconds).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public PartitionedTopicStats getPartitionedStats(String destination, boolean perPartition) throws PulsarAdminException { try { return getPartitionedStatsAsync(destination, perPartition).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public void createPartitionedTopic(String topic, int numPartitions) throws PulsarAdminException { try { createPartitionedTopicAsync(topic, numPartitions).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }
@Override public PartitionedTopicMetadata getPartitionedTopicMetadata(String topic) throws PulsarAdminException { try { return getPartitionedTopicMetadataAsync(topic).get(); } catch (ExecutionException e) { throw (PulsarAdminException) e.getCause(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PulsarAdminException(e.getCause()); } }