@Override public ValidateResult validate(LogSegment segment) { final int fileSize = segment.getFileSize(); final ByteBuffer buffer = segment.sliceByteBuffer(); int position = 0; while (true) { if (position == fileSize) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } final int result = consumeAndValidateMessage(buffer); if (result == -1) { return new ValidateResult(ValidateStatus.PARTIAL, position); } else if (result == 0) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } else { position += result; } } }
@Override public ValidateResult validate(LogSegment segment) { final int fileSize = segment.getFileSize(); final ByteBuffer buffer = segment.sliceByteBuffer(); int position = 0; while (true) { if (position == fileSize) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } final int result = consumeAndValidateMessage(buffer); if (result == -1) { return new ValidateResult(ValidateStatus.PARTIAL, position); } else if (result == 0) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } else { position += result; } } }
@Override public ValidateResult validate(LogSegment segment) { final int fileSize = segment.getFileSize(); final ByteBuffer buffer = segment.sliceByteBuffer(); int position = 0; while (true) { if (position == fileSize) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } final int result = consumeAndValidateMessage(buffer); if (result == -1) { return new ValidateResult(ValidateStatus.PARTIAL, position); } else { position += result; } } }
@Override public ValidateResult validate(LogSegment segment) { final int fileSize = segment.getFileSize(); final ByteBuffer buffer = segment.sliceByteBuffer(); int position = 0; while (true) { if (position == fileSize) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } final int result = consumeAndValidateMessage(segment, buffer); if (result == -1) { return new ValidateResult(ValidateStatus.PARTIAL, position); } else if (result == 0) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } else { position += result; } } }
@Override public ValidateResult validate(LogSegment segment) { final int fileSize = segment.getFileSize(); final ByteBuffer buffer = segment.sliceByteBuffer(); int position = 0; while (true) { if (position == fileSize) { return new ValidateResult(ValidateStatus.COMPLETE, fileSize); } final int result = consumeAndValidateMessage(buffer); if (result == -1) { return new ValidateResult(ValidateStatus.PARTIAL, position); } else { position += result; } } }