Class TsFileWriter

  • All Implemented Interfaces:
    AutoCloseable

    public class TsFileWriter
    extends Object
    implements AutoCloseable
    TsFileWriter is the entrance for writing processing. It receives a record and send it to responding chunk group write. It checks memory size for all writing processing along its strategy and flush data stored in memory to OutputStream. At the end of writing, user should call close() method to flush the last data outside and close the normal outputStream and error outputStream.
    • Field Detail

      • schema

        protected final Schema schema
        schema of this TsFile.
    • Constructor Detail

      • TsFileWriter

        public TsFileWriter​(File file)
                     throws IOException
        init this TsFileWriter.
        Parameters:
        file - the File to be written by this TsFileWriter
        Throws:
        IOException
      • TsFileWriter

        public TsFileWriter​(TsFileIOWriter fileWriter)
                     throws IOException
        init this TsFileWriter.
        Parameters:
        fileWriter - the io writer of this TsFile
        Throws:
        IOException
      • TsFileWriter

        public TsFileWriter​(File file,
                            Schema schema)
                     throws IOException
        init this TsFileWriter.
        Parameters:
        file - the File to be written by this TsFileWriter
        schema - the schema of this TsFile
        Throws:
        IOException
      • TsFileWriter

        public TsFileWriter​(TsFileOutput output,
                            Schema schema)
                     throws IOException
        init this TsFileWriter.
        Parameters:
        output - the TsFileOutput of the file to be written by this TsFileWriter
        schema - the schema of this TsFile
        Throws:
        IOException
      • TsFileWriter

        public TsFileWriter​(File file,
                            Schema schema,
                            TSFileConfig conf)
                     throws IOException
        init this TsFileWriter.
        Parameters:
        file - the File to be written by this TsFileWriter
        schema - the schema of this TsFile
        conf - the configuration of this TsFile
        Throws:
        IOException
      • TsFileWriter

        protected TsFileWriter​(TsFileIOWriter fileWriter,
                               Schema schema,
                               TSFileConfig conf)
                        throws IOException
        init this TsFileWriter.
        Parameters:
        fileWriter - the io writer of this TsFile
        schema - the schema of this TsFile
        conf - the configuration of this TsFile
        Throws:
        IOException