Package org.apache.iotdb.tsfile.utils
Class FilePathUtils
- java.lang.Object
-
- org.apache.iotdb.tsfile.utils.FilePathUtils
-
public class FilePathUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFILE_NAME_SEPARATOR
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringgetDataRegionId(java.lang.String tsFileAbsolutePath)static Pair<java.lang.String,java.lang.Long>getLogicalSgNameAndTimePartitionIdPair(java.lang.String tsFileAbsolutePath)static java.lang.StringgetLogicalStorageGroupName(java.lang.String tsFileAbsolutePath)static longgetTimePartitionId(java.lang.String tsFileAbsolutePath)static java.lang.StringgetTsFileNameWithoutHardLink(java.lang.String tsFileAbsolutePath)static java.lang.StringgetTsFilePrefixPath(java.lang.String tsFileAbsolutePath)static Pair<java.lang.String,long[]>getTsFilePrefixPathAndTsFileVersionPair(java.lang.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(java.lang.String tsFileAbsolutePath)static java.lang.StringregularizePath(java.lang.String filePath)Format file path to end with File.separatorstatic longsplitAndGetTsFileVersion(java.lang.String tsFileName)static java.lang.String[]splitTsFilePath(java.lang.String tsFileAbsolutePath)IMPORTANT, when the path of TsFile changes, the following methods should be changed accordingly.
-
-
-
Field Detail
-
FILE_NAME_SEPARATOR
public static final java.lang.String FILE_NAME_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
regularizePath
public static java.lang.String regularizePath(java.lang.String filePath)
Format file path to end with File.separator- Parameters:
filePath- origin file path- Returns:
- Regularized Path
-
splitTsFilePath
public static java.lang.String[] splitTsFilePath(java.lang.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(java.lang.String tsFileAbsolutePath)
-
getLogicalStorageGroupName
public static java.lang.String getLogicalStorageGroupName(java.lang.String tsFileAbsolutePath)
-
getDataRegionId
public static java.lang.String getDataRegionId(java.lang.String tsFileAbsolutePath)
-
getTimePartitionId
public static long getTimePartitionId(java.lang.String tsFileAbsolutePath)
-
getTsFileNameWithoutHardLink
public static java.lang.String getTsFileNameWithoutHardLink(java.lang.String tsFileAbsolutePath)
- Parameters:
tsFileAbsolutePath- the Remote TsFile Absolute Path- Returns:
- the file in the snapshot is a hardlink, remove the hardlink suffix
-
getTsFilePrefixPath
public static java.lang.String getTsFilePrefixPath(java.lang.String tsFileAbsolutePath)
-
splitAndGetTsFileVersion
public static long splitAndGetTsFileVersion(java.lang.String tsFileName)
-
getLogicalSgNameAndTimePartitionIdPair
public static Pair<java.lang.String,java.lang.Long> getLogicalSgNameAndTimePartitionIdPair(java.lang.String tsFileAbsolutePath)
-
getTsFilePrefixPathAndTsFileVersionPair
public static Pair<java.lang.String,long[]> getTsFilePrefixPathAndTsFileVersionPair(java.lang.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
-
-