类 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.
    • 字段详细资料

      • FILE_SUFFIX

        public static final java.lang.String FILE_SUFFIX
        另请参阅:
        常量字段值
      • COMPACTION_FILE_SUFFIX

        public static final java.lang.String COMPACTION_FILE_SUFFIX
        另请参阅:
        常量字段值
    • 构造器详细资料

      • ModificationFile

        public ModificationFile​(java.lang.String filePath)
        Construct a ModificationFile using a file as its storage.
        参数:
        filePath - the path of the storage 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.