Interface RowTransformer

All Known Implementing Classes:
NullRowTransformer, ResultSetExtractor.ExtractTransformer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface RowTransformer
Interface for applying column value transformations directly within data fetch deserialization threads. By implementing this interface, data rows undergo transformation closer to the data source, reducing the likelihood of these rows being relegated to the garbage collector's "Old Generation" memory space.

For instance, consider a scenario where the output is formatted into a row-delimited structure (Data Extract). Here, each row is initially represented as a List, with each object denoting a potentially null column value. However, in final formats such as CSV or TSV, each row is typically condensed into a single string followed by a newline character. This shift in representation drastically reduces the memory overhead from being proportional to the number of columns (O(n)) to a constant overhead (O(1)). Apply the transformation eagerly becomes increasingly significant in scenarios with wide result sets, leading to a reduction in memory overhead and a lower frequency of garbage collection events.
  • Method Summary

    Modifier and Type
    Method
    Description
    Apply the transformation to the Row.
  • Method Details

    • transform

      Row transform(Row row)
      Apply the transformation to the Row.
      Parameters:
      row - The Row to be transformed.
      Returns:
      Returns a transformed Row object. The exact nature of the transformation and the resultant format depends on the specific implementation. The transformation should maintain data integrity while optimizing its representation for memory efficiency and performance.

      Note: THIS FUNCTION IS NOT INTENDED TO BE THREAD SAFE.