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


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/AbstractWalRecordsIteratorAdapter.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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;
+
+/**
+ * Iterator over WAL segments. This abstract class provides most functionality 
for reading records.
+ */
+public abstract class AbstractWalRecordsIteratorAdapter
+    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 */
+    protected final IgniteLogger log;
+
+    /**
+     * @param log Logger.
+     */
+    protected AbstractWalRecordsIteratorAdapter(final IgniteLogger log) {
+        this.log = log;

Review Comment:
   log is not used in this class. I suppose it can be directly set in class 
descenders.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/AbstractWalRecordsIteratorAdapter.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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;
+
+/**
+ * Iterator over WAL segments. This abstract class provides most functionality 
for reading records.
+ */
+public abstract class AbstractWalRecordsIteratorAdapter
+    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;

Review Comment:
   curException -> curErr. Exception should be replaced with abbreviation. 



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/wal/ByteBufferWalIterator.java:
##########
@@ -0,0 +1,142 @@
+/*
+ * 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.RecordSerializerFactoryImpl;
+import org.apache.ignite.lang.IgniteBiPredicate;
+import org.apache.ignite.lang.IgniteBiTuple;
+
+import static 
org.apache.ignite.internal.pagemem.wal.record.WALRecord.RecordType.HEADER_RECORD;
+import static 
org.apache.ignite.internal.processors.cache.persistence.wal.serializer.RecordV1Serializer.HEADER_RECORD_SIZE;
+
+/** Byte Buffer WAL Iterator */
+public class ByteBufferWalIterator extends AbstractWalRecordsIteratorAdapter {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** */
+    private final ByteBuffer buf;
+
+    /** */
+    private final RecordSerializer serializer;
+
+    /** */
+    private final ByteBufferBackedDataInputImpl dataInput;
+
+    /** */
+    private WALPointer walPtr;

Review Comment:
   expWalPtr



-- 
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