Skip to content

Commit

Permalink
remove v1 mod file
Browse files Browse the repository at this point in the history
  • Loading branch information
jt2594838 committed Oct 25, 2024
1 parent cb83826 commit 2dc417f
Show file tree
Hide file tree
Showing 24 changed files with 297 additions and 270 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

import org.apache.iotdb.commons.exception.IllegalPathException;
import org.apache.iotdb.commons.path.MeasurementPath;
import org.apache.iotdb.db.storageengine.dataregion.modification.v1.Deletion;
import org.apache.iotdb.db.storageengine.dataregion.modification.v1.ModificationFileV1;
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.TreeDeletionEntry;

import org.apache.tsfile.common.conf.TSFileConfig;
import org.apache.tsfile.exception.write.WriteProcessException;
Expand Down Expand Up @@ -249,24 +250,22 @@ private void generateTEXT(final Object obj, final int row) {

public void generateDeletion(final String device, final int number)
throws IOException, IllegalPathException {
try (final ModificationFileV1 modificationFile =
new ModificationFileV1(tsFile.getAbsolutePath() + ModificationFileV1.FILE_SUFFIX)) {
try (final ModificationFile modificationFile =
new ModificationFile(tsFile.getAbsolutePath() + ModificationFile.FILE_SUFFIX)) {
writer.flushAllChunkGroups();
final TreeSet<Long> timeSet = device2TimeSet.get(device);
if (timeSet.isEmpty()) {
return;
}

final long fileOffset = tsFile.length();
final long maxTime = timeSet.last() - 1;
for (int i = 0; i < number; i++) {
final int endTime = random.nextInt((int) (maxTime)) + 1;
final int startTime = random.nextInt(endTime);
for (final IMeasurementSchema measurementSchema : device2MeasurementSchema.get(device)) {
final Deletion deletion =
new Deletion(
final ModEntry deletion =
new TreeDeletionEntry(
new MeasurementPath(device, measurementSchema.getMeasurementId()),
fileOffset,
startTime,
endTime);
modificationFile.write(deletion);
Expand Down
Loading

0 comments on commit 2dc417f

Please sign in to comment.