static <I extends DataItem, O extends DataIoTask<I>> boolean invokeCopy( final I fileItem, final O ioTask, final FileChannel srcChannel, final FileChannel dstChannel ) throws IOException { long countBytesDone = ioTask.getCountBytesDone(); final long contentSize = fileItem.size(); if(countBytesDone < contentSize && IoTask.Status.ACTIVE.equals(ioTask.getStatus())) { countBytesDone += srcChannel.transferTo( countBytesDone, contentSize - countBytesDone, dstChannel ); ioTask.setCountBytesDone(countBytesDone); } return countBytesDone >= contentSize; }
private void invokeCopy( final I fileItem, final O ioTask, final FileChannel srcChannel, final FileChannel dstChannel ) throws IOException { long countBytesDone = ioTask.getCountBytesDone(); final long contentSize = fileItem.size(); if(countBytesDone < contentSize && Status.ACTIVE.equals(ioTask.getStatus())) { countBytesDone += srcChannel.transferTo( countBytesDone, contentSize - countBytesDone, dstChannel ); ioTask.setCountBytesDone(countBytesDone); } if(countBytesDone == contentSize) { finishIoTask(ioTask); } }
if(Status.SUCC.equals(status)) { if(ioTaskResult instanceof PartialIoTask) { ioTypeStats.markPartSucc(countBytesDone, reqDuration, respLatency); counterResults.increment(); } else if(!Status.INTERRUPTED.equals(status)) { Loggers.ERR.debug("{}: {}", ioTaskResult.toString(), status.toString()); ioTypeStats.markFail();
final IoTask.Status status = ioTaskResult.getStatus(); if(Status.SUCC.equals(status)) { final long reqDuration = ioTaskResult.getDuration(); final long respLatency = ioTaskResult.getLatency(); counterResults.increment(); } else if(!Status.INTERRUPTED.equals(status)) { Loggers.ERR.debug("{}: {}", ioTaskResult.toString(), status.toString()); ioTypeStats.markFail();
static <I extends DataItem, O extends DataIoTask<I>> boolean invokeOverwrite( final I fileItem, final O ioTask, final FileChannel dstChannel ) throws IOException { long countBytesDone = ioTask.getCountBytesDone(); if(countBytesDone == 0) { dstChannel.position(countBytesDone); } final long fileSize = fileItem.size(); if(countBytesDone < fileSize && IoTask.Status.ACTIVE.equals(ioTask.getStatus())) { countBytesDone += fileItem.writeToFileChannel(dstChannel, fileSize - countBytesDone); ioTask.setCountBytesDone(countBytesDone); } return countBytesDone >= fileSize; } }
private void invokeCreate( final I fileItem, final O ioTask, final FileChannel dstChannel ) throws IOException { long countBytesDone = ioTask.getCountBytesDone(); final long contentSize = fileItem.size(); if(countBytesDone < contentSize && Status.ACTIVE.equals(ioTask.getStatus())) { countBytesDone += fileItem.writeToFileChannel(dstChannel, contentSize - countBytesDone); ioTask.setCountBytesDone(countBytesDone); } if(countBytesDone == contentSize) { finishIoTask(ioTask); } }
static <I extends DataItem, O extends DataIoTask<I>> boolean invokeCreate( final I fileItem, final O ioTask, final FileChannel dstChannel ) throws IOException { long countBytesDone = ioTask.getCountBytesDone(); final long contentSize = fileItem.size(); if(countBytesDone < contentSize && IoTask.Status.ACTIVE.equals(ioTask.getStatus())) { countBytesDone += fileItem.writeToFileChannel(dstChannel, contentSize - countBytesDone); ioTask.setCountBytesDone(countBytesDone); } return countBytesDone >= contentSize; }