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);
}
}
Aggregations