You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by xi...@apache.org on 2023/05/29 09:52:26 UTC
[iotdb] branch tiered_storage_sync_code updated: perpare for TieredStorage in code structure
This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch tiered_storage_sync_code
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/tiered_storage_sync_code by this push:
new 00946cb98cf perpare for TieredStorage in code structure
00946cb98cf is described below
commit 00946cb98cf2e56221bba227e6ddf55a088fcb0d
Author: Jinrui.Zhang <xi...@gmail.com>
AuthorDate: Mon May 29 17:52:14 2023 +0800
perpare for TieredStorage in code structure
---
.../resources/conf/iotdb-common.properties | 48 ----------------
.../apache/iotdb/commons/conf/CommonConfig.java | 2 +-
.../resources/conf/iotdb-datanode.properties | 1 -
.../java/org/apache/iotdb/db/conf/IoTDBConfig.java | 5 +-
.../org/apache/iotdb/db/engine/StorageEngine.java | 10 ----
.../iotdb/db/engine/storagegroup/DataRegion.java | 65 +---------------------
.../db/engine/storagegroup/TsFileResource.java | 9 ---
.../engine/storagegroup/TsFileResourceStatus.java | 2 -
.../tieredstorage/config/TieredStorageConfig.java | 36 ------------
.../exception/TsFileMigrationException.java | 41 --------------
.../pipeline/TieredStorageTaskExecutor.java | 23 --------
.../pipeline/TieredStorageTaskQueue.java | 23 --------
.../pipeline/TieredStorageTaskScheduler.java | 49 ----------------
.../tieredstorage/task/TsFileMigrationTask.java | 61 --------------------
.../task/TsFileMigrationTaskType.java | 25 ---------
.../task/TsFileMigrationTriggerType.java | 25 ---------
.../java/org/apache/iotdb/db/service/DataNode.java | 3 +-
.../engine/migration/LocalMigrationTaskTest.java | 27 ---------
.../engine/migration/RemoteMigrationTaskTest.java | 27 ---------
19 files changed, 6 insertions(+), 476 deletions(-)
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 03f8bc2d68f..98f90a7c5a5 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -168,19 +168,6 @@ cluster_name=defaultCluster
# Datatype: long
# heartbeat_interval_in_ms=1000
-####################
-### Disk management
-####################
-
-# thread pool size for migrate operation in the DataNode's data directories.
-# Datatype: int
-# migrate_thread_count=3
-
-# Disk move threshold at which current tier data will be moved to the next tier
-# If tiered storage is enabled, please separate TTL of different tiers by semicolons ";".
-# Datatype: double(percentage)
-# dn_default_space_move_thresholds=0.15
-
# Disk remaining threshold at which DataNode is set to ReadOnly status
# Datatype: double(percentage)
# disk_space_warning_threshold=0.05
@@ -472,7 +459,6 @@ cluster_name=defaultCluster
# Default TTL for databases that are not set TTL by statements, If not set (default), the TTL will be unlimited.
# Negative value means the TTL is unlimited.
-# If tiered storage is enabled, please separate TTL of different tiers by semicolons ";".
# Notice: if this property is changed, previous created database which are not set TTL will also be affected.
# Datatype: long
# Unit: ms
@@ -1174,37 +1160,3 @@ cluster_name=defaultCluster
# Datatype: int
# influxdb_rpc_port=8086
-
-####################
-### Object storage management
-####################
-
-# Datatype: boolean
-# enable_hdfs=false
-
-# Datatype: boolean
-# enable_object_storage=false
-
-# Datatype: string
-# remote_tsfile_cache_dirs=data/datanode/data/cache
-
-# Datatype: int
-# remote_tsfile_cache_page_size_in_kb=20971520
-
-# Datatype: long
-# remote_tsfile_cache_max_disk_usage_in_mb=53687091200
-
-# Datatype: string
-# object_storage_name=AWS_S3
-
-# Datatype: string
-# object_storage_endpoint=yourEndpoint
-
-# Datatype: string
-# object_storage_bucket=iotdb
-
-# Datatype: string
-# object_storage_access_key=yourAccessKey
-
-# Datatype: string
-# object_storage_access_secret=yourAccessSecret
\ No newline at end of file
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 1caa7365225..a44810612f2 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -92,7 +92,7 @@ public class CommonConfig {
* Notice: if this property is changed, previous created database which are not set TTL will also
* be affected. Unit: millisecond
*/
- private long[] tierTTLInMs = {2 * 24 * 60 * 60 * 1000L, Long.MAX_VALUE};
+ private long[] tierTTLInMs = {Long.MAX_VALUE};
/** Thrift socket and connection timeout between data node and config node. */
private int connectionTimeoutInMS = (int) TimeUnit.SECONDS.toMillis(20);
diff --git a/server/src/assembly/resources/conf/iotdb-datanode.properties b/server/src/assembly/resources/conf/iotdb-datanode.properties
index c0f14a8197f..0cbe58a606d 100644
--- a/server/src/assembly/resources/conf/iotdb-datanode.properties
+++ b/server/src/assembly/resources/conf/iotdb-datanode.properties
@@ -145,7 +145,6 @@ dn_target_config_node_list=127.0.0.1:10710
# If it is absolute, system will save the data in exact location it points to.
# If it is relative, system will save the data in the relative path directory it indicates under the IoTDB folder.
# If there are more than one directory, please separate them by commas ",".
-# If tiered storage is enabled, please separate directories of different tiers by semicolons ";".
# Note: If data_dirs is assigned an empty string(i.e.,zero-size), it will be handled as a relative path.
# For windows platform
# If its prefix is a drive specifier followed by "\\", or if its prefix is "\\\\", then the path is absolute. Otherwise, it is relative.
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
index ca066ec543a..48c3e0f853d 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
@@ -297,8 +297,7 @@ public class IoTDBConfig {
/** Tiered data directories. It can be settled as dataDirs = {{"data1"}, {"data2", "data3"}}; */
private String[][] tierDataDirs = {
- {IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.DATA_FOLDER_NAME},
- {IoTDBConstant.OBJECT_STORAGE_DIR}
+ {IoTDBConstant.DEFAULT_BASE_DIR + File.separator + IoTDBConstant.DATA_FOLDER_NAME}
};
private String loadTsFileDir =
@@ -527,7 +526,7 @@ public class IoTDBConfig {
private int candidateCompactionTaskQueueSize = 50;
/** whether to cache meta data(ChunkMetaData and TsFileMetaData) or not. */
- private boolean metaDataCacheEnable = false;
+ private boolean metaDataCacheEnable = true;
/** Memory allocated for bloomFilter cache in read process */
private long allocateMemoryForBloomFilterCache = allocateMemoryForRead / 1001;
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
index bb91b6c7938..875188e8638 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java
@@ -63,7 +63,6 @@ import org.apache.iotdb.db.utils.UpgradeUtils;
import org.apache.iotdb.db.wal.WALManager;
import org.apache.iotdb.db.wal.exception.WALException;
import org.apache.iotdb.db.wal.recover.WALRecoverManager;
-import org.apache.iotdb.os.cache.CacheRecoverTask;
import org.apache.iotdb.rpc.RpcUtils;
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.iotdb.tsfile.exception.write.PageException;
@@ -274,15 +273,6 @@ public class StorageEngine implements IService {
futures.add(cachedThreadPool.submit(recoverDataRegionTask));
}
}
- // submit object storage cache recover task
- if (config.isEnableObjectStorage()) {
- futures.add(
- cachedThreadPool.submit(
- () -> {
- new CacheRecoverTask().run();
- return null;
- }));
- }
}
/** get StorageGroup -> DataRegionIdList map from data/system directory. */
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
index 7f3dfb11462..b4b6a81df24 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/DataRegion.java
@@ -143,7 +143,6 @@ import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import static org.apache.iotdb.commons.conf.IoTDBConstant.FILE_NAME_SEPARATOR;
-import static org.apache.iotdb.db.engine.storagegroup.TsFileResource.RESOURCE_SUFFIX;
import static org.apache.iotdb.db.engine.storagegroup.TsFileResource.TEMP_SUFFIX;
import static org.apache.iotdb.db.mpp.metric.QueryResourceMetricSet.SEQUENCE_TSFILE;
import static org.apache.iotdb.db.mpp.metric.QueryResourceMetricSet.UNSEQUENCE_TSFILE;
@@ -709,38 +708,9 @@ public class DataRegion implements IDataRegionForQuery {
String partitionName = partitionFolder.getName();
File[] tsFilesInThisFolder =
fsFactory.listFilesBySuffix(partitionFolder.getAbsolutePath(), TSFILE_SUFFIX);
- File[] resourceFilesInThisFolder =
- fsFactory.listFilesBySuffix(partitionFolder.getAbsolutePath(), RESOURCE_SUFFIX);
for (File f : tsFilesInThisFolder) {
String tsFilePartitionPath = partitionName + File.separator + f.getName();
- if (tsFilePartitionPath2File.containsKey(tsFilePartitionPath)) {
- // check migration: two same name tsfile exists, only keep one of them
- File actualFile =
- deleteDuplicateMigrationTsFile(
- f, tsFilePartitionPath2File.get(tsFilePartitionPath));
- tsFilePartitionPath2File.put(tsFilePartitionPath, actualFile);
- } else {
- tsFilePartitionPath2File.put(tsFilePartitionPath, f);
- }
- }
-
- for (File f : resourceFilesInThisFolder) {
- String tsFilePartitionPath =
- partitionName
- + File.separator
- + f.getName().substring(0, f.getName().length() - RESOURCE_SUFFIX.length());
- if (tsFilePartitionPath2File.containsKey(tsFilePartitionPath)) {
- // check migration: tsfile already added, but this resource file doesn't correspond
- // to the file, so delete it
- if (!f.getCanonicalPath()
- .startsWith(
- tsFilePartitionPath2File.get(tsFilePartitionPath).getCanonicalPath())) {
- f.delete();
- }
- } else {
- tsFilePartitionPath2File.put(
- tsFilePartitionPath, fsFactory.getFile(fileFolder, tsFilePartitionPath));
- }
+ tsFilePartitionPath2File.put(tsFilePartitionPath, f);
}
} else {
@@ -789,39 +759,6 @@ public class DataRegion implements IDataRegionForQuery {
}
}
- /** Remove the duplicate TsFile and return the actual TsFile (has .tsfile and .tsfile.resource) */
- private File deleteDuplicateMigrationTsFile(File f1, File f2) {
- int f1Tier = TierManager.getInstance().getFileTierLevel(f1);
- int f2Tier = TierManager.getInstance().getFileTierLevel(f2);
- File lowerTierFile = f1Tier < f2Tier ? f1 : f2;
- File higherTierFile = f1Tier < f2Tier ? f2 : f1;
- File lowerTierFileResource = fsFactory.getFile(lowerTierFile + RESOURCE_SUFFIX);
- File higherTierFileResource = fsFactory.getFile(higherTierFile + RESOURCE_SUFFIX);
- if (lowerTierFile.exists() && lowerTierFileResource.exists()) {
- deleteIfExist(higherTierFile);
- deleteIfExist(higherTierFileResource);
- return lowerTierFile;
- } else if (higherTierFile.exists() && higherTierFileResource.exists()) {
- deleteIfExist(lowerTierFile);
- deleteIfExist(lowerTierFileResource);
- return higherTierFile;
- } else {
- logger.error(
- "TsFile status is abnormal, please check {}, {}, {}, {}.",
- lowerTierFile,
- lowerTierFileResource,
- higherTierFile,
- higherTierFileResource);
- return lowerTierFile;
- }
- }
-
- private void deleteIfExist(File file) {
- if (file.exists()) {
- file.delete();
- }
- }
-
/** check if the tsfile's time is smaller than system current time. */
private void checkTsFileTime(File tsFile, long currentTime) throws DataRegionException {
String[] items = tsFile.getName().replace(TSFILE_SUFFIX, "").split(FILE_NAME_SEPARATOR);
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
index 8448fa51e2c..e6c430da223 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResource.java
@@ -194,9 +194,6 @@ public class TsFileResource {
// This method is invoked when DataNode recovers, so the tierLevel should be calculated when
// restarting
this.tierLevel = TierManager.getInstance().getFileTierLevel(file);
- if (onRemote()) {
- this.setAtomicStatus(TsFileResourceStatus.NORMAL_ON_REMOTE);
- }
}
/** Used for compaction to create target files. */
@@ -717,13 +714,9 @@ public class TsFileResource {
switch (status) {
case NORMAL:
return compareAndSetStatus(TsFileResourceStatus.UNCLOSED, TsFileResourceStatus.NORMAL)
- || compareAndSetStatus(TsFileResourceStatus.MIGRATING, TsFileResourceStatus.NORMAL)
|| compareAndSetStatus(TsFileResourceStatus.COMPACTING, TsFileResourceStatus.NORMAL)
|| compareAndSetStatus(
TsFileResourceStatus.COMPACTION_CANDIDATE, TsFileResourceStatus.NORMAL);
- case NORMAL_ON_REMOTE:
- return compareAndSetStatus(
- TsFileResourceStatus.MIGRATING, TsFileResourceStatus.NORMAL_ON_REMOTE);
case UNCLOSED:
// TsFile cannot be set back to UNCLOSED so false is always returned
return false;
@@ -737,8 +730,6 @@ public class TsFileResource {
case COMPACTION_CANDIDATE:
return compareAndSetStatus(
TsFileResourceStatus.NORMAL, TsFileResourceStatus.COMPACTION_CANDIDATE);
- case MIGRATING:
- return compareAndSetStatus(TsFileResourceStatus.NORMAL, TsFileResourceStatus.MIGRATING);
default:
return false;
}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResourceStatus.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResourceStatus.java
index f389492553e..4c1c95ca7e6 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResourceStatus.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileResourceStatus.java
@@ -22,9 +22,7 @@ public enum TsFileResourceStatus {
UNCLOSED,
/** The resource in status NORMAL, COMPACTION_CANDIDATE, COMPACTING, DELETED is all CLOSED. */
NORMAL,
- NORMAL_ON_REMOTE,
COMPACTION_CANDIDATE,
COMPACTING,
- MIGRATING,
DELETED
}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/config/TieredStorageConfig.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/config/TieredStorageConfig.java
deleted file mode 100644
index 4db77421e3f..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/config/TieredStorageConfig.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.config;
-
-import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
-import org.apache.iotdb.db.engine.tieredstorage.task.TsFileMigrationTriggerType;
-
-/**
- * // (jinrui) 该类为一个单例类,用来在运行时提供多级存储的相关配置(可能需要定义更多的类来实现它),其功能为: 1. 启动时,根据配置文件处理多级存储的配置信息 2.
- * 将配置信息存储在该单例类的对象中,并提供对外的访问接口 3. 提供判断一个 TsFile 是否需要迁移的方法,并返回迁移的原因
- */
-public class TieredStorageConfig {
-
- // (jinrui) 传入参数可能需要更多信息,以辅助判断,尽可能地使用内存中的信息进行该判断,避免磁盘读取
- // 如果在实现过程中需要从磁盘中读取信息,需要标注出来进行讨论
- public TsFileMigrationTriggerType needMoveToNextTier(TsFileResource tsFileResource) {
- return null;
- }
-}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/exception/TsFileMigrationException.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/exception/TsFileMigrationException.java
deleted file mode 100644
index 88b7204106d..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/exception/TsFileMigrationException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.exception;
-
-public class TsFileMigrationException extends Exception {
- public TsFileMigrationException() {}
-
- public TsFileMigrationException(String message) {
- super(message);
- }
-
- public TsFileMigrationException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public TsFileMigrationException(Throwable cause) {
- super(cause);
- }
-
- public TsFileMigrationException(
- String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
- super(message, cause, enableSuppression, writableStackTrace);
- }
-}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskExecutor.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskExecutor.java
deleted file mode 100644
index f720ab1debd..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskExecutor.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.pipeline;
-
-/** // (jinrui) 设定一个并发执行的线程数,从 queue 中取出 task,并执行 */
-public class TieredStorageTaskExecutor {}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskQueue.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskQueue.java
deleted file mode 100644
index 52c32605777..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskQueue.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.pipeline;
-
-/** // (jinrui) 一个单例的、线程安全的队列,用来储存内存中的 MigrationTask 任务 */
-public class TieredStorageTaskQueue {}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskScheduler.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskScheduler.java
deleted file mode 100644
index 8be573196f1..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/pipeline/TieredStorageTaskScheduler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.pipeline;
-
-import org.apache.iotdb.db.engine.storagegroup.TsFileManager;
-
-/**
- * // (jinrui) 取一个什么名字好呢? 负责周期性地检查是否需要提交 TsFileMigrationTask,初步计划每个 DataRegion
- * 有一个这样的实例,定期执行;DataRegion 之间不混用
- */
-public class TieredStorageTaskScheduler {
-
- private String dataRegionId;
- // (jinrui)
- // 获取一个 TsFileManager 的引用,从而拿到对应的文件信息
- // 相应的,系统重启的时候,在温数据区加载文件时,也要做相应的改动(读对应的 resource 文件)
- private TsFileManager tsFileManager;
-
- public TieredStorageTaskScheduler(String dataRegionId) {
- this.dataRegionId = dataRegionId;
- }
-
- public void schedule() {}
-
- private void checkTsFileTTL() {}
-
- // (jinrui)
- // 这里涉及到了一个问题,就是当磁盘超过阈值时,迁移文件时候怎么进行选择,有两个倾向
- // 1. 从一个 DataRegion 迁移,直至预期空间小于阈值为止
- // 2. 每个 DataRegion 迁移最老的 N 个文件,然后等待下一轮再进行检查
- private void checkDiskThreshold() {}
-}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTask.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTask.java
deleted file mode 100644
index b717aaaa442..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTask.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.task;
-
-import org.apache.iotdb.db.engine.tieredstorage.exception.TsFileMigrationException;
-
-import java.util.List;
-
-public abstract class TsFileMigrationTask {
- // block size for each write when doing migration to avoid memory overflow
- private static final int BLOCK_SIZE_PER_WRITE = 100 * 1024 * 1024;
- private String sourceFilePath;
- private String targetFilePath;
- private TsFileMigrationTriggerType triggerType;
- private TsFileMigrationTaskType taskType;
-
- // (jinrui) 文件的输入都是从本地读,所以大概率是用同一个文件读取类即可,不过也可以抽象一个读取的接口
-
- // (jinrui) 定义一个输出文件的接口,不同的 MigrationTask 提供不同的输出文件接口的实现,需要确认当前写 TsFile 是用的什么接口
- // private XXFileWriter writer;
-
- public TsFileMigrationTask(
- String sourceFilePath,
- String targetFilePath,
- TsFileMigrationTriggerType triggerType,
- TsFileMigrationTaskType taskType) {
- this.sourceFilePath = sourceFilePath;
- this.targetFilePath = targetFilePath;
- this.triggerType = triggerType;
- this.taskType = taskType;
- }
-
- /**
- * // (jinrui) 该方法实现迁移一个 TsFile 的完整步骤: 1. 根据 getSourceFileList() 获取到所有要迁移的文件 2. 按照文件列表中的顺序,使用对应的
- * reader 和 writer 对文件进行读写 3. 如果迁移过程中遇到了异常,则执行 cleanupWhenException()
- */
- public void doMigration() throws TsFileMigrationException {}
-
- // (jinrui) 不同的迁移任务它涉及的文件不同,比如 local_to_local 不仅需要迁移 source file,还需要迁移对应的 mod、resource 文件
- protected abstract List<String> getSourceFileList();
-
- /** (jinrui) 迁移任务如果遇到异常,则需要进行相应的清理工作。可以考虑是否需要将该方式实现成一个统一的方法 */
- protected abstract void cleanupWhenException() throws TsFileMigrationException;
-}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTaskType.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTaskType.java
deleted file mode 100644
index 3cb62093de4..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTaskType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.task;
-
-public enum TsFileMigrationTaskType {
- FROM_LOCAL_TO_LOCAL,
- FROM_LOCAL_TO_S3,
-}
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTriggerType.java b/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTriggerType.java
deleted file mode 100644
index e393b2db432..00000000000
--- a/server/src/main/java/org/apache/iotdb/db/engine/tieredstorage/task/TsFileMigrationTriggerType.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.iotdb.db.engine.tieredstorage.task;
-
-public enum TsFileMigrationTriggerType {
- TTL,
- DISK_FULL,
-}
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 2a9d5778054..af67df5e1dc 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -168,7 +168,8 @@ public class DataNode implements DataNodeMBean {
// Send restart request of this DataNode
sendRestartRequestToConfigNode();
}
- // TierManager need DataNodeId to do some operations so the reset method need to be invoked after DataNode adding
+ // TierManager need DataNodeId to do some operations so the reset method need to be invoked
+ // after DataNode adding
TierManager.getInstance().resetFolders();
// Active DataNode
active();
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/migration/LocalMigrationTaskTest.java b/server/src/test/java/org/apache/iotdb/db/engine/migration/LocalMigrationTaskTest.java
deleted file mode 100644
index fac7ec3eb61..00000000000
--- a/server/src/test/java/org/apache/iotdb/db/engine/migration/LocalMigrationTaskTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.db.engine.migration;
-
-import org.junit.Test;
-
-public class LocalMigrationTaskTest {
-
- @Test
- public void migrate() {}
-}
diff --git a/server/src/test/java/org/apache/iotdb/db/engine/migration/RemoteMigrationTaskTest.java b/server/src/test/java/org/apache/iotdb/db/engine/migration/RemoteMigrationTaskTest.java
deleted file mode 100644
index 0569924ae26..00000000000
--- a/server/src/test/java/org/apache/iotdb/db/engine/migration/RemoteMigrationTaskTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.iotdb.db.engine.migration;
-
-import org.junit.Test;
-
-public class RemoteMigrationTaskTest {
-
- @Test
- public void migrate() {}
-}