Class LocalTextModificationAccessor
- java.lang.Object
-
- org.apache.iotdb.db.engine.modification.io.LocalTextModificationAccessor
-
- All Implemented Interfaces:
java.lang.AutoCloseable,ModificationReader,ModificationWriter
public class LocalTextModificationAccessor extends java.lang.Object implements ModificationReader, ModificationWriter, java.lang.AutoCloseable
LocalTextModificationAccessor uses a file on local file system to store the modifications in text format, and writes modifications by appending to the tail of the file.
-
-
Constructor Summary
Constructors Constructor Description LocalTextModificationAccessor(java.lang.String filePath)Construct a LocalTextModificationAccessor using a file specified by filePath.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()Abort last modification.voidclose()Release resources like streams.java.util.Collection<Modification>read()Read all modifications from a persistent medium.voidwrite(Modification mod)Write a new modification to the persistent medium.
-
-
-
Method Detail
-
read
public java.util.Collection<Modification> read()
Description copied from interface:ModificationReaderRead all modifications from a persistent medium. If the mods file is crashed, the redundant modifications will be truncated until the file is correct.- Specified by:
readin interfaceModificationReader- Returns:
- a list of modifications contained the medium.
-
close
public void close() throws java.io.IOExceptionDescription copied from interface:ModificationReaderRelease resources like streams.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceModificationReader- Specified by:
closein interfaceModificationWriter- Throws:
java.io.IOException
-
abort
public void abort() throws java.io.IOExceptionDescription copied from interface:ModificationWriterAbort last modification. Notice that after calling abort(), a fileWriter is opened.- Specified by:
abortin interfaceModificationWriter- Throws:
java.io.IOException
-
write
public void write(Modification mod) throws java.io.IOException
Description copied from interface:ModificationWriterWrite a new modification to the persistent medium. Notice that after calling write(), a fileWriter is opened.- Specified by:
writein interfaceModificationWriter- Parameters:
mod- the modification to be written.- Throws:
java.io.IOException
-
-