/**
   * Processes cache query request.
   *
   * @param sndId Sender node id.
   * @param req Query request.
   */
  @SuppressWarnings("unchecked")
  @Override
  void processQueryRequest(UUID sndId, GridCacheQueryRequest req) {
    if (req.cancel()) {
      cancelIds.add(new CancelMessageId(req.id(), sndId));

      if (req.fields()) removeFieldsQueryResult(sndId, req.id());
      else removeQueryResult(sndId, req.id());
    } else {
      if (!cancelIds.contains(new CancelMessageId(req.id(), sndId))) {
        if (!F.eq(req.cacheName(), cctx.name())) {
          GridCacheQueryResponse res =
              new GridCacheQueryResponse(
                  cctx.cacheId(),
                  req.id(),
                  new IgniteCheckedException(
                      "Received request for incorrect cache [expected="
                          + cctx.name()
                          + ", actual="
                          + req.cacheName()));

          sendQueryResponse(sndId, res, 0);
        } else {
          threads.put(req.id(), Thread.currentThread());

          try {
            GridCacheQueryInfo info = distributedQueryInfo(sndId, req);

            if (info == null) return;

            if (req.fields()) runFieldsQuery(info);
            else runQuery(info);
          } catch (Throwable e) {
            U.error(log(), "Failed to run query.", e);

            sendQueryResponse(
                sndId, new GridCacheQueryResponse(cctx.cacheId(), req.id(), e.getCause()), 0);

            if (e instanceof Error) throw (Error) e;
          } finally {
            threads.remove(req.id());
          }
        }
      }
    }
  }
 /**
  * Creates new exception with given throwable as a nested cause and source of error message.
  *
  * @param cause Non-null throwable cause.
  */
 public GridCacheDataStructureRemovedException(Throwable cause) {
   this(cause.getMessage(), cause);
 }
Пример #3
0
 /**
  * Creates new exception with given throwable as a nested cause and source of error message.
  *
  * @param cause Non-null throwable cause.
  */
 public GridDeploymentException(Throwable cause) {
   this(cause.getMessage(), cause);
 }
 /**
  * Creates new exception with given throwable as a nested cause and source of error message.
  *
  * @param cause Non-null throwable cause.
  */
 public IgniteFutureTimeoutCheckedException(Throwable cause) {
   this(cause.getMessage(), cause);
 }
Пример #5
0
 /**
  * Creates new internal exception given throwable as a cause and source of error message.
  *
  * @param cause Non-null throwable cause.
  */
 public GridInternalException(Throwable cause) {
   super(cause.getMessage(), cause);
 }