SilverNarcissus commented on a change in pull request #1869:
URL: https://github.com/apache/iotdb/pull/1869#discussion_r542212232
##########
File path:
server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
##########
@@ -91,17 +91,24 @@ public void replayLogs() {
logNodePrefix +
FSFactoryProducer.getFSFactory().getFile(insertFilePath).getName());
ILogReader logReader = logNode.getLogReader();
+ long readLogTime = 0;
+ long replayLogTime = 0;
try {
while (logReader.hasNext()) {
try {
+ long start = System.nanoTime();
Review comment:
System.nanoTime() will call "clock_gettime" which is a system call. So
calculating the replay time of every log row may has some impact on performance
##########
File path:
server/src/main/java/org/apache/iotdb/db/writelog/io/ILogReaderFactory.java
##########
@@ -0,0 +1,24 @@
+/*
+ * 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.iotdb.db.writelog.io;
+
+import java.io.File;
Review comment:
This file is empty. Please have a look
##########
File path:
server/src/main/java/org/apache/iotdb/db/writelog/recover/LogReplayer.java
##########
@@ -91,17 +91,24 @@ public void replayLogs() {
logNodePrefix +
FSFactoryProducer.getFSFactory().getFile(insertFilePath).getName());
ILogReader logReader = logNode.getLogReader();
+ long readLogTime = 0;
+ long replayLogTime = 0;
try {
while (logReader.hasNext()) {
try {
+ long start = System.nanoTime();
Review comment:
System.nanoTime() will call "clock_gettime" which is a system call. So
calculating the replay time of every row may have some performance impact.
##########
File path:
server/src/main/java/org/apache/iotdb/db/utils/datastructure/RandomAccessArrayDeque.java
##########
@@ -0,0 +1,939 @@
+/*
+ * 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.iotdb.db.utils.datastructure;
+
+import java.io.Serializable;
+import java.util.AbstractCollection;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.ConcurrentModificationException;
+import java.util.Deque;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+import java.util.Objects;
+import java.util.Queue;
+import java.util.RandomAccess;
+import java.util.Spliterator;
+import java.util.function.Consumer;
+
+/**
+ * RandomAccessArrayDeque is a modified version of ArrayDeque from java.util,
providing the ability
+ * to access an element by index.
+ * Most codes are copied directly because the fields are package-private and
cannot be accessed
+ * by a simple extension.
+ * @param <E>
+ */
+public class RandomAccessArrayDeque<E> extends AbstractCollection<E>
Review comment:
Wow~ That's a fantastic structure but without test. May be we should add
some test for it.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]