List of usage examples for java.lang InterruptedException getMessage
public String getMessage()
From source file:gridool.db.partitioning.phihash.monetdb.MonetDBGraceMultiCSVsLoadTask.java
@Override protected HashMap<GridNode, MutableLong> execute() throws GridException { GridJobFuture<HashMap<GridNode, MutableLong>> future = kernel.execute(MonetDBGraceMultiCSVsLoadJob.class, jobConf);//from w ww . j a v a 2s.c o m HashMap<GridNode, MutableLong> assigned; try { assigned = future.get(); } catch (InterruptedException ie) { LOG.error(ie.getMessage(), ie); throw new IllegalStateException(ie); } catch (ExecutionException ee) { LOG.error(ee.getMessage(), ee); throw new IllegalStateException(ee); } return assigned; }
From source file:br.com.sicoob.cro.cop.batch.core.BatchProcessingTests.java
@Test public void taskletExample() { try {//from ww w . j a va2 s.c o m Properties jobParameters = new Properties(); jobParameters.put("nomeArquivo", "OpLm.csv"); BatchProcess launcher = BatchApplication.createExecutionProcess("taskletExample", jobParameters); BatchExecution execution = launcher.start(); while (execution.getStatus() != Status.COMPLETED) { Thread.sleep(5000); LOG.info(execution.toString()); } LOG.info(execution.toString()); assertEquals(Result.Type.SUCCESS, execution.getResult().getType()); } catch (BatchStartException excecao) { Assert.fail(excecao.getMessage()); } catch (InterruptedException ex) { Assert.fail(ex.getMessage()); Logger.getLogger(BatchProcessingTests.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:br.com.sicoob.cro.cop.batch.core.BatchProcessingTests.java
@Test public void chunkExample() { try {//www . ja va 2s.c o m Properties jobParameters = new Properties(); jobParameters.put("nomeArquivo", "OpLm.csv"); BatchProcess launcher = BatchApplication.createExecutionProcess("chunkExample", jobParameters); BatchExecution execution = launcher.start(); while (execution.getStatus() != Status.COMPLETED) { Thread.sleep(5000); LOG.info(execution.toString()); } LOG.info(execution.toString()); assertEquals(Result.Type.SUCCESS, execution.getResult().getType()); } catch (BatchStartException excecao) { Assert.fail(excecao.getMessage()); } catch (InterruptedException ex) { Assert.fail(ex.getMessage()); Logger.getLogger(BatchProcessingTests.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:gridool.mapred.db.DBMapReduceJob.java
@Override public String reduce() throws GridException { final GridJobFuture<String> result = kernel.execute(DBReduceJob.class, jobConf); try {//from ww w . j a va2 s . c o m return result.get(); } catch (InterruptedException ie) { LogFactory.getLog(getClass()).error(ie.getMessage(), ie); throw new GridException(ie); } catch (ExecutionException ee) { LogFactory.getLog(getClass()).error(ee.getMessage(), ee); throw new GridException(ee); } }
From source file:gridool.mapred.dht.DhtMapReduceJob.java
@Override public String reduce() throws GridException { jobConf.setInputTableName(shuffleDestDhtName); final GridJobFuture<String> result = kernel.execute(DhtReduceJob.class, jobConf); try {/*from w w w. ja v a 2 s . c o m*/ return result.get(); } catch (InterruptedException ie) { LogFactory.getLog(getClass()).error(ie.getMessage(), ie); throw new GridException(ie); } catch (ExecutionException ee) { LogFactory.getLog(getClass()).error(ee.getMessage(), ee); throw new GridException(ee); } }
From source file:pzalejko.iot.hardware.home.core.task.ShutDownTask.java
@Override public void run() { LOG.debug(LogMessages.SHUT_DOWN_DELAY_VALUE, shutDownDelay); final Calendar c = Calendar.getInstance(); final Date dateNow = new Date(); c.setTime(dateNow);/*from w w w . j a v a2 s . co m*/ c.add(Calendar.MINUTE, shutDownDelay); LOG.debug(LogMessages.STARTED_SHUT_DOWN_TASK, c.getTime()); try { Thread.sleep(c.getTime().getTime() - dateNow.getTime()); } catch (final InterruptedException e) { LOG.error(LogMessages.ERROR_HAS_OCCURRED, e.getMessage(), e); } }
From source file:cn.wanghaomiao.seimi.def.DefaultLocalQueue.java
@Override public Request bPop(String crawlerName) { try {/*from w w w .ja v a 2s .c om*/ LinkedBlockingQueue<Request> queue = getQueue(crawlerName); return queue.take(); } catch (InterruptedException e) { logger.error(e.getMessage(), e); } return null; }
From source file:cn.wanghaomiao.seimi.def.DefaultLocalQueue.java
@Override public boolean push(Request req) { try {/*ww w . jav a 2 s . c o m*/ LinkedBlockingQueue<Request> queue = getQueue(req.getCrawlerName()); queue.put(req); return true; } catch (InterruptedException e) { logger.error(e.getMessage(), e); } return false; }
From source file:ch.cyberduck.core.io.ThreadedStreamCloser.java
@Override public void close(final InputStream in) throws ConnectionTimeoutException { final CountDownLatch signal = new CountDownLatch(1); threadFactory.newThread(new Runnable() { @Override/*from w w w . j av a 2 s. c o m*/ public void run() { IOUtils.closeQuietly(in); signal.countDown(); } }).start(); try { if (!signal.await(preferences.getInteger("connection.timeout.seconds"), TimeUnit.SECONDS)) { throw new StreamCloseTimeoutException("Timeout closing input stream", null); } } catch (InterruptedException e) { throw new ConnectionTimeoutException(e.getMessage(), e); } }
From source file:ch.cyberduck.core.io.ThreadedStreamCloser.java
@Override public void close(final OutputStream out) throws ConnectionTimeoutException { final CountDownLatch signal = new CountDownLatch(1); threadFactory.newThread(new Runnable() { @Override/*www. j a v a 2 s. co m*/ public void run() { IOUtils.closeQuietly(out); signal.countDown(); } }).start(); try { if (!signal.await(preferences.getInteger("connection.timeout.seconds"), TimeUnit.SECONDS)) { throw new StreamCloseTimeoutException("Timeout closing output stream", null); } } catch (InterruptedException e) { throw new ConnectionTimeoutException(e.getMessage(), e); } }