You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2019/06/21 06:48:21 UTC
[incubator-iotdb] branch feature_async_close_tsfile updated: remove
statistic
This is an automated email from the ASF dual-hosted git repository.
qiaojialin 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 1535239 remove statistic
1535239 is described below
commit 153523933f60a972f82255ff16c75845898938bc
Author: qiaojialin <64...@qq.com>
AuthorDate: Fri Jun 21 14:48:06 2019 +0800
remove statistic
---
iotdb/iotdb/conf/iotdb-engine.properties | 20 ++--
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 10 +-
.../java/org/apache/iotdb/db/engine/Processor.java | 10 +-
.../engine/bufferwrite/BufferWriteProcessor.java | 12 +--
.../bufferwrite/RestorableTsFileIOWriter.java | 8 +-
.../iotdb/db/engine/filenode/FileNodeManager.java | 22 ++--
.../db/engine/filenode/FileNodeProcessor.java | 16 +--
.../db/engine/filenodeV2/FileNodeManagerV2.java | 116 +++------------------
.../db/engine/filenodeV2/FileNodeProcessorV2.java | 14 +--
.../filenodeV2/UnsealedTsFileProcessorV2.java | 8 +-
.../db/engine/memtable/MemTableFlushTask.java | 2 +-
.../db/engine/overflow/io/OverflowProcessor.java | 6 +-
.../org/apache/iotdb/db/metadata/MManager.java | 4 +-
.../org/apache/iotdb/db/monitor/IStatistic.java | 2 +-
.../apache/iotdb/db/monitor/MonitorConstants.java | 6 +-
.../physical/transfer/PhysicalPlanLogTransfer.java | 2 +-
.../db/query/control/QueryResourceManager.java | 2 +-
.../org/apache/iotdb/db/service/TSServiceImpl.java | 2 +-
.../iotdb/db/sync/receiver/SyncServiceImpl.java | 4 +-
.../iotdb/db/sync/sender/SyncSenderImpl.java | 2 +-
.../java/org/apache/iotdb/db/tools/WalChecker.java | 2 +-
.../java/org/apache/iotdb/db/utils/IOUtils.java | 6 +-
.../org/apache/iotdb/db/utils/LoadDataUtils.java | 8 +-
.../apache/iotdb/db/writelog/io/ILogWriter.java | 2 +-
.../db/writelog/node/ExclusiveWriteLogNode.java | 4 +-
.../iotdb/db/writelog/node/WriteLogNode.java | 2 +-
.../engine/bufferwrite/BufferWriteBenchmark.java | 2 +-
.../bufferwrite/RestorableTsFileIOWriterTest.java | 8 +-
.../filenodeV2/UnsealedTsFileProcessorV2Test.java | 7 +-
.../db/engine/memcontrol/IoTDBMemControlTest.java | 2 +-
.../engine/overflow/io/OverflowProcessorTest.java | 4 +-
.../iotdb/db/integration/IoTDBVersionIT.java | 2 +-
.../iotdb/db/monitor/collector/FileSizeTest.java | 2 +-
.../apache/iotdb/db/writelog/PerformanceTest.java | 4 +-
.../org/apache/iotdb/db/writelog/RecoverTest.java | 2 +-
.../apache/iotdb/db/writelog/WriteLogNodeTest.java | 6 +-
36 files changed, 121 insertions(+), 210 deletions(-)
diff --git a/iotdb/iotdb/conf/iotdb-engine.properties b/iotdb/iotdb/conf/iotdb-engine.properties
index bc43953..6752691 100644
--- a/iotdb/iotdb/conf/iotdb-engine.properties
+++ b/iotdb/iotdb/conf/iotdb-engine.properties
@@ -29,19 +29,19 @@ rpc_port=6667
### Write Ahead Log Configuration
####################
-# Is write ahead log enable
+# Is insert ahead log enable
enable_wal=true
-# When a certain amount of write ahead log is reached, it will be flushed to disk
+# When a certain amount of insert ahead log is reached, it will be flushed to disk
# It is possible to lose at most flush_wal_threshold operations
flush_wal_threshold=10000
-# The cycle when write ahead log is periodically refreshed to disk(in milliseconds)
+# The cycle when insert ahead log is periodically refreshed to disk(in milliseconds)
# It is possible to lose at most flush_wal_period_in_ms ms operations
flush_wal_period_in_ms=10
-# The cycle when write ahead log is periodically forced to be written to disk(in milliseconds)
-# If force_wal_period_in_ms = 0 it means force write ahead log to be written to disk after each refreshment
+# The cycle when insert ahead log is periodically forced to be written to disk(in milliseconds)
+# If force_wal_period_in_ms = 0 it means force insert ahead log to be written to disk after each refreshment
# Set this parameter to 0 may slow down the ingestion on slow disk.
force_wal_period_in_ms=10
@@ -147,10 +147,10 @@ enable_timing_close_and_merge=true
# eg. +08:00, -01:00
time_zone=+08:00
-# if memory used by write reaches this threshold, auto flush will be triggered, percentile of Java heap memory
+# if memory used by insert reaches this threshold, auto flush will be triggered, percentile of Java heap memory
mem_threshold_warning=0.5
-# if memory used by write reaches this threshold, write will be blocked, percentile of Java heap memory
+# if memory used by insert reaches this threshold, insert will be blocked, percentile of Java heap memory
mem_threshold_dangerous=0.6
# every such interval, a thread will check if memory exceeds mem_threshold_warning
@@ -214,7 +214,7 @@ small_flush_interval=60000
external_sort_threshold=50
# cache size for MManager.
-# This cache is used to improve write speed where all path check and TSDataType will be cached in MManager with corresponding Path.
+# This cache is used to improve insert speed where all path check and TSDataType will be cached in MManager with corresponding Path.
schema_manager_cache_size=300000
# If the size in byte of a WAL log exceeds this, it won't be written.
@@ -239,7 +239,7 @@ IP_white_list=0.0.0.0/0
# The processing strategy chosen by the sync server when merging the sync data.
# 1. If the sync data accounts for more than 50% of the update of the historical data (compared with the latest timestamp of the local storage group data),then it is recommended to select strategy 1.
-# Setting the parameter to true, which has a greater impact on the write performance of the IoTDB system and occupies less CPU of the machine.
+# Setting the parameter to true, which has a greater impact on the insert performance of the IoTDB system and occupies less CPU of the machine.
# 2. If the sync data accounts for less than 50% of the update of the historical data (compared with the latest timestamp of the local storage group data),then it is recommended to select strategy 2.
-# Setting the parameter to false, which has little impact on the write performance of IoTDB system and takes up a large amount of CPU power.
+# Setting the parameter to false, which has little impact on the insert performance of IoTDB system and takes up a large amount of CPU power.
update_historical_data_possibility=false
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index b830929..a2ce8ae 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -45,25 +45,25 @@ public class IoTDBConfig {
private int rpcPort = 6667;
/**
- * Is the write ahead log enable.
+ * Is the insert ahead log enable.
*/
private boolean enableWal = false;
/**
- * When a certain amount of write ahead logs is reached, they will be flushed to the disk. It is
+ * When a certain amount of insert ahead logs is reached, they will be flushed to the disk. It is
* possible to lose at most flush_wal_threshold operations.
*/
private int flushWalThreshold = 10000;
/**
- * The cycle when write ahead logs are periodically refreshed to disk(in milliseconds). It is
+ * The cycle when insert ahead logs are periodically refreshed to disk(in milliseconds). It is
* possible to lose at most flush_wal_period_in_ms ms operations.
*/
private long flushWalPeriodInMs = 10000;
/**
- * The cycle when write ahead log is periodically forced to be written to disk(in milliseconds) If
- * set this parameter to 0 it means call outputStream.force(true) after every each write
+ * The cycle when insert ahead log is periodically forced to be written to disk(in milliseconds) If
+ * set this parameter to 0 it means call outputStream.force(true) after every each insert
*/
private long forceWalPeriodInMs = 10;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/Processor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/Processor.java
index 946a71b..76b9704 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/Processor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/Processor.java
@@ -71,7 +71,7 @@ public abstract class Processor {
}
/**
- * Acquire the write lock
+ * Acquire the insert lock
*/
public void writeLock() {
lock.writeLock().lock();
@@ -79,7 +79,7 @@ public abstract class Processor {
}
/**
- * Release the write lock
+ * Release the insert lock
*/
public void writeUnlock() {
// start = System.currentTimeMillis() - start;
@@ -91,7 +91,7 @@ public abstract class Processor {
/**
* @param isWriteLock
- * true acquire write lock, false acquire cloneList lock
+ * true acquire insert lock, false acquire cloneList lock
*/
public void lock(boolean isWriteLock) {
if (isWriteLock) {
@@ -112,7 +112,7 @@ public abstract class Processor {
/**
* @param isWriteUnlock
- * true putBack write lock, false putBack cloneList unlock
+ * true putBack insert lock, false putBack cloneList unlock
*/
public void unlock(boolean isWriteUnlock) {
// start = System.currentTimeMillis() - start;
@@ -136,7 +136,7 @@ public abstract class Processor {
}
/**
- * Try to get the write lock
+ * Try to get the insert lock
*
* @return
*/
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 c7d7709..71495b0 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
@@ -168,7 +168,7 @@ public class BufferWriteProcessor extends Processor {
/**
* Only for Test
*
- * write one data point to the buffer write.
+ * insert one data point to the buffer insert.
*
* @param deviceId device name
* @param measurementId sensor name
@@ -204,7 +204,7 @@ public class BufferWriteProcessor extends Processor {
start1 = System.currentTimeMillis() - start1;
if (start1 > 1000) {
- LOGGER.info("BufferWriteProcessor.write step1 cost: {}", start1);
+ LOGGER.info("BufferWriteProcessor.insert step1 cost: {}", start1);
}
String memory;
@@ -219,10 +219,10 @@ public class BufferWriteProcessor extends Processor {
valueCount++;
start2 = System.currentTimeMillis() - start2;
if (start2 > 1000) {
- LOGGER.info("BufferWriteProcessor.write step2 of SAFE cost: {}", start2);
+ LOGGER.info("BufferWriteProcessor.insert step2 of SAFE cost: {}", start2);
Map<MemTableWriteTimeCostType, long[]> map = MemTableWriteTimeCost.getInstance().getTimeCostMaps().get(Thread.currentThread().getName());
for(MemTableWriteTimeCostType type: MemTableWriteTimeCostType.values()){
- LOGGER.info("In BufferWriteProcessor.write step2 of SAFE, {} cost {} ms, execute {} times", type, map.get(type)[1], map.get(type)[0]);
+ LOGGER.info("In BufferWriteProcessor.insert step2 of SAFE, {} cost {} ms, execute {} times", type, map.get(type)[1], map.get(type)[0]);
}
}
checkMemThreshold4Flush(memUsage);
@@ -238,10 +238,10 @@ public class BufferWriteProcessor extends Processor {
valueCount++;
start2 = System.currentTimeMillis() - start2;
if (start2 > 1000) {
- LOGGER.info("BufferWriteProcessor.write step2 of WARNING cost: {}", start2);
+ LOGGER.info("BufferWriteProcessor.insert step2 of WARNING cost: {}", start2);
Map<MemTableWriteTimeCostType, long[]> map = MemTableWriteTimeCost.getInstance().getTimeCostMaps().get(Thread.currentThread().getName());
for(MemTableWriteTimeCostType type: MemTableWriteTimeCostType.values()){
- LOGGER.info("In BufferWriteProcessor.write step2 of WARNING, {} cost {} ms, execute {} times", type, map.get(type)[1], map.get(type)[0]);
+ LOGGER.info("In BufferWriteProcessor.insert step2 of WARNING, {} cost {} ms, execute {} times", type, map.get(type)[1], map.get(type)[0]);
}
}
try {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriter.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriter.java
index 92b6f84..1db0f91 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriter.java
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
* A tsfile io writer that has the ability to restore an incomplete tsfile. <br/> An incomplete
* tsfile represents the file which does not have tsfile metadata in the end. Besides, the last
* Chunk group data may be broken. This class can slice off the broken Chunk group data, accept
- * writing new data, and finally write the tsfile metadata. <br/> There are two cases: (1) though
+ * writing new data, and finally insert the tsfile metadata. <br/> There are two cases: (1) though
* the tsfile loses the tsfile metadata in the end, a corresponding. restore file exists. (2) no
* .restore file, and then the class has to traverse all the data for fixing the file.
*/
@@ -165,12 +165,12 @@ public class RestorableTsFileIOWriter extends TsFileIOWriter {
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
tsDeviceMetadata.serializeTo(baos);
- // write metadata size using int
+ // insert metadata size using int
int metadataSize = baos.size();
out.write(BytesUtils.intToBytes(metadataSize));
- // write metadata
+ // insert metadata
out.write(baos.toByteArray());
- // write tsfile position using byte[8] which is a long
+ // insert tsfile position using byte[8] which is a long
byte[] lastPositionBytes = BytesUtils.longToBytes(lastPosition);
out.write(lastPositionBytes);
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java
index 9e42101..13f2086 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeManager.java
@@ -327,7 +327,7 @@ public class FileNodeManager implements IStatistic, IService {
insertType = 2;
}
} catch (FileNodeProcessorException e) {
- LOGGER.error(String.format("Encounter an error when closing the buffer write processor %s.",
+ LOGGER.error(String.format("Encounter an error when closing the buffer insert processor %s.",
fileNodeProcessor.getProcessorName()), e);
throw new FileNodeManagerException(e);
} finally {
@@ -403,13 +403,13 @@ public class FileNodeManager implements IStatistic, IService {
}
throw new FileNodeManagerException(e);
}
- // write wal
+ // insert wal
try {
writeLog(tsRecord, isMonitor, overflowProcessor.getLogNode());
} catch (IOException e) {
throw new FileNodeManagerException(e);
}
- // write overflow data
+ // insert overflow data
try {
overflowProcessor.insert(tsRecord);
fileNodeProcessor.changeTypeToChanged(deviceId, timestamp);
@@ -477,7 +477,7 @@ public class FileNodeManager implements IStatistic, IService {
long start2 = System.currentTimeMillis();
long start2_1 = start2;
- // write wal
+ // insert wal
try {
writeLog(tsRecord, isMonitor, bufferWriteProcessor.getLogNode());
} catch (IOException e) {
@@ -503,7 +503,7 @@ public class FileNodeManager implements IStatistic, IService {
try {
long start2_3 = System.currentTimeMillis();
- // write tsrecord and check flushMetadata
+ // insert tsrecord and check flushMetadata
if (!bufferWriteProcessor.write(tsRecord)) {
start2_3 = System.currentTimeMillis() - start2_3;
if (start2_3 > 1000) {
@@ -548,7 +548,7 @@ public class FileNodeManager implements IStatistic, IService {
fileNodeProcessor.closeBufferWrite();
start3 = System.currentTimeMillis() - start3;
if (start3 > 1000) {
- LOGGER.info("FileNodeManager.insertBufferWrite step-3, setCloseMark buffer write cost: {}", start3);
+ LOGGER.info("FileNodeManager.insertBufferWrite step-3, setCloseMark buffer insert cost: {}", start3);
}
}
}
@@ -589,7 +589,7 @@ public class FileNodeManager implements IStatistic, IService {
fileNodeProcessor.changeTypeToChanged(deviceId, startTime, finalEndTime);
fileNodeProcessor.setOverflowed(true);
- // write wal
+ // insert wal
try {
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
overflowProcessor.getLogNode().write(
@@ -619,7 +619,7 @@ public class FileNodeManager implements IStatistic, IService {
+ "the filenode processor is {}",
fileNodeProcessor.getProcessorName());
} else {
- // write wal
+ // insert wal
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
// get processors for wal
String filenodeName = fileNodeProcessor.getProcessorName();
@@ -674,7 +674,7 @@ public class FileNodeManager implements IStatistic, IService {
FileNodeProcessor processor = processorMap.get(processorName);
if (!processor.tryWriteLock()) {
throw new FileNodeManagerException(String
- .format("Can't delete the filenode processor %s because Can't get the write lock.",
+ .format("Can't delete the filenode processor %s because Can't get the insert lock.",
processorName));
}
@@ -1004,7 +1004,7 @@ public class FileNodeManager implements IStatistic, IService {
}
} else {
LOGGER.info(
- "Can't delete the filenode processor {}, because it can't get the write lock."
+ "Can't delete the filenode processor {}, because it can't get the insert lock."
+ " Wait 100ms to retry", processorName);
}
try {
@@ -1110,7 +1110,7 @@ public class FileNodeManager implements IStatistic, IService {
LOGGER.info("Try to setCloseMark the filenode processor {}.", processorName);
FileNodeProcessor processor = processorMap.get(processorName);
if (!processor.tryWriteLock()) {
- LOGGER.warn("Can't get the write lock of the filenode processor {}.", processorName);
+ LOGGER.warn("Can't get the insert lock of the filenode processor {}.", processorName);
return;
}
try {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
index 0d457d2..a61edc9 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
@@ -442,7 +442,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
}
/**
- * if overflow insert, update and delete write into this filenode processor, set
+ * if overflow insert, update and delete insert into this filenode processor, set
* <code>isOverflowed</code> to true.
*/
public void setOverflowed(boolean isOverflowed) {
@@ -535,7 +535,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
}
/**
- * get buffer write processor by processor name and insert time.
+ * get buffer insert processor by processor name and insert time.
*/
public BufferWriteProcessor getBufferWriteProcessor(String processorName, long insertTime)
throws FileNodeProcessorException {
@@ -1145,7 +1145,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
zoneId), ofInstant(Instant.ofEpochMilli(endTime), zoneId), timeConsume,
numOfMergeFiles / (float) allNeedMergeFiles * 100);
} catch (IOException | PathErrorException e) {
- LOGGER.error("Merge: query and write data error.", e);
+ LOGGER.error("Merge: query and insert data error.", e);
throw new FileNodeProcessorException(e);
}
} else if (backupIntervalFile.getOverflowChangeType() == OverflowChangeType.MERGING_CHANGE) {
@@ -1313,11 +1313,11 @@ public class FileNodeProcessor extends Processor implements IStatistic {
writeStoreToDisk(fileNodeProcessorStore);
} catch (FileNodeProcessorException e) {
LOGGER.error(
- "Merge: failed to write filenode information to revocery file, the filenode is " +
+ "Merge: failed to insert filenode information to revocery file, the filenode is " +
"{}.",
getProcessorName(), e);
throw new FileNodeProcessorException(
- "Merge: write filenode information to revocery file failed, the filenode is "
+ "Merge: insert filenode information to revocery file failed, the filenode is "
+ getProcessorName());
}
}
@@ -1400,7 +1400,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
// overflow switch from merge to work
overflowProcessor.switchMergeToWork();
- // write status to file
+ // insert status to file
isMerging = FileNodeProcessorStatus.NONE;
synchronized (fileNodeProcessorStore) {
fileNodeProcessorStore.setFileNodeProcessorStatus(isMerging);
@@ -1592,7 +1592,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
// start a new rowGroupMetadata
mergeIsChunkGroupHasData = true;
// the datasize and numOfChunk is fake
- // the accurate datasize and numOfChunk will get after write all this device data.
+ // the accurate datasize and numOfChunk will get after insert all this device data.
mergeFileWriter.startFlushChunkGroup(path.getDevice());// TODO please check me.
mergeStartPos = mergeFileWriter.getPos();
}
@@ -1603,7 +1603,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
int pageSizeThreshold = TSFileConfig.pageSizeInByte;
ChunkWriterImpl seriesWriterImpl = new ChunkWriterImpl(measurementSchema, pageWriter,
pageSizeThreshold);
- // write the series data
+ // insert the series data
writeOneSeries(path.getDevice(), seriesWriterImpl, dataType,
seriesReader,
startTimeMap, endTimeMap, timeValuePair);
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerV2.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerV2.java
index 7af1dbd..dac26b8 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerV2.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeManagerV2.java
@@ -20,18 +20,14 @@ package org.apache.iotdb.db.engine.filenodeV2;
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
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.engine.filenode.FileNodeProcessor;
import org.apache.iotdb.db.engine.filenode.TsFileResource;
import org.apache.iotdb.db.engine.querycontext.QueryDataSourceV2;
@@ -40,9 +36,6 @@ import org.apache.iotdb.db.exception.FileNodeProcessorException;
import org.apache.iotdb.db.exception.PathErrorException;
import org.apache.iotdb.db.exception.StartupException;
import org.apache.iotdb.db.metadata.MManager;
-import org.apache.iotdb.db.monitor.IStatistic;
-import org.apache.iotdb.db.monitor.MonitorConstants;
-import org.apache.iotdb.db.monitor.StatMonitor;
import org.apache.iotdb.db.query.context.QueryContext;
import org.apache.iotdb.db.service.IService;
import org.apache.iotdb.db.service.ServiceType;
@@ -57,12 +50,11 @@ import org.apache.iotdb.tsfile.write.record.TSRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class FileNodeManagerV2 implements IStatistic, IService {
+public class FileNodeManagerV2 implements IService {
private static final Logger LOGGER = LoggerFactory
.getLogger(org.apache.iotdb.db.engine.filenodeV2.FileNodeManagerV2.class);
private static final IoTDBConfig config = IoTDBDescriptor.getInstance().getConfig();
- private static final Directories directories = Directories.getInstance();
/**
* a folder (system/info/ by default) that persist FileNodeProcessorStore classes. Ends with
@@ -87,11 +79,6 @@ public class FileNodeManagerV2 implements IStatistic, IService {
*/
private volatile FileNodeManagerStatus fileNodeManagerStatus = FileNodeManagerStatus.NONE;
- /**
- * There is no need to add concurrently
- **/
- private HashMap<String, AtomicLong> statParamsHashMap;
-
private enum FileNodeManagerStatus {
NONE, MERGE, CLOSE
}
@@ -135,22 +122,22 @@ public class FileNodeManagerV2 implements IStatistic, IService {
private FileNodeProcessorV2 getProcessor(String devicePath)
throws FileNodeManagerException {
- String filenodeName = "";
+ String storageGroup = "";
try {
// return the storage group name
- filenodeName = MManager.getInstance().getFileNameByPath(devicePath);
+ storageGroup = MManager.getInstance().getFileNameByPath(devicePath);
FileNodeProcessorV2 processor;
- processor = processorMap.get(filenodeName);
+ processor = processorMap.get(storageGroup);
if (processor == null) {
- filenodeName = filenodeName.intern();
- synchronized (filenodeName) {
- processor = processorMap.get(filenodeName);
+ storageGroup = storageGroup.intern();
+ synchronized (storageGroup) {
+ processor = processorMap.get(storageGroup);
if (processor == null) {
LOGGER.debug("construct a processor instance, the storage group is {}, Thread is {}",
- filenodeName, Thread.currentThread().getId());
- processor = new FileNodeProcessorV2(baseDir, filenodeName);
+ storageGroup, Thread.currentThread().getId());
+ processor = new FileNodeProcessorV2(baseDir, storageGroup);
synchronized (processorMap) {
- processorMap.put(filenodeName, processor);
+ processorMap.put(storageGroup, processor);
}
}
}
@@ -160,98 +147,27 @@ public class FileNodeManagerV2 implements IStatistic, IService {
LOGGER.error("MManager get storage group name error, seriesPath is {}", devicePath);
throw new FileNodeManagerException(e);
} catch (FileNodeProcessorException e) {
- LOGGER.error("Fail to init simple file version controller of file node {}", filenodeName, e);
+ LOGGER.error("Fail to init simple file version controller of file node {}", storageGroup, e);
throw new FileNodeManagerException(e);
}
}
- private void updateStatHashMapWhenFail(TSRecord tsRecord) {
- statParamsHashMap.get(MonitorConstants.FileNodeManagerStatConstants.TOTAL_REQ_FAIL.name())
- .incrementAndGet();
- statParamsHashMap.get(MonitorConstants.FileNodeManagerStatConstants.TOTAL_POINTS_FAIL.name())
- .addAndGet(tsRecord.dataPointList.size());
- }
-
- /**
- * get stats parameter hash map.
- *
- * @return the key represents the params' name, values is AtomicLong type
- */
- @Override
- public Map<String, AtomicLong> getStatParamsHashMap() {
- return statParamsHashMap;
- }
-
- @Override
- public List<String> getAllPathForStatistic() {
- List<String> list = new ArrayList<>();
- for (MonitorConstants.FileNodeManagerStatConstants statConstant :
- MonitorConstants.FileNodeManagerStatConstants.values()) {
- list.add(MonitorConstants.STAT_STORAGE_DELTA_NAME + MonitorConstants.MONITOR_PATH_SEPARATOR
- + statConstant.name());
- }
- return list;
- }
-
- @Override
- public Map<String, TSRecord> getAllStatisticsValue() {
- long curTime = System.currentTimeMillis();
- TSRecord tsRecord = StatMonitor
- .convertToTSRecord(getStatParamsHashMap(), MonitorConstants.STAT_STORAGE_DELTA_NAME,
- curTime);
- HashMap<String, TSRecord> ret = new HashMap<>();
- ret.put(MonitorConstants.STAT_STORAGE_DELTA_NAME, tsRecord);
- return ret;
- }
-
- /**
- * Init Stat MetaDta.
- */
- @Override
- public void registerStatMetadata() {
- Map<String, String> hashMap = new HashMap<>();
- for (MonitorConstants.FileNodeManagerStatConstants statConstant :
- MonitorConstants.FileNodeManagerStatConstants.values()) {
- hashMap
- .put(MonitorConstants.STAT_STORAGE_DELTA_NAME + MonitorConstants.MONITOR_PATH_SEPARATOR
- + statConstant.name(), MonitorConstants.DATA_TYPE_INT64);
- }
- StatMonitor.getInstance().registerStatStorageGroup(hashMap);
- }
-
- private void updateStat(boolean isMonitor, TSRecord tsRecord) {
- if (!isMonitor) {
- statParamsHashMap.get(MonitorConstants.FileNodeManagerStatConstants.TOTAL_POINTS.name())
- .addAndGet(tsRecord.dataPointList.size());
- }
- }
-
/**
* This function is just for unit test.
*/
public synchronized void resetFileNodeManager() {
- for (String key : statParamsHashMap.keySet()) {
- statParamsHashMap.put(key, new AtomicLong());
- }
processorMap.clear();
}
-
/**
* insert TsRecord into storage group.
*
* @param tsRecord input Data
- * @param isMonitor if true, the insertion is done by StatMonitor and the statistic Info will not
- * be recorded. if false, the statParamsHashMap will be updated.
* @return an int value represents the insert type, 0: failed; 1: overflow; 2: bufferwrite
*/
- public int insert(TSRecord tsRecord, boolean isMonitor) throws FileNodeManagerException {
-
- checkTimestamp(tsRecord);
-
- updateStat(isMonitor, tsRecord);
+ public int insert(TSRecord tsRecord) throws FileNodeManagerException {
FileNodeProcessorV2 fileNodeProcessor;
try {
@@ -354,12 +270,8 @@ public class FileNodeManagerV2 implements IStatistic, IService {
throws FileNodeManagerException {
String deviceId = seriesExpression.getSeriesPath().getDevice();
String measurementId = seriesExpression.getSeriesPath().getMeasurement();
- FileNodeProcessorV2 fileNodeProcessor = null;
- fileNodeProcessor = getProcessor(deviceId);
-
-// LOGGER.debug("Get the FileNodeProcessor: filenode is {}, query.",
-// fileNodeProcessor.getProcessorName());
- return fileNodeProcessor.query(deviceId, measurementId);
+ FileNodeProcessorV2 fileNodeProcessor = getProcessor(deviceId);
+ return fileNodeProcessor.query(deviceId, measurementId);
}
/**
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java
index 7782b55..e2485d2 100755
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/FileNodeProcessorV2.java
@@ -166,12 +166,12 @@ public class FileNodeProcessorV2 {
latestFlushedTimeForEachDevice.putIfAbsent(tsRecord.deviceId, Long.MIN_VALUE);
boolean result;
- // write to sequence or unSequence file
+ // insert to sequence or unSequence file
if (tsRecord.time > latestFlushedTimeForEachDevice.get(tsRecord.deviceId)) {
- result = writeUnsealedDataFile(tsRecord, true);
+ result = insertUnsealedDataFile(tsRecord, true);
insertResult = result ? 1 : -1;
} else {
- result = writeUnsealedDataFile(tsRecord, false);
+ result = insertUnsealedDataFile(tsRecord, false);
insertResult = result ? 2 : -1;
}
} catch (Exception e) {
@@ -184,7 +184,7 @@ public class FileNodeProcessorV2 {
return insertResult;
}
- private boolean writeUnsealedDataFile(TSRecord tsRecord, boolean sequence) throws IOException {
+ private boolean insertUnsealedDataFile(TSRecord tsRecord, boolean sequence) throws IOException {
lock.writeLock().lock();
UnsealedTsFileProcessorV2 unsealedTsFileProcessor;
try {
@@ -216,8 +216,8 @@ public class FileNodeProcessorV2 {
unsealedTsFileProcessor = workUnSequenceTsFileProcessor;
}
- // write BufferWrite
- result = unsealedTsFileProcessor.write(tsRecord);
+ // insert BufferWrite
+ result = unsealedTsFileProcessor.insert(tsRecord);
// try to update the latest time of the device of this tsRecord
if (result && latestTimeForEachDevice.get(tsRecord.deviceId) < tsRecord.time) {
@@ -325,7 +325,7 @@ public class FileNodeProcessorV2 {
/**
* put the memtable back to the MemTablePool and make the metadata in writer visible
*/
- // TODO please consider concurrency with query and write method.
+ // TODO please consider concurrency with query and insert method.
public void closeUnsealedTsFileProcessorCallback(UnsealedTsFileProcessorV2 unsealedTsFileProcessor) {
lock.writeLock().lock();
try {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2.java
index ed87a71..12c42ef 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2.java
@@ -96,13 +96,13 @@ public class UnsealedTsFileProcessorV2 {
}
/**
- * write a TsRecord into the workMemtable. If the memory usage is beyond the memTableThreshold,
+ * insert a TsRecord into the workMemtable. If the memory usage is beyond the memTableThreshold,
* put it into flushing list.
*
* @param tsRecord data to be written
* @return succeed or fail
*/
- public boolean write(TSRecord tsRecord) {
+ public boolean insert(TSRecord tsRecord) {
if (workMemTable == null) {
// TODO change the impl of getEmptyMemTable to non-blocking
@@ -114,12 +114,12 @@ public class UnsealedTsFileProcessorV2 {
}
}
- // TODO write WAL
+ // TODO insert WAL
// update start time of this memtable
tsFileResource.updateStartTime(tsRecord.deviceId, tsRecord.time);
- // write tsRecord to work memtable
+ // insert tsRecord to work memtable
workMemTable.insert(tsRecord);
return true;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/MemTableFlushTask.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/MemTableFlushTask.java
index 5d7e918..78037e8 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/MemTableFlushTask.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/MemTableFlushTask.java
@@ -156,7 +156,7 @@ public class MemTableFlushTask {
try {
((RestorableTsFileIOWriter) tsFileIoWriter).writeRestoreInfo();
} catch (IOException e) {
- LOGGER.error("write restore file meet error", e);
+ LOGGER.error("insert restore file meet error", e);
}
}
flushCallBack.afterFlush(memTable, tsFileIoWriter);
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 e81973f..9bc42d0 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
@@ -227,7 +227,7 @@ public class OverflowProcessor extends Processor {
UsageLevel usageLevel = BasicMemController.getInstance().acquireUsage(this, memUage);
switch (usageLevel) {
case SAFE:
- // write data
+ // insert data
workSupport.insert(tsRecord);
valueCount++;
// check asyncFlush
@@ -242,7 +242,7 @@ public class OverflowProcessor extends Processor {
}
break;
case WARNING:
- // write data
+ // insert data
workSupport.insert(tsRecord);
valueCount++;
// asyncFlush
@@ -525,7 +525,7 @@ public class OverflowProcessor extends Processor {
workResource
.flush(fileSchema, currentMemTableToFlush, getProcessorName(), flushId, removeFlushedMemTable);
filenodeFlushAction.act();
- // write-ahead log
+ // insert-ahead log
if (IoTDBDescriptor.getInstance().getConfig().isEnableWal()) {
getLogNode().notifyEndFlush();
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java
index dc67fda..319378c 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java
@@ -52,7 +52,7 @@ import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
/**
* This class takes the responsibility of serialization of all the metadata info and persistent it
* into files. This class contains all the interfaces to modify the metadata for delta system. All
- * the operations will be write into the logs temporary in case the downtime of the delta system.
+ * the operations will be insert into the logs temporary in case the downtime of the delta system.
*
* @author Jinrui Zhang
*/
@@ -62,7 +62,7 @@ public class MManager {
private static final String ROOT_NAME = MetadataConstant.ROOT;
public static final String TIME_SERIES_TREE_HEADER = "=== Timeseries Tree ===\n\n";
- // the lock for cloneList/write
+ // the lock for cloneList/insert
private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
// The file storing the serialize info for metadata
private String datafilePath;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/monitor/IStatistic.java b/iotdb/src/main/java/org/apache/iotdb/db/monitor/IStatistic.java
index 36c83da..6e724f3 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/monitor/IStatistic.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/monitor/IStatistic.java
@@ -29,7 +29,7 @@ public interface IStatistic {
/**
* Get A HashMap that contains the module seriesPaths and their statistics measurement.
- * @return A HashMap that contains the module seriesPath like: root.stats.write.global,
+ * @return A HashMap that contains the module seriesPath like: root.stats.insert.global,
* and its value is TSRecord format contains all statistics measurement
*/
Map<String, TSRecord> getAllStatisticsValue();
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java b/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java
index ec899c8..c7ed8c1 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java
@@ -40,9 +40,9 @@ public class MonitorConstants {
private static final String FILE_SIZE = "file_size";
public static final String FILE_SIZE_STORAGE_GROUP_NAME = STAT_STORAGE_GROUP_PREFIX
+ MONITOR_PATH_SEPARATOR + FILE_SIZE;
- // statistic for write module
- static final String FILE_NODE_MANAGER_PATH = "write.global";
- public static final String FILE_NODE_PATH = "write";
+ // statistic for insert module
+ static final String FILE_NODE_MANAGER_PATH = "insert.global";
+ public static final String FILE_NODE_PATH = "insert";
/**
* Stat information.
*/
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 e0a7045..8954c97 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
@@ -77,7 +77,7 @@ public class PhysicalPlanLogTransfer {
try {
return codec.encode(plan);
} catch (BufferOverflowException e) {
- throw new WALOverSizedException("Plan " + plan.toString() + " is too big to write to WAL");
+ throw new WALOverSizedException("Plan " + plan.toString() + " is too big to insert to WAL");
}
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java b/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java
index 45aa1b4..f1a570d 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/control/QueryResourceManager.java
@@ -86,7 +86,7 @@ public class QueryResourceManager {
* <code>FileNodeManager.getInstance().endQueryForGivenJob(device_1, 3)</code> and
* <code>FileNodeManager.getInstance().endQueryForGivenJob(device_2, 4)</code> must be invoked
*
- * Last but no least, to ensure the correctness of write process and query process of IoTDB,
+ * Last but no least, to ensure the correctness of insert process and query process of IoTDB,
* <code>FileNodeManager.getInstance().beginQuery()</code> and
* <code>FileNodeManager.getInstance().endQueryForGivenJob()</code> must be executed rightly.
* </p>
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index 7aec3f9..77746e1 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -548,7 +548,7 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
statement = statement.toLowerCase().trim();
if (Pattern.matches(IoTDBConstant.SET_READ_CONSISTENCY_LEVEL_PATTERN, statement)) {
throw new Exception(
- "IoTDB Stand-alone version does not support setting cloneList-write consistency level");
+ "IoTDB Stand-alone version does not support setting cloneList-insert consistency level");
} else {
return false;
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServiceImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServiceImpl.java
index 439a9cc..5d06a13 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServiceImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sync/receiver/SyncServiceImpl.java
@@ -221,7 +221,7 @@ public class SyncServiceImpl implements SyncService.Iface {
FileChannel channel = fos.getChannel()) {
channel.write(schema);
} catch (Exception e) {
- logger.error("Cannot write data to file {}.", file.getPath(), e);
+ logger.error("Cannot insert data to file {}.", file.getPath(), e);
md5OfReceiver = Boolean.toString(Boolean.FALSE);
}
} else {
@@ -346,7 +346,7 @@ public class SyncServiceImpl implements SyncService.Iface {
channel = fos.getChannel();
channel.write(dataToReceive);
} catch (IOException e) {
- logger.error("cannot write data to file {}", file.getPath(), e);
+ logger.error("cannot insert data to file {}", file.getPath(), e);
md5OfReceiver = Boolean.toString(Boolean.FALSE);
}
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/sync/sender/SyncSenderImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/sync/sender/SyncSenderImpl.java
index 88e4652..0f6db42 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/sync/sender/SyncSenderImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/sync/sender/SyncSenderImpl.java
@@ -293,7 +293,7 @@ public class SyncSenderImpl implements SyncSender {
uuid = generateUUID();
out.write(uuid.getBytes());
} catch (IOException e) {
- LOGGER.error("Cannot write UUID to file {}", file.getPath());
+ LOGGER.error("Cannot insert UUID to file {}", file.getPath());
throw new IOException(e);
}
} else {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/tools/WalChecker.java b/iotdb/src/main/java/org/apache/iotdb/db/tools/WalChecker.java
index 5d2b8e4..546e495 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/tools/WalChecker.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/tools/WalChecker.java
@@ -32,7 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * WalChecker verifies that whether all write ahead logs in the WAL folder are recognizable.
+ * WalChecker verifies that whether all insert ahead logs in the WAL folder are recognizable.
*/
public class WalChecker {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java
index bd04733..fb40021 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/IOUtils.java
@@ -32,7 +32,7 @@ public class IOUtils {
/**
* Write a string into the given stream.
*
- * @param outputStream the destination to write.
+ * @param outputStream the destination to insert.
* @param str the string to be written.
* @param encoding string encoding like 'utf-8'.
* @param encodingBufferLocal a ThreadLocal buffer may be passed to avoid
@@ -54,7 +54,7 @@ public class IOUtils {
/**
* Write an integer into the given stream.
*
- * @param outputStream the destination to write.
+ * @param outputStream the destination to insert.
* @param i the integer to be written.
* @param encodingBufferLocal a ThreadLocal buffer may be passed to avoid
* frequently memory allocations. A null may also be passed
@@ -138,7 +138,7 @@ public class IOUtils {
/**
* Write a PathPrivilege to the given stream.
- * @param outputStream the destination to write.
+ * @param outputStream the destination to insert.
* @param pathPrivilege the PathPrivilege to be written.
* @param encoding string encoding like 'utf-8'.
* @param encodingBufferLocal a ThreadLocal buffer may be passed to avoid
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java b/iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java
index 895bfa7..da08382 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/utils/LoadDataUtils.java
@@ -107,7 +107,7 @@ public class LoadDataUtils {
}
if (lineCount % 1000000 == 0) {
long endTime = System.currentTimeMillis();
- logger.info("write line:{}, use time:{}", lineCount, endTime - temp);
+ logger.info("insert line:{}, use time:{}", lineCount, endTime - temp);
temp = System.currentTimeMillis();
logger.info("load data points:{}, load data speed:{}w point/s", totalPointCount,
FileUtils.format(((float) totalPointCount / 10) / (endTime - startTime), 2));
@@ -119,7 +119,7 @@ public class LoadDataUtils {
logger.error("cloneList line from inputCsvFileReader failed:{}", inputCsvDataPath, e1);
extraDataFilePath = null;
} finally {
- logger.info("write line:{}", lineCount);
+ logger.info("insert line:{}", lineCount);
close();
closeWriteInstance();
}
@@ -213,12 +213,12 @@ public class LoadDataUtils {
close();
return;
} catch (WriteProcessException e) {
- logger.error("the write process meet error!", e);
+ logger.error("the insert process meet error!", e);
}
String extraPath = inputCsvDataPath;
List<String> extraPaths = new ArrayList<>();
do {
- logger.info("cycle: write csv file: {}", extraPath);
+ logger.info("cycle: insert csv file: {}", extraPath);
extraPath = loadLocalDataOnePass(extraPath);
extraPaths.add(extraPath);
} while (hasExtra);
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java
index 535923a..fc1c33d 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java
@@ -22,7 +22,7 @@ import java.io.IOException;
import java.util.List;
/**
- * ILogWriter provides functions to write WAL logs that have already been converted to bytes to a
+ * ILogWriter provides functions to insert WAL logs that have already been converted to bytes to a
* persistent medium.
*/
public interface ILogWriter {
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 c4529cc..914a682 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
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * This WriteLogNode is used to manage write ahead logs of a TsFile.
+ * This WriteLogNode is used to manage insert ahead logs of a TsFile.
*/
public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<ExclusiveWriteLogNode> {
@@ -83,7 +83,7 @@ public class ExclusiveWriteLogNode implements WriteLogNode, Comparable<Exclusive
}
long elapse = System.currentTimeMillis() - start;
if (elapse > 1000) {
- logger.info("WAL write cost {} ms", elapse);
+ logger.info("WAL insert cost {} ms", elapse);
}
} finally {
lock.writeLock().unlock();
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 b3a135b..e3771ed 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
@@ -73,7 +73,7 @@ public interface WriteLogNode {
String getLogDirectory();
/**
- * Abandon all logs in this node and delete the log directory. Calling write() after calling
+ * Abandon all logs in this node and delete the log directory. Calling insert() after calling
* this method is undefined.
*/
void delete() throws IOException;
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java
index cb3cbd0..316dee3 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/BufferWriteBenchmark.java
@@ -98,7 +98,7 @@ public class BufferWriteBenchmark {
// for (int i = 0; i < numOfPoint; i++) {
// for (int j = 0; j < numOfDevice; j++) {
// TSRecord tsRecord = getRecord(deviceIds[j]);
-// bufferWriteProcessor.write(tsRecord);
+// bufferWriteProcessor.insert(tsRecord);
// }
// }
// long endTime = System.currentTimeMillis();
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java
index 2b093c1..1076ce3 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/bufferwrite/RestorableTsFileIOWriterTest.java
@@ -99,7 +99,7 @@ public class RestorableTsFileIOWriterTest {
writer.endFile(new FileSchema());
FileOutputStream out = new FileOutputStream(new File(restorePath));
- // write tsfile position using byte[8] which is present one long
+ // insert tsfile position using byte[8] which is present one long
writeRestoreFile(out, 2);
writeRestoreFile(out, 3);
byte[] lastPositionBytes = BytesUtils.longToBytes(200);
@@ -124,7 +124,7 @@ public class RestorableTsFileIOWriterTest {
File restoreFile = new File(insertPath + ".restore");
FileOutputStream out = new FileOutputStream(new File(restorePath));
- // write tsfile position using byte[8] which is present one long
+ // insert tsfile position using byte[8] which is present one long
writeRestoreFile(out, 2);
writeRestoreFile(out, 3);
byte[] lastPositionBytes = BytesUtils.longToBytes(200);
@@ -254,10 +254,10 @@ public class RestorableTsFileIOWriterTest {
tsDeviceMetadata.setChunkGroupMetadataList(appendRowGroupMetaDatas);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
tsDeviceMetadata.serializeTo(baos);
- // write metadata size using int
+ // insert metadata size using int
int metadataSize = baos.size();
out.write(BytesUtils.intToBytes(metadataSize));
- // write metadata
+ // insert metadata
out.write(baos.toByteArray());
}
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2Test.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2Test.java
index c09f69e..7950a64 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2Test.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/filenodeV2/UnsealedTsFileProcessorV2Test.java
@@ -28,7 +28,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.function.Consumer;
import org.apache.iotdb.db.engine.MetadataManagerHelper;
import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk;
import org.apache.iotdb.db.engine.version.SysTimeVersionController;
@@ -82,7 +81,7 @@ public class UnsealedTsFileProcessorV2Test {
for (int i = 1; i <= 100; i++) {
TSRecord record = new TSRecord(i, deviceId);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
- processor.write(record);
+ processor.insert(record);
}
// query data in memory
@@ -127,7 +126,7 @@ public class UnsealedTsFileProcessorV2Test {
for (int i = 1; i <= 10; i++) {
TSRecord record = new TSRecord(i, deviceId);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
- processor.write(record);
+ processor.insert(record);
}
processor.asyncFlush();
}
@@ -168,7 +167,7 @@ public class UnsealedTsFileProcessorV2Test {
for (int i = 1; i <= 100; i++) {
TSRecord record = new TSRecord(i, deviceId);
record.addTuple(DataPoint.getDataPoint(dataType, measurementId, String.valueOf(i)));
- processor.write(record);
+ processor.insert(record);
}
// query data in memory
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java
index efde5de..4b72789 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/memcontrol/IoTDBMemControlTest.java
@@ -107,7 +107,7 @@ public class IoTDBMemControlTest {
@Test
public void test() throws ClassNotFoundException, SQLException, InterruptedException {
- // test a huge amount of write causes block
+ // test a huge amount of insert causes block
if (!testFlag) {
return;
}
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessorTest.java b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessorTest.java
index 128d8b2..439876d 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessorTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/engine/overflow/io/OverflowProcessorTest.java
@@ -87,7 +87,7 @@ public class OverflowProcessorTest {
assertEquals(false, processor.isFlush());
assertEquals(false, processor.isMerge());
QueryContext context = new QueryContext();
- // write update data
+ // insert update data
OverflowSeriesDataSource overflowSeriesDataSource = processor.query(OverflowTestUtils.deviceId1,
OverflowTestUtils.measurementId1, OverflowTestUtils.dataType1, Collections.emptyMap(),
context);
@@ -98,7 +98,7 @@ public class OverflowProcessorTest {
overflowSeriesDataSource.getOverflowInsertFileList().get(0).getChunkMetaDataList().size());
processor.flush();
assertEquals(false, processor.isMerge());
- // write insert data
+ // insert insert data
OverflowTestUtils.produceInsertData(processor);
TimeUnit.SECONDS.sleep(1);
assertEquals(false, processor.isFlush());
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBVersionIT.java b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBVersionIT.java
index 4978f33..c9d9cf4 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBVersionIT.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/integration/IoTDBVersionIT.java
@@ -63,7 +63,7 @@ public class IoTDBVersionIT {
statement.execute("CREATE TIMESERIES root.versionTest2.s0"
+ " WITH DATATYPE=INT32,ENCODING=PLAIN");
- // write and flushMetadata enough times to make the version file persist
+ // insert and flushMetadata enough times to make the version file persist
for (int i = 0; i < 3 * SimpleFileVersionController.getSaveInterval(); i ++) {
for (int j = 1; j <= 100; j ++) {
statement.execute(String
diff --git a/iotdb/src/test/java/org/apache/iotdb/db/monitor/collector/FileSizeTest.java b/iotdb/src/test/java/org/apache/iotdb/db/monitor/collector/FileSizeTest.java
index dc7a47c..0f60f9c 100644
--- a/iotdb/src/test/java/org/apache/iotdb/db/monitor/collector/FileSizeTest.java
+++ b/iotdb/src/test/java/org/apache/iotdb/db/monitor/collector/FileSizeTest.java
@@ -71,7 +71,7 @@ public class FileSizeTest {
dataSizeBefore = FileSize.getInstance().getFileSizesInByte().get(FileSizeConstants.DATA);
byte[] contentInBytes = TEST_FILE_CONTENT.getBytes();
- // write something into the test file under data dir
+ // insert something into the test file under data dir
try (FileOutputStream fileOutputStream = new FileOutputStream(testFile)) {
fileOutputStream.write(contentInBytes);
fileOutputStream.flush();
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 0aa3b2d..abf07a1 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
@@ -67,7 +67,7 @@ public class PerformanceTest {
@Test
public void writeLogTest() throws IOException {
- // this test write 1000000 * 3 logs and report elapsed time
+ // this test insert 1000000 * 3 logs and report elapsed time
if (skip) {
return;
}
@@ -121,7 +121,7 @@ public class PerformanceTest {
public void recoverTest()
throws IOException, RecoverException, FileNodeManagerException, PathErrorException,
MetadataArgsErrorException {
- // this test write 1000000 * 3 logs , recover from them and report elapsed time
+ // this test insert 1000000 * 3 logs , recover from them and report elapsed time
if (skip) {
return;
}
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 5a10175..4b18bb2 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
@@ -70,7 +70,7 @@ public class RecoverTest {
@Test
public void testFullRecover() throws IOException, RecoverException, ProcessorException {
- // this test write a log file and try to recover from these logs as if no previous attempts exist.
+ // this test insert a log file and try to recover from these logs as if no previous attempts exist.
File insertFile = new File("testTemp");
FileSchema schema = new FileSchema();
String deviceId = "root.testLogNode";
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 ec9aa5f..0b95791 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
@@ -64,7 +64,7 @@ public class WriteLogNodeTest {
@Test
public void testWriteLogAndSync() throws IOException {
- // this test uses a dummy write log node to write a few logs and flushes them
+ // this test uses a dummy insert log node to insert a few logs and flushes them
// then reads the logs from file
String identifier = "root.logTestDevice";
@@ -166,7 +166,7 @@ public class WriteLogNodeTest {
@Test
public void testDelete() throws IOException {
- // this test uses a dummy write log node to write a few logs and flushes them
+ // this test uses a dummy insert log node to insert a few logs and flushes them
// then deletes the node
WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice");
@@ -194,7 +194,7 @@ public class WriteLogNodeTest {
@Test
public void testOverSizedWAL() throws IOException {
- // this test uses a dummy write log node to write an over-sized log and assert exception caught
+ // this test uses a dummy insert log node to insert an over-sized log and assert exception caught
WriteLogNode logNode = new ExclusiveWriteLogNode("root.logTestDevice.oversize");
InsertPlan bwInsertPlan = new InsertPlan(1, "root.logTestDevice.oversize", 100,