Class CompactionUtils


  • public class CompactionUtils
    extends java.lang.Object
    This tool can be used to perform inner space or cross space compaction of aligned and non aligned timeseries.
    • Constructor Detail

      • CompactionUtils

        public CompactionUtils()
    • Method Detail

      • moveTargetFile

        public static void moveTargetFile​(java.util.List<TsFileResource> targetResources,
                                          boolean isInnerSpace,
                                          java.lang.String fullStorageGroupName)
                                   throws java.io.IOException,
                                          org.apache.iotdb.tsfile.exception.write.WriteProcessException
        Update the targetResource. Move tmp target file to target file and serialize xxx.tsfile.resource.
        Throws:
        java.io.IOException
        org.apache.iotdb.tsfile.exception.write.WriteProcessException
      • combineModsInCrossCompaction

        public static void combineModsInCrossCompaction​(java.util.List<TsFileResource> seqResources,
                                                        java.util.List<TsFileResource> unseqResources,
                                                        java.util.List<TsFileResource> targetResources)
                                                 throws java.io.IOException
        Collect all the compaction modification files of source files, and combines them as the modification file of target file.
        Throws:
        java.io.IOException
      • combineModsInInnerCompaction

        public static void combineModsInInnerCompaction​(java.util.Collection<TsFileResource> sourceFiles,
                                                        TsFileResource targetTsFile)
                                                 throws java.io.IOException
        Collect all the compaction modification files of source files, and combines them as the modification file of target file.
        Throws:
        java.io.IOException
      • deleteCompactionModsFile

        public static void deleteCompactionModsFile​(java.util.List<TsFileResource> selectedSeqTsFileResourceList,
                                                    java.util.List<TsFileResource> selectedUnSeqTsFileResourceList)
                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteTsFilesInDisk

        public static boolean deleteTsFilesInDisk​(java.util.Collection<TsFileResource> mergeTsFiles,
                                                  java.lang.String storageGroupName)
      • deleteTsFile

        public static boolean deleteTsFile​(TsFileResource seqFile)
      • deleteModificationForSourceFile

        public static void deleteModificationForSourceFile​(java.util.Collection<TsFileResource> sourceFiles,
                                                           java.lang.String storageGroupName)
                                                    throws java.io.IOException
        Delete all modification files for source files
        Throws:
        java.io.IOException