Skip to content

Commit

Permalink
spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
shuwenwei committed Jan 9, 2025
1 parent b0bea9c commit 43b820a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.iotdb.db.conf.IoTDBDescriptor;
import org.apache.iotdb.db.exception.load.LoadRuntimeOutOfMemoryException;
import org.apache.iotdb.db.storageengine.dataregion.modification.ModEntry;
import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.TsFileResource;
import org.apache.iotdb.db.storageengine.dataregion.tsfile.timeindex.FileTimeIndex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
import org.apache.iotdb.db.storageengine.dataregion.modification.ModificationFile;
import org.apache.iotdb.db.storageengine.dataregion.modification.TableDeletionEntry;
import org.apache.iotdb.db.storageengine.dataregion.modification.TreeDeletionEntry;
import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
import org.apache.iotdb.db.storageengine.dataregion.read.IQueryDataSource;
import org.apache.iotdb.db.storageengine.dataregion.read.QueryDataSource;
import org.apache.iotdb.db.storageengine.dataregion.read.QueryDataSourceForRegionScan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1452,21 +1452,25 @@ public void upgradeModFile(ExecutorService upgradeModFileThreadPool) throws IOEx
upgradeModFile(upgradeModFileThreadPool, true);
}

public void upgradeModFile(ExecutorService upgradeModFileThreadPool, boolean removeOldModFile) throws IOException {
public void upgradeModFile(ExecutorService upgradeModFileThreadPool, boolean removeOldModFile)
throws IOException {
ModificationFileV1 oldModFile = ModificationFileV1.getNormalMods(this);
if (!oldModFile.exists()) {
return;
}

if (upgradeModFileThreadPool != null) {
exclusiveModFileFuture = upgradeModFileThreadPool.submit(() -> doUpgradeModFile(oldModFile, remove()));
exclusiveModFileFuture =
upgradeModFileThreadPool.submit(() -> doUpgradeModFile(oldModFile, remove()));
} else {
exclusiveModFileFuture = CompletableFuture.completedFuture(doUpgradeModFile(oldModFile, removeOldModFile));
exclusiveModFileFuture =
CompletableFuture.completedFuture(doUpgradeModFile(oldModFile, removeOldModFile));
}
}

@SuppressWarnings({"java:S4042", "java:S899", "ResultOfMethodCallIgnored"})
private ModificationFile doUpgradeModFile(ModificationFileV1 oldModFile, boolean removeOldModFile) throws IOException {
private ModificationFile doUpgradeModFile(ModificationFileV1 oldModFile, boolean removeOldModFile)
throws IOException {
ModificationFile newMFile = ModificationFile.getExclusiveMods(this);
newMFile.getFile().delete();
try {
Expand Down

0 comments on commit 43b820a

Please sign in to comment.