Class TsFileIdentifier
- java.lang.Object
-
- org.apache.iotdb.db.engine.compaction.log.TsFileIdentifier
-
public class TsFileIdentifier extends java.lang.ObjectThis class record the logical information of files in compaction, which is used to locate file in disk. File identifier includes whether the file is sequence, its storage group name, virtual storage group id, time partition id and file name. This class cannot be initialized directly. We provide some static methods to create instance of this class.
-
-
Field Summary
Fields Modifier and Type Field Description static intDATA_REGION_OFFSET_IN_LOGstatic intDATA_REGION_OFFSET_IN_PATHstatic intFILE_NAME_OFFSET_IN_LOGstatic intFILE_NAME_OFFSET_IN_PATHstatic java.lang.StringINFO_SEPARATORstatic intLOGICAL_SG_OFFSET_IN_LOGstatic intLOGICAL_SG_OFFSET_IN_PATHstatic intSEQUENCE_OFFSET_IN_LOGstatic intSEQUENCE_OFFSET_IN_PATHstatic intTIME_PARTITION_OFFSET_IN_LOGstatic intTIME_PARTITION_OFFSET_IN_PATH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)java.lang.StringgetDataRegionId()java.io.FilegetFileFromDataDirs()This method find the File object of current file by searching it in every data directory.static TsFileIdentifiergetFileIdentifierFromFilePath(java.lang.String filepath)This function generates an instance of CompactionFileIdentifier by parsing the path of a tsfile.static TsFileIdentifiergetFileIdentifierFromInfoString(java.lang.String infoString)This function generates an instance of CompactionFileIdentifier by parsing the info string of a tsfile(usually recorded in a compaction.log), such as “sequence root.test.sg 0 0 0-0-0-0.tsfile"static TsFileIdentifiergetFileIdentifierFromOldInfoString(java.lang.String oldInfoString)This function generates an instance of CompactionFileIdentifier by parsing the old info string from previous version (<0.13) of a tsfile(usually recorded in a compaction.log).java.lang.StringgetFilename()java.lang.StringgetFilePath()java.lang.StringgetLogicalStorageGroupName()java.lang.StringgetTimePartitionId()inthashCode()booleanisSequence()java.lang.StringtoString()
-
-
-
Field Detail
-
INFO_SEPARATOR
public static final java.lang.String INFO_SEPARATOR
- See Also:
- Constant Field Values
-
FILE_NAME_OFFSET_IN_PATH
public static final int FILE_NAME_OFFSET_IN_PATH
- See Also:
- Constant Field Values
-
TIME_PARTITION_OFFSET_IN_PATH
public static final int TIME_PARTITION_OFFSET_IN_PATH
- See Also:
- Constant Field Values
-
DATA_REGION_OFFSET_IN_PATH
public static final int DATA_REGION_OFFSET_IN_PATH
- See Also:
- Constant Field Values
-
LOGICAL_SG_OFFSET_IN_PATH
public static final int LOGICAL_SG_OFFSET_IN_PATH
- See Also:
- Constant Field Values
-
SEQUENCE_OFFSET_IN_PATH
public static final int SEQUENCE_OFFSET_IN_PATH
- See Also:
- Constant Field Values
-
SEQUENCE_OFFSET_IN_LOG
public static final int SEQUENCE_OFFSET_IN_LOG
- See Also:
- Constant Field Values
-
LOGICAL_SG_OFFSET_IN_LOG
public static final int LOGICAL_SG_OFFSET_IN_LOG
- See Also:
- Constant Field Values
-
DATA_REGION_OFFSET_IN_LOG
public static final int DATA_REGION_OFFSET_IN_LOG
- See Also:
- Constant Field Values
-
TIME_PARTITION_OFFSET_IN_LOG
public static final int TIME_PARTITION_OFFSET_IN_LOG
- See Also:
- Constant Field Values
-
FILE_NAME_OFFSET_IN_LOG
public static final int FILE_NAME_OFFSET_IN_LOG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFileIdentifierFromFilePath
public static TsFileIdentifier getFileIdentifierFromFilePath(java.lang.String filepath)
This function generates an instance of CompactionFileIdentifier by parsing the path of a tsfile. Notice, the path of the file should include information of its logical storage group, virtual storage group id, time partition, sequence or not and its filename, such as "sequence/root.test.sg/0/0/1-1-0-0.tsfile".
-
getFileIdentifierFromInfoString
public static TsFileIdentifier getFileIdentifierFromInfoString(java.lang.String infoString)
This function generates an instance of CompactionFileIdentifier by parsing the info string of a tsfile(usually recorded in a compaction.log), such as “sequence root.test.sg 0 0 0-0-0-0.tsfile"
-
getFileIdentifierFromOldInfoString
public static TsFileIdentifier getFileIdentifierFromOldInfoString(java.lang.String oldInfoString)
This function generates an instance of CompactionFileIdentifier by parsing the old info string from previous version (<0.13) of a tsfile(usually recorded in a compaction.log). Such as “root.test.sg 0 0 1-1-0-0.tsfile true" from old cross space compaction log and "root.test.sg 0 0 1-1-0-0.tsfile sequence" from old inner space compaction log.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getFileFromDataDirs
public java.io.File getFileFromDataDirs()
This method find the File object of current file by searching it in every data directory. If the file is not found, it will return null.
-
getFilename
public java.lang.String getFilename()
-
getFilePath
public java.lang.String getFilePath()
-
getLogicalStorageGroupName
public java.lang.String getLogicalStorageGroupName()
-
getDataRegionId
public java.lang.String getDataRegionId()
-
getTimePartitionId
public java.lang.String getTimePartitionId()
-
isSequence
public boolean isSequence()
-
-