Search in sources :

Example 1 with AsyncRequest

use of org.apache.gobblin.async.AsyncRequest in project incubator-gobblin by apache.

the class AsyncHttpWriter method onFailure.

protected void onFailure(AsyncRequest<D, RQ> asyncRequest, DispatchException exception) {
    if (exception.isFatal()) {
        // Report failure event
        FailureEventBuilder failureEvent = new FailureEventBuilder(FATAL_ASYNC_HTTP_WRITE_EVENT);
        failureEvent.setRootCause(exception);
        failureEvent.addMetadata(ASYNC_REQUEST, asyncRequest.toString());
        failureEvent.submit(context);
    }
    for (AsyncRequest.Thunk thunk : asyncRequest.getThunks()) {
        thunk.callback.onFailure(exception);
    }
}
Also used : AsyncRequest(org.apache.gobblin.async.AsyncRequest) FailureEventBuilder(org.apache.gobblin.metrics.event.FailureEventBuilder)

Aggregations

AsyncRequest (org.apache.gobblin.async.AsyncRequest)1 FailureEventBuilder (org.apache.gobblin.metrics.event.FailureEventBuilder)1