timoninmaxim commented on code in PR #10798:
URL: https://github.com/apache/ignite/pull/10798#discussion_r1253027588


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/AbstractWalRecordsIteratorApdator.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.persistence.wal;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.pagemem.wal.WALIterator;
+import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
+import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Iterator over WAL segments. This abstract class provides most functionality 
for reading records.
+ */
+public abstract class AbstractWalRecordsIteratorApdator

Review Comment:
   Adaptor -> Adapter



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferWalIterator.java:
##########
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.persistence.wal;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Optional;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
+import org.apache.ignite.internal.processors.cache.GridCacheSharedContext;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordSerializer;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordSerializerFactory;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordSerializerFactoryImpl;
+import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.jetbrains.annotations.NotNull;
+
+/** Byte Buffer WAL Iterator */
+public class ByteBufferWalIterator extends AbstractWalRecordsIteratorApdator {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final ByteBuffer buf;
+
+    /** */
+    private final RecordSerializer serializer;
+
+    /** */
+    private final ByteBufferBackedDataInputImpl dataInput;
+
+    /** */
+    public ByteBufferWalIterator(
+        @NotNull IgniteLogger log,
+        @NotNull GridCacheSharedContext<?, ?> cctx,
+        @NotNull ByteBuffer byteBuf) throws IgniteCheckedException {

Review Comment:
   throws should be on new line:
   
   ```
       ByteBuffer byteBuf
   ) throws IgniteCheckedException {
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/Crc32CheckingDataInput.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.persistence.wal;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import org.apache.ignite.internal.processors.cache.persistence.wal.crc.FastCrc;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.crc.IgniteDataIntegrityViolationException;
+
+/**
+ * Checking of CRC32.
+ */
+public class Crc32CheckingDataInput extends ByteBufferBackedDataInput 
implements AutoCloseable {
+    /**
+     *

Review Comment:
   Empty javadocs should be inlined `/** */`



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/AbstractWalRecordsIteratorApdator.java:
##########
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache.persistence.wal;
+
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.internal.pagemem.wal.WALIterator;
+import org.apache.ignite.internal.pagemem.wal.record.WALRecord;
+import org.apache.ignite.internal.util.GridCloseableIteratorAdapter;
+import org.apache.ignite.lang.IgniteBiTuple;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Iterator over WAL segments. This abstract class provides most functionality 
for reading records.
+ */
+public abstract class AbstractWalRecordsIteratorApdator
+    extends GridCloseableIteratorAdapter<IgniteBiTuple<WALPointer, WALRecord>> 
implements WALIterator {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /**
+     * Current record preloaded, to be returned on next()<br> Normally this 
should be not null because advance() method
+     * should already prepare some value<br>
+     */
+    protected IgniteBiTuple<WALPointer, WALRecord> curRec;
+
+    /**
+     * The exception which can be thrown during reading next record. It holds 
until the next calling of next record.
+     */
+    private IgniteCheckedException curException;
+
+    /** Logger */
+    @NotNull protected final IgniteLogger log;
+
+    /**
+     * @param log Logger.
+     */
+    protected AbstractWalRecordsIteratorApdator(@NotNull final IgniteLogger 
log) {

Review Comment:
   Ignite uses only `@Nullable` annotation, `@NotNull` should be avoided.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/io/FileInput.java:
##########
@@ -18,242 +18,27 @@
 package org.apache.ignite.internal.processors.cache.persistence.wal.io;
 
 import java.io.IOException;
-import java.nio.ByteBuffer;
 
 import org.apache.ignite.internal.processors.cache.persistence.file.FileIO;
 import 
org.apache.ignite.internal.processors.cache.persistence.wal.ByteBufferBackedDataInput;
-import org.apache.ignite.internal.processors.cache.persistence.wal.crc.FastCrc;
-import 
org.apache.ignite.internal.processors.cache.persistence.wal.crc.IgniteDataIntegrityViolationException;
-import org.jetbrains.annotations.NotNull;
 
 /**
  * File input, backed by byte buffer file input.
  * This class allows to read data by chunks from file and then read primitives.
  */
-public interface FileInput extends ByteBufferBackedDataInput {
+public abstract class FileInput extends ByteBufferBackedDataInput {

Review Comment:
   Let it be interface. `size()` method can be `default`.



##########
modules/core/src/main/java/org/apache/ignite/internal/pagemem/wal/record/FilteredRecord.java:
##########
@@ -16,12 +16,12 @@
 */
 package org.apache.ignite.internal.pagemem.wal.record;
 
-import 
org.apache.ignite.internal.processors.cache.persistence.wal.AbstractWalRecordsIterator;
+import 
org.apache.ignite.internal.processors.cache.persistence.wal.AbstractFileWalRecordsIterator;
 
 /**
  * Special type of WAL record. Shouldn't be stored in file.
  * Returned by deserializer if next record is not matched by filter. 
Automatically handled by
- * {@link AbstractWalRecordsIterator}.
+ * {@link AbstractFileWalRecordsIterator}.

Review Comment:
   It is also handled by `ByteBufferWalIterator` now. Let's remove this 
sentence at all.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to