Skip to content

Commit

Permalink
account only the transferred payload size for concatenation requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Kurilov committed Oct 13, 2017
1 parent bda27d8 commit 96641ee
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ private FullHttpRequest getCompleteMpuRequest(
}

@Override
public final void complete(final Channel channel, final O ioTask) {
public void complete(final Channel channel, final O ioTask) {
if(channel != null && ioTask instanceof CompositeDataIoTask) {
final CompositeDataIoTask compositeIoTask = (CompositeDataIoTask) ioTask;
if(compositeIoTask.allSubTasksDone()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.github.akurilov.commons.collection.Range;
import com.github.akurilov.commons.math.Random;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
import io.netty.handler.codec.http.DefaultHttpHeaders;
import io.netty.handler.codec.http.EmptyHttpHeaders;
Expand Down Expand Up @@ -433,7 +434,7 @@ private FullHttpRequest getCopyRangesRequest(

// set the total summary size for the destination item
dstItem.size(dstItemSize);
dataIoTask.setCountBytesDone(dstItemSize);
dataIoTask.setCountBytesDone(content.length());

// request headers
final HttpHeaders httpHeaders = new DefaultHttpHeaders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ protected final void ioTaskCompleted(final O ioTask) {

final O ioTaskResult = ioTask.getResult();
if(!ioResultsQueue.offer(ioTaskResult/*, 1, TimeUnit.MICROSECONDS*/)) {
Loggers.ERR.warn("{}: I/O task results queue overflow, dropping the result", toString());
Loggers.ERR.warn(
"{}: I/O task results queue overflow, dropping the result", toString()
);
}

if(ioTask instanceof CompositeIoTask) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ public final void test()

final LongAdder ioTraceRecCount = new LongAdder();
final SizeInBytes avgDstItemContentSize = new SizeInBytes(
SRC_ITEMS_TO_CONCAT_MIN * SRC_ITEMS_RANDOM_RANGES_COUNT,
SRC_ITEMS_TO_CONCAT_MAX * SRC_ITEMS_RANDOM_RANGES_COUNT * itemSize.getValue().get() / 2,
1
SRC_ITEMS_TO_CONCAT_MIN * 100, SRC_ITEMS_TO_CONCAT_MAX * 200, 1
);
final Consumer<CSVRecord> ioTraceReqTestFunc = ioTraceRec -> {
testIoTraceRecord(ioTraceRec, IoType.CREATE.ordinal(), avgDstItemContentSize);
Expand Down

0 comments on commit 96641ee

Please sign in to comment.