类 ModificationFile
- java.lang.Object
-
- org.apache.iotdb.db.engine.modification.ModificationFile
-
- 所有已实现的接口:
java.lang.AutoCloseable
public class ModificationFile extends java.lang.Object implements java.lang.AutoCloseable
ModificationFile stores the Modifications of a TsFile or unseq file in another file in the same directory. Methods in this class are highly synchronized for concurrency safety.
-
-
字段概要
字段 修饰符和类型 字段 说明 static java.lang.String
COMPACTION_FILE_SUFFIX
static java.lang.String
FILE_SUFFIX
-
构造器概要
构造器 构造器 说明 ModificationFile(java.lang.String filePath)
Construct a ModificationFile using a file as its storage.
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 void
abort()
void
close()
Release resources such as streams and caches.ModificationFile
createHardlink()
Create a hardlink for the modification file.boolean
exists()
static ModificationFile
getCompactionMods(TsFileResource tsFileResource)
java.lang.String
getFilePath()
java.util.Collection<Modification>
getModifications()
Get all modifications stored in this file.static ModificationFile
getNormalMods(TsFileResource tsFileResource)
void
remove()
void
setFilePath(java.lang.String filePath)
void
write(Modification mod)
Write a modification in this file.
-
-
-
方法详细资料
-
close
public void close() throws java.io.IOException
Release resources such as streams and caches.- 指定者:
close
在接口中java.lang.AutoCloseable
- 抛出:
java.io.IOException
-
abort
public void abort() throws java.io.IOException
- 抛出:
java.io.IOException
-
write
public void write(Modification mod) throws java.io.IOException
Write a modification in this file. The modification will first be written to the persistent store then the memory cache.- 参数:
mod
- the modification to be written.- 抛出:
java.io.IOException
- if IOException is thrown when writing the modification to the store.
-
getModifications
public java.util.Collection<Modification> getModifications()
Get all modifications stored in this file.- 返回:
- an ArrayList of modifications.
-
getFilePath
public java.lang.String getFilePath()
-
setFilePath
public void setFilePath(java.lang.String filePath)
-
remove
public void remove() throws java.io.IOException
- 抛出:
java.io.IOException
-
exists
public boolean exists()
-
createHardlink
public ModificationFile createHardlink()
Create a hardlink for the modification file. The hardlink with have a suffix like ".{sysTime}_{randomLong}"- 返回:
- a new ModificationFile with its path changed to the hardlink, or null if the origin file does not exist or the hardlink cannot be created.
-
getNormalMods
public static ModificationFile getNormalMods(TsFileResource tsFileResource)
-
getCompactionMods
public static ModificationFile getCompactionMods(TsFileResource tsFileResource)
-
-