You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2019/06/12 10:17:53 UTC
[incubator-iotdb] branch feature_async_close_tsfile updated:
pre-refactors of wal
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch feature_async_close_tsfile
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/feature_async_close_tsfile by this push:
new 0df0568 pre-refactors of wal
new 251cfe9 Merge branch 'feature_async_close_tsfile' of github.com:apache/incubator-iotdb into feature_async_close_tsfile
0df0568 is described below
commit 0df0568a4df20273d90d1818fbaa5641aa504db5
Author: 江天 <jt...@163.com>
AuthorDate: Wed Jun 12 18:11:37 2019 +0800
pre-refactors of wal
---
.../iotdb/db/conf/directories/Directories.java | 5 +
.../engine/bufferwrite/BufferWriteProcessor.java | 8 +-
.../db/engine/overflow/io/OverflowProcessor.java | 8 +-
.../apache/iotdb/db/qp/physical/PhysicalPlan.java | 13 +++
.../physical/transfer/PhysicalPlanLogTransfer.java | 2 +-
.../org/apache/iotdb/db/writelog/io/LogWriter.java | 4 +
.../writelog/manager/MultiFileLogNodeManager.java | 36 +-----
.../db/writelog/manager/WriteLogNodeManager.java | 5 +-
.../db/writelog/node/ExclusiveWriteLogNode.java | 127 +++++++++------------
.../iotdb/db/writelog/node/WriteLogNode.java | 18 +--
.../transfer/PhysicalPlanLogTransferTest.java | 29 +++--
.../org/apache/iotdb/db/tools/WalCheckerTest.java | 6 +-
.../iotdb/db/writelog/IoTDBLogFileSizeTest.java | 6 +-
.../apache/iotdb/db/writelog/PerformanceTest.java | 17 +--
.../org/apache/iotdb/db/writelog/RecoverTest.java | 14 +--
.../iotdb/db/writelog/WriteLogNodeManagerTest.java | 4 +-
.../apache/iotdb/db/writelog/WriteLogNodeTest.java | 20 ++--
.../iotdb/db/writelog/io/LogWriterReaderTest.java | 5 +-
18 files changed, 133 insertions(+), 194 deletions(-)
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/conf/directories/Directories.java b/iotdb/src/main/java/org/apache/iotdb/db/conf/directories/Directories.java
index ad9c847..4380b0d 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/conf/directories/Directories.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/conf/directories/Directories.java
@@ -24,6 +24,7 @@ import java.util.Arrays;
import java.util.List;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.conf.directories.strategy.DirectoryStrategy;
+import org.apache.iotdb.db.service.IoTDB;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -106,4 +107,8 @@ public class Directories {
private static class DirectoriesHolder {
private static final Directories INSTANCE = new Directories();
}
+
+ public String getWALFolder() {
+ return IoTDBDescriptor.getInstance().getConfig().getWalFolder();
+ }
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
index debf646..f6745d8 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteProcessor.java
@@ -351,7 +351,7 @@ public class BufferWriteProcessor extends Processor {
filenodeFlushAction.act();
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
- logNode.notifyEndFlush(null, walTaskId, new File(writer.getInsertFilePath()).getName());
+ logNode.notifyEndFlush(walTaskId);
}
result = true;
} catch (Exception e) {
@@ -413,7 +413,7 @@ public class BufferWriteProcessor extends Processor {
}
final long walTaskId;
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
- walTaskId = logNode.notifyStartFlush(new File(writer.getInsertFilePath()).getName());
+ walTaskId = logNode.notifyStartFlush();
LOGGER.info("BufferWrite Processor {} has notified WAL for flushing.", getProcessorName());
} else {
walTaskId = 0;
@@ -577,9 +577,7 @@ public class BufferWriteProcessor extends Processor {
if (logNode == null) {
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
logNode = MultiFileLogNodeManager.getInstance().getNode(
- processorName + IoTDBConstant.BUFFERWRITE_LOG_NODE_SUFFIX,
- getBufferwriteRestoreFilePath(),
- FileNodeManager.getInstance().getRestoreFilePath(processorName));
+ processorName + IoTDBConstant.BUFFERWRITE_LOG_NODE_SUFFIX);
}
}
return logNode;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
index b6bab39..d16f405 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessor.java
@@ -496,7 +496,7 @@ public class OverflowProcessor extends Processor {
filenodeFlushAction.act();
// write-ahead log
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
- logNode.notifyEndFlush(null, walTaskId, workResource.getInsertFile().getName());
+ logNode.notifyEndFlush(walTaskId);
}
result = true;
} catch (IOException e) {
@@ -559,7 +559,7 @@ public class OverflowProcessor extends Processor {
long taskId = 0;
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
try {
- taskId = logNode.notifyStartFlush(workResource.getInsertFile().getName());
+ taskId = logNode.notifyStartFlush();
} catch (IOException e) {
LOGGER.error("Overflow processor {} encountered an error when notifying log node, {}",
getProcessorName(), e);
@@ -689,9 +689,7 @@ public class OverflowProcessor extends Processor {
if (logNode == null) {
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
logNode = MultiFileLogNodeManager.getInstance().getNode(
- processorName + IoTDBConstant.OVERFLOW_LOG_NODE_SUFFIX,
- getOverflowRestoreFile(),
- FileNodeManager.getInstance().getRestoreFilePath(processorName));
+ processorName + IoTDBConstant.OVERFLOW_LOG_NODE_SUFFIX);
}
}
return logNode;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/PhysicalPlan.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/PhysicalPlan.java
index 07d1e75..d83491e 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/PhysicalPlan.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/PhysicalPlan.java
@@ -31,6 +31,11 @@ public abstract class PhysicalPlan implements Serializable {
private static final long serialVersionUID = -6274856391535568352L;
private boolean isQuery;
private Operator.OperatorType operatorType;
+ /**
+ * plans in a Storage Group are executed serially, this id is to guarantee in recovery stage plans
+ * in WAL can be redone in the same order
+ */
+ private long planId;
/**
* The name of the user who proposed this operation.
@@ -79,4 +84,12 @@ public abstract class PhysicalPlan implements Serializable {
public void setQuery(boolean query) {
isQuery = query;
}
+
+ public long getPlanId() {
+ return planId;
+ }
+
+ public void setPlanId(long planId) {
+ this.planId = planId;
+ }
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransfer.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransfer.java
index 6d11b11..8ff9e52 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransfer.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransfer.java
@@ -28,7 +28,7 @@ public class PhysicalPlanLogTransfer {
private PhysicalPlanLogTransfer() {
}
- public static byte[] operatorToLog(PhysicalPlan plan) throws IOException {
+ public static byte[] planToLog(PhysicalPlan plan) throws IOException {
Codec<PhysicalPlan> codec;
switch (plan.getOperatorType()) {
case INSERT:
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java
index 9e54750..e2e21e1 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/LogWriter.java
@@ -40,6 +40,10 @@ public class LogWriter implements ILogWriter {
logFile = new File(logFilePath);
}
+ public LogWriter(File logFile) {
+ this.logFile = logFile;
+ }
+
@Override
public void write(List<byte[]> logCache) throws IOException {
if (outputStream == null) {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
index bf1e816..8b20df2 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/MultiFileLogNodeManager.java
@@ -46,31 +46,6 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
private Thread forceThread;
private IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
- private final Runnable syncTask = ()->{
- while (true) {
- if (Thread.interrupted()) {
- logger.info("WAL sync thread exits.");
- break;
- }
- logger.debug("Timed sync starts, {} nodes to be flushed", nodeMap.size());
- for (WriteLogNode node : nodeMap.values()) {
- try {
- node.forceSync();
- } catch (IOException e) {
- logger.error("Cannot sync {}", node, e);
- }
- }
- logger.debug("Timed sync finished");
- try {
- Thread.sleep(config.getFlushWalPeriodInMs());
- } catch (InterruptedException e) {
- logger.info("WAL sync thread exits.");
- Thread.currentThread().interrupt();
- break;
- }
- }
- };
-
private final Runnable forceTask = () -> {
while (true) {
if (Thread.interrupted()) {
@@ -80,7 +55,7 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
logger.debug("Timed force starts, {} nodes to be flushed", nodeMap.size());
for (WriteLogNode node : nodeMap.values()) {
try {
- node.force();
+ node.forceSync();
} catch (IOException e) {
logger.error("Cannot force {}, because {}", node.toString(), e.toString());
}
@@ -106,12 +81,11 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
@Override
- public WriteLogNode getNode(String identifier, String restoreFilePath,
- String processorStoreFilePath)
+ public WriteLogNode getNode(String identifier)
throws IOException {
WriteLogNode node = nodeMap.get(identifier);
- if (node == null && restoreFilePath != null && processorStoreFilePath != null) {
- node = new ExclusiveWriteLogNode(identifier, restoreFilePath, processorStoreFilePath);
+ if (node == null) {
+ node = new ExclusiveWriteLogNode(identifier);
WriteLogNode oldNode = nodeMap.putIfAbsent(identifier, node);
if (oldNode != null) {
return oldNode;
@@ -208,8 +182,6 @@ public class MultiFileLogNodeManager implements WriteLogNodeManager, IService {
return;
}
if (!isActivated(syncThread)) {
- InstanceHolder.instance.syncThread = new Thread(InstanceHolder.instance.syncTask,
- ThreadName.WAL_DAEMON.getName());
InstanceHolder.instance.syncThread.start();
if (config.getForceWalPeriodInMs() > 0 && !isActivated(forceThread)) {
InstanceHolder.instance.forceThread = new Thread(InstanceHolder.instance.forceTask,
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java
index 57b3e44..123e49b 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/manager/WriteLogNodeManager.java
@@ -34,11 +34,8 @@ public interface WriteLogNodeManager {
* provided and the LogNode does not exist, null is returned.
*
* @param identifier -identifier, the format: "{storageGroupName}-bufferwrite/overflow"
- * @param restoreFilePath -restore file path of the data file. e.g, data/settled/{storageGroupName}/{tsfileName}.restore
- * @param processorStoreFilePath -processor store file path. e.g., data/system/info/{storageGroupName}/{storageGroupName}.restore
*/
- WriteLogNode getNode(String identifier, String restoreFilePath, String processorStoreFilePath)
- throws IOException;
+ WriteLogNode getNode(String identifier) throws IOException;
/**
* Delete a log node. If the node log does not exist, this will be an empty operation.
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
index 8ebddb4..a91b7a3 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/ExclusiveWriteLogNode.java
@@ -21,29 +21,28 @@ package org.apache.iotdb.db.writelog.node;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
-import java.util.concurrent.atomic.AtomicLong;
+import java.util.Map;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.apache.commons.io.FileUtils;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
+import org.apache.iotdb.db.conf.directories.Directories;
import org.apache.iotdb.db.exception.RecoverException;
import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.db.qp.physical.transfer.PhysicalPlanLogTransfer;
-import org.apache.iotdb.db.utils.MemUtils;
import org.apache.iotdb.db.writelog.LogPosition;
import org.apache.iotdb.db.writelog.io.ILogWriter;
import org.apache.iotdb.db.writelog.io.LogWriter;
-import org.apache.iotdb.db.writelog.recover.ExclusiveLogRecoverPerformer;
import org.apache.iotdb.db.writelog.recover.RecoverPerformer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * This WriteLogNode is used to manage write ahead logs of a single FileNode.
+ * This WriteLogNode is used to manage write ahead logs of BufferWrite or Overflow of a single
+ * StorageGroup.
*/
public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<ExclusiveWriteLogNode> {
@@ -51,7 +50,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
public static final String OLD_SUFFIX = "-old";
private static final Logger logger = LoggerFactory.getLogger(ExclusiveWriteLogNode.class);
/**
- * This should be the same as the corresponding FileNode's name.
+ * This should be the same as the corresponding StorageGroup's name.
*/
private String identifier;
@@ -69,36 +68,17 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
private ReadWriteLock forceLock = new ReentrantReadWriteLock();
- private AtomicLong taskId;
+ private long fileId;
/**
* constructor of ExclusiveWriteLogNode.
*
* @param identifier ExclusiveWriteLogNode identifier
- * @param restoreFilePath restore file path
- * @param processorStoreFilePath processor store file path
*/
- public ExclusiveWriteLogNode(String identifier, String restoreFilePath,
- String processorStoreFilePath) {
+ public ExclusiveWriteLogNode(String identifier) {
this.identifier = identifier;
- this.logDirectory = config.getWalFolder() + File.separator + this.identifier;
+ this.logDirectory =
+ Directories.getInstance().getWALFolder() + File.separator + this.identifier;
new File(logDirectory).mkdirs();
- //read current wals to get the largest task id.
- long task = 1;
- Pattern pattern = Pattern.compile(OLD_SUFFIX+"(\\d+)");
- for (File file : new File(logDirectory).listFiles()) {
- Matcher matcher = pattern.matcher(file.getName());
- if (matcher.find()) {
- long id = Long.parseLong(matcher.group(1));
- if (id > task) {
- task = id;
- }
- }
- }
- taskId = new AtomicLong(task);
-
- recoverPerformer = new ExclusiveLogRecoverPerformer(restoreFilePath, processorStoreFilePath,
- this);
- currentFileWriter = new LogWriter(logDirectory + File.separator + WAL_FILE_NAME);
}
@@ -110,10 +90,10 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
* Return value is of no use in this implementation.
*/
@Override
- public LogPosition write(PhysicalPlan plan) throws IOException {
+ public void write(PhysicalPlan plan) throws IOException {
lockForWrite();
try {
- byte[] logBytes = PhysicalPlanLogTransfer.operatorToLog(plan);
+ byte[] logBytes = PhysicalPlanLogTransfer.planToLog(plan);
logCache.add(logBytes);
if (logCache.size() >= config.getFlushWalThreshold()) {
@@ -122,12 +102,10 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
} finally {
unlockForWrite();
}
- return null;
}
@Override
public void recover() throws RecoverException {
- close();
recoverPerformer.recover();
}
@@ -138,7 +116,11 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
lockForOther();
lockForForceOther();
try {
- this.currentFileWriter.close();
+ if (this.currentFileWriter != null) {
+ this.currentFileWriter.close();
+ this.currentFileWriter = null;
+ }
+
logger.debug("Log node {} closed successfully", identifier);
} catch (IOException e) {
logger.error("Cannot close log node {} because:", identifier, e);
@@ -150,42 +132,31 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
@Override
public void forceSync() {
sync();
- }
-
- @Override
- public void force() {
forceWal();
}
- /*
- * Warning : caller must have lock.
- */
- @Override
- public long notifyStartFlush(String tsFileName) {
- close();
- File oldLogFile = new File(logDirectory + File.separator + tsFileName + WAL_FILE_NAME);
- if (!oldLogFile.exists()) {
- return 0;
- }
- long id = taskId.incrementAndGet();
- File newLogFile = new File(logDirectory + File.separator + tsFileName + WAL_FILE_NAME +
- OLD_SUFFIX + id);
- if (!oldLogFile.renameTo(newLogFile)) {
- logger.error("Log node {} renaming log file failed!", identifier);
- } else {
- logger.info("Log node {} renamed log file, file size is {}", identifier,
- MemUtils.bytesCntToStr(newLogFile.length()));
+ @Override
+ public long notifyStartFlush() {
+ lockForWrite();
+ try {
+ close();
+ nextFileWriter();
+ return fileId;
+ } finally {
+ unlockForWrite();
}
- return id;
}
- /*
- * Warning : caller must have lock.
- */
@Override
- public void notifyEndFlush(List<LogPosition> logPositions, long taskId, String tsFileName) {
- discard(taskId, tsFileName);
+ public void notifyEndFlush(long fileId) {
+ lockForWrite();
+ try {
+ File logFile = new File(logDirectory, WAL_FILE_NAME + fileId);
+ discard(logFile);
+ } finally {
+ unlockForWrite();
+ }
}
@Override
@@ -245,7 +216,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
return;
}
try {
- currentFileWriter.write(logCache);
+ getCurrentFileWriter().write(logCache);
} catch (IOException e) {
logger.error("Log node {} sync failed", identifier, e);
}
@@ -261,7 +232,9 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
try {
logger.debug("Log node {} starts force, {} logs to be forced", identifier, logCache.size());
try {
- currentFileWriter.force();
+ if (currentFileWriter != null) {
+ currentFileWriter.force();
+ }
} catch (IOException e) {
logger.error("Log node {} force failed.", identifier, e);
}
@@ -271,13 +244,11 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
}
}
- private void discard(long id, String tsFileName) {
- File oldLogFile = new File(logDirectory + File.separator + tsFileName + WAL_FILE_NAME
- + OLD_SUFFIX + id);
- if (!oldLogFile.exists()) {
- logger.info("No old log to be deleted");
+ private void discard(File logFile) {
+ if (!logFile.exists()) {
+ logger.info("Log file does not exist");
} else {
- if (!oldLogFile.delete()) {
+ if (!logFile.delete()) {
logger.error("Old log file of {} cannot be deleted", identifier);
} else {
logger.info("Log node {} cleaned old file", identifier);
@@ -285,6 +256,20 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
}
}
+ private ILogWriter getCurrentFileWriter() {
+ if (currentFileWriter == null) {
+ nextFileWriter();
+ }
+ return currentFileWriter;
+ }
+
+ private void nextFileWriter() {
+ fileId ++;
+ File newFile = new File(logDirectory, WAL_FILE_NAME + fileId);
+ currentFileWriter = new LogWriter(newFile);
+ }
+
+
@Override
public String toString() {
return "Log node " + identifier;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java
index dc40731..0ea4982 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/node/WriteLogNode.java
@@ -19,7 +19,6 @@
package org.apache.iotdb.db.writelog.node;
import java.io.IOException;
-import java.util.List;
import org.apache.iotdb.db.exception.RecoverException;
import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.db.writelog.LogPosition;
@@ -32,9 +31,8 @@ public interface WriteLogNode {
* synced to disk.
*
* @param plan -plan
- * @return The position to be written of the log.
*/
- LogPosition write(PhysicalPlan plan) throws IOException;
+ void write(PhysicalPlan plan) throws IOException;
/**
* First judge the stage of recovery by status of files, and then recover from that stage.
@@ -51,26 +49,18 @@ public interface WriteLogNode {
*/
void forceSync() throws IOException;
- /*
- * Force OS to sync all written data to disk.
- */
- void force() throws IOException;
-
/**
* When a FileNode attempts to start a flush, this method must be called to rename log file.
- * @param tsFileName the name of the tsfile to which the data in this wal belongs
* @return the task id ( being used in the renamed log file)
*/
- long notifyStartFlush(String tsFileName) throws IOException;
+ long notifyStartFlush() throws IOException;
/**
* When the flush of a FlieNode ends, this method must be called to check if log file needs
* cleaning.
- * @param logPositions (deprecated)
- * @param tsFileName the name of the tsfile to which the data in this wal belongs
- * @param taskId the task id that notifyStartFlush() returns.
+ * @param fileId
*/
- void notifyEndFlush(List<LogPosition> logPositions, long taskId, String tsFileName);
+ void notifyEndFlush(long fileId);
/**
* return identifier of the log node.
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransferTest.java b/iotdb/src/test/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransferTest.java
index c747fb6..f1ea283 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransferTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/qp/physical/transfer/PhysicalPlanLogTransferTest.java
@@ -22,7 +22,6 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
-import java.util.Arrays;
import org.apache.iotdb.db.auth.AuthException;
import org.apache.iotdb.db.exception.ArgsErrorException;
import org.apache.iotdb.db.exception.ProcessorException;
@@ -53,19 +52,19 @@ public class PhysicalPlanLogTransferTest {
public void operatorToLog()
throws IOException, ArgsErrorException, ProcessorException, QueryProcessorException {
/** Insert Plan test **/
- byte[] insertPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(insertPlan);
+ byte[] insertPlanBytesTest = PhysicalPlanLogTransfer.planToLog(insertPlan);
Codec<InsertPlan> insertPlanCodec = CodecInstances.multiInsertPlanCodec;
byte[] insertPlanProperty = insertPlanCodec.encode(insertPlan);
assertArrayEquals(insertPlanProperty, insertPlanBytesTest);
/** Delete Plan test **/
- byte[] deletePlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(deletePlan);
+ byte[] deletePlanBytesTest = PhysicalPlanLogTransfer.planToLog(deletePlan);
Codec<DeletePlan> deletePlanCodec = CodecInstances.deletePlanCodec;
byte[] deletePlanProperty = deletePlanCodec.encode(deletePlan);
assertArrayEquals(deletePlanProperty, deletePlanBytesTest);
/** Update Plan test **/
- byte[] updatePlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(updatePlan);
+ byte[] updatePlanBytesTest = PhysicalPlanLogTransfer.planToLog(updatePlan);
Codec<UpdatePlan> updatePlanCodec = CodecInstances.updatePlanCodec;
byte[] updatePlanProperty = updatePlanCodec.encode(updatePlan);
assertArrayEquals(updatePlanProperty, updatePlanBytesTest);
@@ -73,7 +72,7 @@ public class PhysicalPlanLogTransferTest {
/** Metadata Plan test **/
String metadataStatement = "create timeseries root.vehicle.d1.s1 with datatype=INT32,encoding=RLE";
MetadataPlan metadataPlan = (MetadataPlan) processor.parseSQLToPhysicalPlan(metadataStatement);
- byte[] metadataPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(metadataPlan);
+ byte[] metadataPlanBytesTest = PhysicalPlanLogTransfer.planToLog(metadataPlan);
Codec<MetadataPlan> metadataPlanCodec = CodecInstances.metadataPlanCodec;
byte[] metadataPlanProperty = metadataPlanCodec.encode(metadataPlan);
assertArrayEquals(metadataPlanProperty, metadataPlanBytesTest);
@@ -81,13 +80,13 @@ public class PhysicalPlanLogTransferTest {
/** Author Plan test **/
String sql = "grant role xm privileges 'SET_STORAGE_GROUP','DELETE_TIMESERIES' on root.vehicle.device.sensor";
AuthorPlan authorPlan = (AuthorPlan) processor.parseSQLToPhysicalPlan(sql);
- byte[] authorPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(authorPlan);
+ byte[] authorPlanBytesTest = PhysicalPlanLogTransfer.planToLog(authorPlan);
Codec<AuthorPlan> authorPlanCodec = CodecInstances.authorPlanCodec;
byte[] authorPlanProperty = authorPlanCodec.encode(authorPlan);
assertArrayEquals(authorPlanProperty, authorPlanBytesTest);
/** LoadData Plan test **/
- byte[] loadDataPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(loadDataPlan);
+ byte[] loadDataPlanBytesTest = PhysicalPlanLogTransfer.planToLog(loadDataPlan);
Codec<LoadDataPlan> loadDataPlanCodec = CodecInstances.loadDataPlanCodec;
byte[] loadDataPlanProperty = loadDataPlanCodec.encode(loadDataPlan);
assertArrayEquals(loadDataPlanProperty, loadDataPlanBytesTest);
@@ -95,7 +94,7 @@ public class PhysicalPlanLogTransferTest {
/** Property Plan test **/
sql = "add label label1021 to property propropro";
PropertyPlan propertyPlan = (PropertyPlan) processor.parseSQLToPhysicalPlan(sql);
- byte[] propertyPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(propertyPlan);
+ byte[] propertyPlanBytesTest = PhysicalPlanLogTransfer.planToLog(propertyPlan);
Codec<PropertyPlan> propertyPlanCodec = CodecInstances.propertyPlanCodec;
byte[] propertyPlanProperty = propertyPlanCodec.encode(propertyPlan);
assertArrayEquals(propertyPlanProperty, propertyPlanBytesTest);
@@ -107,19 +106,19 @@ public class PhysicalPlanLogTransferTest {
throws IOException, ArgsErrorException, ProcessorException, QueryProcessorException, AuthException {
/** Insert Plan test **/
- byte[] insertPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(insertPlan);
+ byte[] insertPlanBytesTest = PhysicalPlanLogTransfer.planToLog(insertPlan);
InsertPlan insertPlanTest = (InsertPlan) PhysicalPlanLogTransfer
.logToOperator(insertPlanBytesTest);
assertEquals(insertPlanTest, insertPlan);
/** Delete Plan test **/
- byte[] deletePlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(deletePlan);
+ byte[] deletePlanBytesTest = PhysicalPlanLogTransfer.planToLog(deletePlan);
DeletePlan deletePlanTest = (DeletePlan) PhysicalPlanLogTransfer
.logToOperator(deletePlanBytesTest);
assertEquals(deletePlanTest, deletePlan);
/** Update Plan test **/
- byte[] updatePlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(updatePlan);
+ byte[] updatePlanBytesTest = PhysicalPlanLogTransfer.planToLog(updatePlan);
UpdatePlan updatePlanTest = (UpdatePlan) PhysicalPlanLogTransfer
.logToOperator(updatePlanBytesTest);
assertEquals(updatePlanTest, updatePlan);
@@ -127,7 +126,7 @@ public class PhysicalPlanLogTransferTest {
/** Metadata Plan test **/
String metadataStatement = "create timeseries root.vehicle.d1.s1 with datatype=INT32,encoding=RLE";
MetadataPlan metadataPlan = (MetadataPlan) processor.parseSQLToPhysicalPlan(metadataStatement);
- byte[] metadataPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(metadataPlan);
+ byte[] metadataPlanBytesTest = PhysicalPlanLogTransfer.planToLog(metadataPlan);
MetadataPlan metadataPlanTest = (MetadataPlan) PhysicalPlanLogTransfer
.logToOperator(metadataPlanBytesTest);
assertEquals(metadataPlanTest, metadataPlan);
@@ -135,13 +134,13 @@ public class PhysicalPlanLogTransferTest {
/** Author Plan test **/
String sql = "grant role xm privileges 'SET_STORAGE_GROUP','DELETE_TIMESERIES' on root.vehicle.device.sensor";
AuthorPlan authorPlan = (AuthorPlan) processor.parseSQLToPhysicalPlan(sql);
- byte[] authorPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(authorPlan);
+ byte[] authorPlanBytesTest = PhysicalPlanLogTransfer.planToLog(authorPlan);
AuthorPlan authorPlanTest = (AuthorPlan) PhysicalPlanLogTransfer
.logToOperator(authorPlanBytesTest);
assertEquals(authorPlanTest, authorPlan);
/** LoadData Plan test **/
- byte[] loadDataPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(loadDataPlan);
+ byte[] loadDataPlanBytesTest = PhysicalPlanLogTransfer.planToLog(loadDataPlan);
LoadDataPlan loadDataPlanTest = (LoadDataPlan) PhysicalPlanLogTransfer
.logToOperator(loadDataPlanBytesTest);
assertEquals(loadDataPlan, loadDataPlanTest);
@@ -149,7 +148,7 @@ public class PhysicalPlanLogTransferTest {
/** Property Plan test **/
sql = "add label label1021 to property propropro";
PropertyPlan propertyPlan = (PropertyPlan) processor.parseSQLToPhysicalPlan(sql);
- byte[] propertyPlanBytesTest = PhysicalPlanLogTransfer.operatorToLog(propertyPlan);
+ byte[] propertyPlanBytesTest = PhysicalPlanLogTransfer.planToLog(propertyPlan);
PropertyPlan propertyPlanTest = (PropertyPlan) PhysicalPlanLogTransfer
.logToOperator(propertyPlanBytesTest);
assertEquals(propertyPlanTest, propertyPlan);
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/tools/WalCheckerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/tools/WalCheckerTest.java
index be34d32..16862cb 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/tools/WalCheckerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/tools/WalCheckerTest.java
@@ -25,10 +25,8 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileOutputStream;
-import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.apache.commons.io.FileUtils;
import org.apache.iotdb.db.exception.SysCheckException;
@@ -82,7 +80,7 @@ public class WalCheckerTest {
String[] values = new String[]{"5", "6", "7"};
for (int j = 0; j < 10; j++) {
binaryPlans.add(PhysicalPlanLogTransfer
- .operatorToLog(new InsertPlan(deviceId, j, measurements, values)));
+ .planToLog(new InsertPlan(deviceId, j, measurements, values)));
}
logWriter.write(binaryPlans);
logWriter.force();
@@ -115,7 +113,7 @@ public class WalCheckerTest {
String[] values = new String[]{"5", "6", "7"};
for (int j = 0; j < 10; j++) {
binaryPlans.add(PhysicalPlanLogTransfer
- .operatorToLog(new InsertPlan(deviceId, j, measurements, values)));
+ .planToLog(new InsertPlan(deviceId, j, measurements, values)));
}
if (i > 2) {
binaryPlans.add("not a wal".getBytes());
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java
index 20d74ca..7714b5a 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/IoTDBLogFileSizeTest.java
@@ -115,8 +115,7 @@ public class IoTDBLogFileSizeTest {
cnt);
statement.execute(sql);
WriteLogNode logNode = MultiFileLogNodeManager.getInstance().getNode(
- "root.logFileTest.bufferwrite" + IoTDBConstant.BUFFERWRITE_LOG_NODE_SUFFIX, null,
- null);
+ "root.logFileTest.bufferwrite" + IoTDBConstant.BUFFERWRITE_LOG_NODE_SUFFIX);
File bufferWriteWALFile = new File(
logNode.getLogDirectory() + File.separator + ExclusiveWriteLogNode.WAL_FILE_NAME);
if (bufferWriteWALFile.exists() && bufferWriteWALFile.length() > maxLength[0]) {
@@ -177,8 +176,7 @@ public class IoTDBLogFileSizeTest {
++cnt, cnt);
statement.execute(sql);
WriteLogNode logNode = MultiFileLogNodeManager.getInstance()
- .getNode("root.logFileTest.overflow" + IoTDBConstant.OVERFLOW_LOG_NODE_SUFFIX, null,
- null);
+ .getNode("root.logFileTest.overflow" + IoTDBConstant.OVERFLOW_LOG_NODE_SUFFIX);
File WALFile = new File(
logNode.getLogDirectory() + File.separator + ExclusiveWriteLogNode.WAL_FILE_NAME);
if (WALFile.exists() && WALFile.length() > maxLength[0]) {
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
index 17777e7..58c59ac 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/PerformanceTest.java
@@ -20,7 +20,6 @@ package org.apache.iotdb.db.writelog;
import java.io.File;
import java.io.IOException;
-import java.util.Arrays;
import org.apache.iotdb.db.conf.IoTDBConfig;
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.FileNodeManagerException;
@@ -86,9 +85,7 @@ public class PerformanceTest {
tempRestore.createNewFile();
tempProcessorStore.createNewFile();
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode",
- tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode");
long time = System.currentTimeMillis();
for (int i = 0; i < 1000000; i++) {
@@ -149,9 +146,7 @@ public class PerformanceTest {
TSEncoding.PLAIN.name());
MManager.getInstance().addPathToMTree("root.logTestDevice.s4", TSDataType.BOOLEAN.name(),
TSEncoding.PLAIN.name());
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice",
- tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice");
for (int i = 0; i < 1000000; i++) {
InsertPlan bwInsertPlan = new InsertPlan(1, "root.logTestDevice", 100,
@@ -199,9 +194,9 @@ public class PerformanceTest {
DeletePlan deletePlan = new DeletePlan(50, new Path("root.logTestDevice.s1"));
for (int i = 0; i < 1000000; i++) {
- bytes1 = PhysicalPlanLogTransfer.operatorToLog(bwInsertPlan);
- bytes2 = PhysicalPlanLogTransfer.operatorToLog(updatePlan);
- bytes3 = PhysicalPlanLogTransfer.operatorToLog(deletePlan);
+ bytes1 = PhysicalPlanLogTransfer.planToLog(bwInsertPlan);
+ bytes2 = PhysicalPlanLogTransfer.planToLog(updatePlan);
+ bytes3 = PhysicalPlanLogTransfer.planToLog(deletePlan);
}
System.out.println("3000000 logs encoding use " + (System.currentTimeMillis() - time) + "ms");
@@ -223,7 +218,7 @@ public class PerformanceTest {
new String[]{"1.0", "15", "str", "false"});
long time = System.currentTimeMillis();
for (int i = 0; i < 1000000; i++) {
- byte[] bytes = PhysicalPlanLogTransfer.operatorToLog(bwInsertPlan);
+ byte[] bytes = PhysicalPlanLogTransfer.planToLog(bwInsertPlan);
}
System.out.println("1000000 logs encoding use " + (System.currentTimeMillis() - time) + "ms");
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java
index 45bd737..4caaed4 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/RecoverTest.java
@@ -78,9 +78,7 @@ public class RecoverTest {
MManager.getInstance().setStorageLevelToMTree("root.testLogNode");
} catch (PathErrorException ignored) {
}
- ExclusiveWriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode",
- tempRestore.getPath(),
- tempProcessorStore.getPath());
+ ExclusiveWriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode");
try {
InsertPlan bwInsertPlan = new InsertPlan(1, "logTestDevice", 100,
@@ -96,7 +94,7 @@ public class RecoverTest {
logNode.write(bwInsertPlan);
logNode.write(updatePlan);
- logNode.notifyStartFlush("test");
+ logNode.notifyStartFlush();
logNode.write(deletePlan);
logNode.forceSync();
@@ -150,9 +148,7 @@ public class RecoverTest {
MManager.getInstance().setStorageLevelToMTree("root.testLogNode");
} catch (PathErrorException ignored) {
}
- ExclusiveWriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode",
- tempRestore.getPath(),
- tempProcessorStore.getPath());
+ ExclusiveWriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode");
try {
// set flag
@@ -228,9 +224,7 @@ public class RecoverTest {
MManager.getInstance().setStorageLevelToMTree("root.testLogNode");
} catch (PathErrorException ignored) {
}
- ExclusiveWriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode",
- tempRestore.getPath(),
- tempProcessorStore.getPath());
+ ExclusiveWriteLogNode logNode = new ExclusiveWriteLogNode("root.testLogNode");
try {
// set flag
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java
index e03c418..13c372c 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeManagerTest.java
@@ -72,7 +72,7 @@ public class WriteLogNodeManagerTest {
WriteLogNodeManager manager = MultiFileLogNodeManager.getInstance();
WriteLogNode logNode = manager
- .getNode("root.managerTest", tempRestore.getPath(), tempProcessorStore.getPath());
+ .getNode("root.managerTest");
InsertPlan bwInsertPlan = new InsertPlan(1, "logTestDevice", 100,
new String[]{"s1", "s2", "s3", "s4"},
@@ -119,7 +119,7 @@ public class WriteLogNodeManagerTest {
} catch (PathErrorException ignored) {
}
WriteLogNode logNode = manager
- .getNode(deviceName, tempRestore.getPath(), tempProcessorStore.getPath());
+ .getNode(deviceName);
InsertPlan bwInsertPlan = new InsertPlan(1, deviceName, 100,
new String[]{"s1", "s2", "s3", "s4"},
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java
index 9a4fc61..06c78b5 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/WriteLogNodeTest.java
@@ -71,8 +71,7 @@ public class WriteLogNodeTest {
tempProcessorStore.createNewFile();
CRC32 crc32 = new CRC32();
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice", tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice");
InsertPlan bwInsertPlan = new InsertPlan(1, "root.logTestDevice", 100,
new String[]{"s1", "s2", "s3", "s4"},
@@ -145,8 +144,7 @@ public class WriteLogNodeTest {
tempRestore.createNewFile();
tempProcessorStore.createNewFile();
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice", tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice");
InsertPlan bwInsertPlan = new InsertPlan(1, "root.logTestDevice", 100,
new String[]{"s1", "s2", "s3", "s4"},
@@ -164,13 +162,13 @@ public class WriteLogNodeTest {
config.getWalFolder() + File.separator + "root.logTestDevice" + File.separator + "wal");
assertTrue(walFile.exists());
- long taskId = logNode.notifyStartFlush("test");
+ long taskId = logNode.notifyStartFlush();
File oldWalFile = new File(
config.getWalFolder() + File.separator + "root.logTestDevice" + File.separator + "wal-old"+taskId);
assertTrue(oldWalFile.exists());
assertTrue(oldWalFile.length() > 0);
- logNode.notifyEndFlush(null, taskId, "test");
+ logNode.notifyEndFlush(taskId);
assertTrue(!oldWalFile.exists());
assertEquals(0, walFile.length());
@@ -191,8 +189,7 @@ public class WriteLogNodeTest {
tempRestore.createNewFile();
tempProcessorStore.createNewFile();
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice", tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice");
InsertPlan bwInsertPlan = new InsertPlan(1, "root.logTestDevice", 100,
new String[]{"s1", "s2", "s3", "s4"},
@@ -227,8 +224,7 @@ public class WriteLogNodeTest {
tempRestore.createNewFile();
tempProcessorStore.createNewFile();
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice", tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice");
InsertPlan bwInsertPlan = new InsertPlan(1, "logTestDevice", 100,
new String[]{"s1", "s2", "s3", "s4"},
@@ -264,9 +260,7 @@ public class WriteLogNodeTest {
tempRestore.createNewFile();
tempProcessorStore.createNewFile();
- WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice.oversize",
- tempRestore.getPath(),
- tempProcessorStore.getPath());
+ WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice.oversize");
InsertPlan bwInsertPlan = new InsertPlan(1, "root.logTestDevice.oversize", 100,
new String[]{"s1", "s2", "s3", "s4"},
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java b/iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java
index dc40b84..e3e16e7 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/writelog/io/LogWriterReaderTest.java
@@ -23,7 +23,6 @@ import static org.junit.Assert.assertArrayEquals;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
import org.apache.iotdb.db.qp.physical.PhysicalPlan;
import org.apache.iotdb.db.qp.physical.crud.DeletePlan;
@@ -56,7 +55,7 @@ public class LogWriterReaderTest {
plans.add(updatePlan);
plans.add(deletePlan);
for (PhysicalPlan plan : plans) {
- logs.add(PhysicalPlanLogTransfer.operatorToLog(plan));
+ logs.add(PhysicalPlanLogTransfer.planToLog(plan));
}
}
@@ -70,7 +69,7 @@ public class LogWriterReaderTest {
RAFLogReader reader = new RAFLogReader(new File(filePath));
List<byte[]> res = new ArrayList<>();
while (reader.hasNext()) {
- res.add(PhysicalPlanLogTransfer.operatorToLog(reader.next()));
+ res.add(PhysicalPlanLogTransfer.planToLog(reader.next()));
}
for (int i = 0; i < logs.size(); i++) {
assertArrayEquals(logs.get(i), res.get(i));