Search in sources :

Example 1 with FutureWrappedWriteCallback

use of org.apache.gobblin.writer.FutureWrappedWriteCallback in project incubator-gobblin by apache.

the class AbstractAsyncDataWriter method write.

/**
 * Asynchronously write the record with a callback
 */
@Override
public final Future<WriteResponse> write(D record, @Nullable WriteCallback callback) {
    FutureWrappedWriteCallback wrappedWriteCallback = new FutureWrappedWriteCallback(callback);
    BufferedRecord<D> bufferedRecord = new BufferedRecord<>(record, wrappedWriteCallback);
    put(bufferedRecord);
    return wrappedWriteCallback;
}
Also used : BufferedRecord(org.apache.gobblin.async.BufferedRecord) FutureWrappedWriteCallback(org.apache.gobblin.writer.FutureWrappedWriteCallback)

Aggregations

BufferedRecord (org.apache.gobblin.async.BufferedRecord)1 FutureWrappedWriteCallback (org.apache.gobblin.writer.FutureWrappedWriteCallback)1