This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch speed_up_recover in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5709cd2286092600ecc363fb06c2e33fad374847 Author: HTHou <[email protected]> AuthorDate: Tue Jul 16 16:04:12 2024 +0800 init --- .../tsfile/timeindex/FileTimeIndexCache.java | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/FileTimeIndexCache.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/FileTimeIndexCache.java new file mode 100644 index 00000000000..e7b4812474b --- /dev/null +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/timeindex/FileTimeIndexCache.java @@ -0,0 +1,48 @@ +/* + * 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.storageengine.dataregion.tsfile.timeindex; + +import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory; +import org.apache.iotdb.commons.concurrent.ThreadName; +import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource; + +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.ScheduledExecutorService; + +public class FileTimeIndexCache { + + private ScheduledExecutorService recordFileIndexThread; + + private final BlockingQueue<TsFileResource> resourceQueue = new ArrayBlockingQueue<>(100); + + public void add(TsFileResource resource) { + resourceQueue.add(resource); + } + + public void recordTsFileResource() { + recordFileIndexThread = + IoTDBThreadPoolFactory.newSingleThreadScheduledExecutor( + ThreadName.FILE_TIMEINDEX_RECORD.getName()); + // ScheduledExecutorUtil.safelyScheduleWithFixedDelay( + // recordFileIndexThread, this::deleteOutdatedFiles, initDelayMs, periodMs, + // TimeUnit.MILLISECONDS); + } +}
