DanielLeens commented on PR #13526: URL: https://github.com/apache/seatunnel/pull/13526#issuecomment-7234539264
### Implementation Notes and Trade-offs Head: `e97b1e8073a615e86f3cf21335696fd5cab15875`. This correction follows the [full original-head review](https://github.com/apache/seatunnel/pull/13526#pullrequestreview-6095880472) and closes its four source findings. The cumulative PR still supplies the `AmazonKinesis` source and sink in one product artifact. The sink now subtracts the UTF-8 partition-key bytes before payload admission. Text is measured before encoding; binary keeps its existing checked byte-array path. Native JSON uses a Kinesis-owned typed preflight, repeated allocation-time admission checks and an exact bounded output stream. Every array/map/row occurrence consumes conversion work, including repeated references. This prevents a compact shared input graph from expanding far beyond `record_bytes` before the size check. Only scalar conversion is delegated to the public native formatter. Schema validation, composite node construction and JSON container emission are iterative, so shared schema branches do not construct exponentially many composite converters and deep narrow valid values do not rely on recursive container serialization. No new fixed depth cap is imposed. Native scalar/null/temporal/binary/numeric representation, compact decimal map keys, canonical key overwrite, insertion order and composite reuse behavior are retained. Cyclic schemas/values fail through connector-owned diagnostics without the shared serializer's row-stringifying error wrapper. The work bound and final byte bound serve different purposes. Every conversion occurrence is counted, including canonical map entries that are later overwritten and numeric text that normalizes to a shorter output. Pathological conversion work can therefore be rejected even when the final collapsed object would be small. Both sink guides explain this contract. A bounded intermediate tree preserves the native overwrite/insertion behavior; an extra preflight and allocation-time checks add CPU work. No throughput or whole-JVM memory acceptance has been measured. `AmazonKinesisSink` also retains the factory-supplied `CatalogTable` and implements the required catalog API for specification, DAG and metrics consumers. Required class/lifecycle/state contracts, ordinary imports and equivalent method ordering were completed in the owning classes. The static comparison covers 170 original method bodies; 166 retain their executable tokens after comment/format and the two equivalent import qualifications. Only the sink constructor and writer constructor/`write`/`payload` intentionally change. Every original test body/assertion remains intact. The correction changes no POM, shared formatter, engine/API hook, source algorithm or `KinesisSplit` state field/version/layout. Source recovery still uses exact logical sequences/topology/anchor and SeaTunnel checkpoints, with one active reader and durable parent completion before child consumption. Batch catch-up remains per shard. Sink partial retries still resend only validated failed slots, ambiguous whole-call acceptance still fails the attempt, and ordered chaining remains limited to one writer session. Engine recovery can replay accepted writes; no exactly-once or cross-shard snapshot guarantee is added. External consumer leases, aggregated-record processing and programmatic role assumption/session tagging remain outside this initial contract. Direct regional HTTPS connectivity remains required. Authored regression coverage is now 5 component methods and 11 Zeta engine methods, preserving the original 1/10 method bodies and assertions. The new component cases target distinct risks: an actual writer/16-entry tracking-map oracle proves admission must stop iteration early; shared-array and UTF-8/plain-decimal cases cover expansion; exact small native values, canonical key collisions and escaped-byte overflow cover output fidelity; a 2,000-level narrow value, nullable shared schema and cyclic schema cover construction/output recursion. The added packaged-array engine case checks exact accepted JSON and zero provider writes on rejection. Provider fixtures and authored counts are not executed or live-AWS acceptance evidence. Both leaf Spotless checks and static/diff preservation checks passed on the candidate whose committed file hashes were read back unchanged at this head. No local compilation, UT/IT, package, Docker, service, AWS or OOM/stack-exhaustion run was performed. At the exact-head CI snapshot, exact-head [Build 46110707497](https://github.com/DanielLeens/seatunnel/actions/runs/46110707497) was `queued` with no conclusion; no new-head runtime/test/package pass is claimed. The source correction is available for human review with CI as the outstanding validation gate. Maintainer approval, merge and live-service acceptance remain separate decisions. -- 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]
