ark::logging::SplitWriter

Defined in header “ark/logging/split_writer.hh”.


A split writer is used by the column writer to write data out to files in an organized fashion.

Methods

  • SplitWriter(SplitWriterConfiguration config)
    Constructor. Initializes a new split writer.

  • ~SplitWriter()
    Destructor. Cleans up (and potentially throws!) if close() has not already been called.

  • SplitDeclaration declaration()
    Returns the split declaration for this particular split writer. This contains some useful statistical information.

  • SplitWriterStatistics statistics()
    Returns statistics related to this split writer.

  • void flush()
    Flushes the current split file. Synchronizes with the disk, and ensures all of the header/index information is up-to-date.

  • void close()
    Closes the split file, finalizing the header and synchronizing with disk. No further writes are possible after this is called.

  • size_t write(const ObjectDeclaration & declaration, const LoggingClock::time_point & indexed_time, const core::ByteBuffer & data)
    Writes out the given data to the specified declaration. This will be indexed at the given time point. This may throw if there is insufficient space in the split writer (either for indexing or due to maximum size constraints).

    Returns the number of bytes actually written (for example, if compression is on, you will typically write less bytes).

  • bool can_consume_object(size_t incoming_data_size)
    Returns true if this split writer can consume the given object, or false otherwise. Checks against the current number of free index entries, and the amount of content written.

    Call this to know you can invoke write() without running out of space.