Examples of QueryInterruptedException


Examples of io.druid.query.QueryInterruptedException

      if (jp == null) {
        try {
          jp = objectMapper.getFactory().createParser(future.get());
          final JsonToken nextToken = jp.nextToken();
          if (nextToken == JsonToken.START_OBJECT) {
            QueryInterruptedException e = jp.getCodec().readValue(jp, QueryInterruptedException.class);
            throw e;
          } else if (nextToken != JsonToken.START_ARRAY) {
            throw new IAE("Next token wasn't a START_ARRAY, was[%s] from url [%s]", jp.getCurrentToken(), url);
          } else {
            jp.nextToken();
            objectCodec = jp.getCodec();
          }
        }
        catch (IOException | InterruptedException | ExecutionException e) {
          throw new RE(e, "Failure getting results from[%s] because of [%s]", url, e.getMessage());
        }
        catch (CancellationException e) {
          throw new QueryInterruptedException("Query cancelled");
        }
      }
    }
View Full Code Here

Examples of io.druid.query.QueryInterruptedException

    cancellationFuture.set(new StatusResponseHolder(HttpResponseStatus.OK, new StringBuilder("cancelled")));
    Sequence results = client1.run(query, context);
    Assert.assertEquals(0, client1.getNumOpenConnections());


    QueryInterruptedException exception = null;
    try {
      Sequences.toList(results, Lists.newArrayList());
    } catch(QueryInterruptedException e) {
      exception = e;
    }
View Full Code Here

Examples of io.druid.query.QueryInterruptedException

                      return timeout == null ? future.get() : future.get(timeout.longValue(), TimeUnit.MILLISECONDS);
                    }
                    catch (InterruptedException e) {
                      log.warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId());
                      future.cancel(true);
                      throw new QueryInterruptedException("Query interrupted");
                    }
                    catch(CancellationException e) {
                      throw new QueryInterruptedException("Query cancelled");
                    }
                    catch(TimeoutException e) {
                      log.info("Query timeout, cancelling pending results for query id [%s]", query.getId());
                      future.cancel(true);
                      throw new QueryInterruptedException("Query timeout");
                    }
                    catch (ExecutionException e) {
                      throw Throwables.propagate(e.getCause());
                    }
                  }
View Full Code Here

Examples of io.druid.query.QueryInterruptedException

                  return;
                }

                while (baseIter.hasNext()) {
                  if (Thread.interrupted()) {
                    throw new QueryInterruptedException();
                  }

                  currEntry.set(baseIter.next());

                  if (filterMatcher.matches()) {
                    return;
                  }
                }

                if (!filterMatcher.matches()) {
                  done = true;
                }
              }

              @Override
              public void advanceTo(int offset)
              {
                int count = 0;
                while (count < offset && !isDone()) {
                  advance();
                  count++;
                }
              }

              @Override
              public boolean isDone()
              {
                return done;
              }

              @Override
              public void reset()
              {
                baseIter = cursorMap.entrySet().iterator();

                if (numAdvanced == -1) {
                  numAdvanced = 0;
                } else {
                  Iterators.advance(baseIter, numAdvanced);
                }

                if (Thread.interrupted()) {
                  throw new QueryInterruptedException();
                }

                boolean foundMatched = false;
                while (baseIter.hasNext()) {
                  currEntry.set(baseIter.next());
View Full Code Here

Examples of io.druid.query.QueryInterruptedException

                    @Override
                    public void advance()
                    {
                      if (Thread.interrupted()) {
                        throw new QueryInterruptedException();
                      }
                      cursorOffset.increment();
                    }

                    @Override
View Full Code Here

Examples of io.druid.query.QueryInterruptedException

                        }
                      }
                      catch (InterruptedException e) {
                        log.warn(e, "Query interrupted, cancelling pending results, query id [%s]", query.getId());
                        future.cancel(true);
                        throw new QueryInterruptedException("Query interrupted");
                      }
                      catch (CancellationException e) {
                        throw new QueryInterruptedException("Query cancelled");
                      }
                      catch (TimeoutException e) {
                        log.info("Query timeout, cancelling pending results for query id [%s]", query.getId());
                        future.cancel(true);
                        throw new QueryInterruptedException("Query timeout");
                      }
                      catch (ExecutionException e) {
                        throw Throwables.propagate(e.getCause());
                      }
View Full Code Here

Examples of org.datanucleus.store.query.QueryInterruptedException

            }
            catch (SQLException sqle)
            {
                if (((RDBMSAdapter)storeMgr.getDatastoreAdapter()).isStatementCancel(sqle))
                {
                    throw new QueryInterruptedException("Query has been interrupted", sqle);
                }
                else if (((RDBMSAdapter)storeMgr.getDatastoreAdapter()).isStatementTimeout(sqle))
                {
                    throw new QueryTimeoutException("Query has been timed out", sqle);
                }
View Full Code Here

Examples of org.datanucleus.store.query.QueryInterruptedException

            }
            catch (SQLException sqle)
            {
                if (((RDBMSAdapter)storeMgr.getDatastoreAdapter()).isStatementCancel(sqle))
                {
                    throw new QueryInterruptedException("Query has been interrupted", sqle);
                }
                else if (((RDBMSAdapter)storeMgr.getDatastoreAdapter()).isStatementTimeout(sqle))
                {
                    throw new QueryTimeoutException("Query has been timed out", sqle);
                }
View Full Code Here

Examples of org.openrdf.query.QueryInterruptedException

    @Override
    protected void throwInterruptedException()
      throws StoreException
    {
      throw new QueryInterruptedException("Query evaluation took too long");
    }
View Full Code Here

Examples of org.openrdf.query.QueryInterruptedException

      {

        @Override
        protected QueryEvaluationException convert(Exception e) {
          if (e instanceof ClosedByInterruptException) {
            return new QueryInterruptedException(e);
          }
          else if (e instanceof IOException) {
            return new QueryEvaluationException(e);
          }
          else if (e instanceof RuntimeException) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.