Class BCFile.Writer

    • Method Detail

      • getLength

        public long getLength()
      • close

        public void close()
                   throws IOException
        Close the BCFile Writer. Attempting to use the Writer after calling close is not allowed and may lead to undetermined results.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Throws:
        IOException
      • prepareMetaBlock

        public BCFile.Writer.BlockAppender prepareMetaBlock​(String name)
                                                     throws IOException,
                                                            MetaBlockAlreadyExists
        Create a Meta Block and obtain an output stream for adding data into the block. The Meta Block will be compressed with the same compression algorithm as data blocks. There can only be one BlockAppender stream active at any time. Regular Blocks may not be created after the first Meta Blocks. The caller must call BlockAppender.close() to conclude the block creation.
        Parameters:
        name - The name of the Meta Block. The name must not conflict with existing Meta Blocks.
        Returns:
        The BlockAppender stream
        Throws:
        MetaBlockAlreadyExists - If the meta block with the name already exists.
        IOException
      • prepareDataBlock

        public BCFile.Writer.BlockAppender prepareDataBlock()
                                                     throws IOException
        Create a Data Block and obtain an output stream for adding data into the block. There can only be one BlockAppender stream active at any time. Data Blocks may not be created after the first Meta Blocks. The caller must call BlockAppender.close() to conclude the block creation.
        Returns:
        The BlockAppender stream
        Throws:
        IOException