Package org.apache.iotdb.tsfile.utils
Class FilePathUtils
- java.lang.Object
-
- org.apache.iotdb.tsfile.utils.FilePathUtils
-
public class FilePathUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILE_NAME_SEPARATOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDataRegionId(String tsFileAbsolutePath)static Pair<String,Long>getLogicalSgNameAndTimePartitionIdPair(String tsFileAbsolutePath)static StringgetLogicalStorageGroupName(String tsFileAbsolutePath)static longgetTimePartitionId(String tsFileAbsolutePath)static StringgetTsFileNameWithoutHardLink(String tsFileAbsolutePath)static StringgetTsFilePrefixPath(String tsFileAbsolutePath)static Pair<String,long[]>getTsFilePrefixPathAndTsFileVersionPair(String tsFileAbsolutePath)pair.left tsFilePrefixPath, like data/data/sequence/root.sg1/0/0 pair.right is a long array whose length is 2 pair.right[0] is tsfile version pair.right[1] is compaction version, high 32 bit is compaction level, low 32 bit is merge countstatic booleanisSequence(String tsFileAbsolutePath)static StringregularizePath(String filePath)Format file path to end with File.separatorstatic longsplitAndGetTsFileVersion(String tsFileName)static String[]splitTsFilePath(String tsFileAbsolutePath)IMPORTANT, when the path of TsFile changes, the following methods should be changed accordingly.
-
-
-
Field Detail
-
FILE_NAME_SEPARATOR
public static final String FILE_NAME_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
regularizePath
public static String regularizePath(String filePath)
Format file path to end with File.separator- Parameters:
filePath- origin file path- Returns:
- Regularized Path
-
splitTsFilePath
public static String[] splitTsFilePath(String tsFileAbsolutePath)
IMPORTANT, when the path of TsFile changes, the following methods should be changed accordingly. The sequence TsFile is located at ${IOTDB_DATA_DIR}/data/sequence/. The unsequence TsFile is located at ${IOTDB_DATA_DIR}/data/unsequence/. Where different database's TsFile is located at/ / / . For example, one sequence TsFile may locate at /data/data/sequence/root.group_9/0/0/1611199237113-4-0.tsfile - Parameters:
tsFileAbsolutePath- the tsFile Absolute Path
-
isSequence
public static boolean isSequence(String tsFileAbsolutePath)
-
getLogicalStorageGroupName
public static String getLogicalStorageGroupName(String tsFileAbsolutePath)
-
getTimePartitionId
public static long getTimePartitionId(String tsFileAbsolutePath)
-
getTsFileNameWithoutHardLink
public static String getTsFileNameWithoutHardLink(String tsFileAbsolutePath)
- Parameters:
tsFileAbsolutePath- the Remote TsFile Absolute Path- Returns:
- the file in the snapshot is a hardlink, remove the hardlink suffix
-
splitAndGetTsFileVersion
public static long splitAndGetTsFileVersion(String tsFileName)
-
getLogicalSgNameAndTimePartitionIdPair
public static Pair<String,Long> getLogicalSgNameAndTimePartitionIdPair(String tsFileAbsolutePath)
-
getTsFilePrefixPathAndTsFileVersionPair
public static Pair<String,long[]> getTsFilePrefixPathAndTsFileVersionPair(String tsFileAbsolutePath)
pair.left tsFilePrefixPath, like data/data/sequence/root.sg1/0/0 pair.right is a long array whose length is 2 pair.right[0] is tsfile version pair.right[1] is compaction version, high 32 bit is compaction level, low 32 bit is merge count
-
-