Search in sources :

Example 1 with BulkWriteOp

use of com.twitter.distributedlog.service.stream.BulkWriteOp in project distributedlog by twitter.

the class DistributedLogServiceImpl method writeBulkWithContext.

@Override
public Future<BulkWriteResponse> writeBulkWithContext(final String stream, List<ByteBuffer> data, WriteContext ctx) {
    bulkWritePendingStat.inc();
    receivedRecordCounter.add(data.size());
    BulkWriteOp op = new BulkWriteOp(stream, data, statsLogger, perStreamStatsLogger, getChecksum(ctx), featureChecksumDisabled, accessControlManager);
    executeStreamOp(op);
    return op.result().ensure(new Function0<BoxedUnit>() {

        public BoxedUnit apply() {
            bulkWritePendingStat.dec();
            return null;
        }
    });
}
Also used : BulkWriteOp(com.twitter.distributedlog.service.stream.BulkWriteOp) BoxedUnit(scala.runtime.BoxedUnit)

Aggregations

BulkWriteOp (com.twitter.distributedlog.service.stream.BulkWriteOp)1 BoxedUnit (scala.runtime.BoxedUnit)1