fresh-borzoni opened a new pull request, #174:
URL: https://github.com/apache/fluss-rust/pull/174

     ### Purpose
   
     Linked issue: close #162
   
   Implement the ReadContext pattern and typed row decoding for the KV record 
read path, mirroring the Java reference implementation. This enables reading KV 
records with typed CompactedRow access while maintaining performance through 
decoder caching.
   
     **Core Infrastructure:**
     - Added `ReadContext` trait for providing schema-specific row decoders
     - Implemented `KvRecordReadContext` with double-check locking for decoder 
caching
     - Created `RowDecoder` trait abstraction with `CompactedRowDecoder` 
implementation
     - Added `SchemaGetter` trait for fallible schema retrieval
   
     **API Changes:**
     - Modified `KvRecordBatch::records()` to accept `&dyn ReadContext` 
parameter
     - Updated `KvRecord` to support typed decoding via `row(&dyn RowDecoder)` 
method
     - Added `KvRecordIterator::row()` helper method for ergonomic typed access
     - Iterator yields raw `KvRecord` (no Arc clone per record)
   
     **Design Decisions:**
     - Batch remains stateless (ReadContext passed as parameter, not stored)
     - Decoder cached by schema ID in ReadContext (performance optimization)
     - On-demand decoding: stores raw bytes, decodes via helper method
     - Mutex poison recovery for cache robustness
   
     **Test Improvements:**
     - Consolidated tests from 19 → 12
     - All tests use typed API (not raw bytes at batch level)
     - Full coverage maintained for read path, caching, and error handling
   
     ### API and Format
   
     **API Changes:**
     - New public API: `ReadContext`, `SchemaGetter`, `RowDecoder` traits
     - `KvRecordBatch::records()` now requires `&dyn ReadContext` parameter
     - `KvRecord::row()` returns `Option<CompactedRow<'_>>` with decoder 
parameter
     - `KvRecordIterator::row()` helper for ergonomic typed access
   
     **Storage Format:**
     - No changes to on-disk format
     - Binary compatibility maintained
   
     ### Documentation
   
     **New Features:**
     - ReadContext pattern for decoder management and caching
     - Typed row access via RowDecoder abstraction
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to