Пример #1
0
  public void cancel() {
    if (isFinished()) {
      return;
    }

    // cancel remote fragments.
    fragmentManager.cancel();

    QueryResult result =
        QueryResult.newBuilder()
            .setQueryState(QueryState.CANCELED)
            .setIsLastChunk(true)
            .setQueryId(queryId)
            .build();
    cleanupAndSendResult(result);
  }
Пример #2
0
 private void fail(String message, Throwable t) {
   if (isFinished()) {
     logger.error("Received a failure message query finished of: {}", message, t);
   }
   DrillPBError error =
       ErrorHelper.logAndConvertError(context.getCurrentEndpoint(), message, t, logger);
   QueryResult result =
       QueryResult //
           .newBuilder() //
           .addError(error) //
           .setIsLastChunk(true) //
           .setQueryState(QueryState.FAILED) //
           .setQueryId(queryId) //
           .build();
   cleanupAndSendResult(result);
 }