Interface BufferedAppendable

All Known Subinterfaces:
BufferedAppendableColumn<DATA_TYPE>, BufferedAppendableTable<COLUMN_IMPL_TYPE>
All Known Implementing Classes:
AppendableSymbolManager, ArrayVariableWidthObjectLocalAppendableColumn, BoundedAppendableSymbolManager, BufferVariableWidthObjectLocalAppendableColumn, CharSequenceLocalAppendableColumn, CompressedStringLocalAppendableColumn, DateTimeLocalAppendableColumn, DiskTableWriter, ExternalizableLocalAppendableColumn, FixedWidthObjectCodecLocalAppendableColumn, InstantLocalAppendableColumn, LocalAppendableColumn, LocalAppendableTable, LocalTableWriter, NanosBackedTimeAppendableColumn, SerializableLocalAppendableColumn, StrictAppendableSymbolManager, StringLocalAppendableColumn, SymbolLocalAppendableColumn, SymbolManagerLocalAppendableColumn, SymbolSetLocalAppendableColumn, VariableWidthObjectCodecLocalAppendableColumn, VariableWidthObjectLocalAppendableColumn

public interface BufferedAppendable
Interface for appendable objects with built-in buffering. In general, all operations but for force() should be done on the "writing thread" or under a lock that also ensures mutually-exclusive writing.
  • Method Summary

    Modifier and Type Method Description
    void close()
    Flush all appended data to the underlying store, release any resources held, and force all appended data to be persisted to permanent storage.
    void flush()
    Write all appended data to the underlying store and prepare for subsequent writes.
    void force()
    Force all flushed data to be persisted to permanent storage.
    default boolean maybeForce()
    Perform a force() if there is data pending persistence.
    default void prepareCheckpoint()
    Optional operation.
    void release()
    Release any resources held.
  • Method Details

    • flush

      void flush()
      Write all appended data to the underlying store and prepare for subsequent writes. Does not imply force().
    • prepareCheckpoint

      default void prepareCheckpoint()
      Optional operation. Prepare a checkpoint snapshot for the next call to force(). Should be called directly after flush(), with no intervening modification operations.
    • force

      void force()
      Force all flushed data to be persisted to permanent storage. Will consistently and atomically persist the last prepared checkpoint in implementations that implement prepareCheckpoint(). Does not imply flush(), as this is a distinct operation in all implementations. May be called concurrently by threads other than the "writing thread".
    • maybeForce

      default boolean maybeForce()
      Perform a force() if there is data pending persistence. Implementations that don't keep track of pending data explicitly will always invoke force() pessimistically.
      Returns:
      Whether this call may have done any actual work (i.e. there was data pending or assumed to be pending)
    • close

      void close()
      Flush all appended data to the underlying store, release any resources held, and force all appended data to be persisted to permanent storage. This should be the final access to this appendable (if successful) with the exception of any asynchronous force() operations. A release() is appropriate afterwards, especially on error.
    • release

      void release()
      Release any resources held. Called after an error in preparation for termination. For external callers, this should be done as the final access to this column with the exception of any asynchronous force() operations.