Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Risingwavelabs Risingwave Deserializer Interface: Difference between revisions

From Leeroopedia
Auto-imported from implementations/Risingwavelabs_Risingwave_Deserializer_Interface.md
 
Sync from local file
 
Line 89: Line 89:
== Related Pages ==
== Related Pages ==


* [[Risingwavelabs_Risingwave_SinkRow_Interface|SinkRow Interface]] - The row objects produced by deserialization
* [[Implementation:Risingwavelabs_Risingwave_SinkRow_Interface|SinkRow Interface]] - The row objects produced by deserialization
* [[Risingwavelabs_Risingwave_SinkWriterV1_Interface|SinkWriterV1 Interface]] - Sink writers that consume deserialized rows
* [[Implementation:Risingwavelabs_Risingwave_SinkWriterV1_Interface|SinkWriterV1 Interface]] - Sink writers that consume deserialized rows
* [[Risingwavelabs_Risingwave_TableSchema|TableSchema]] - Provides the schema information needed for deserialization
* [[Implementation:Risingwavelabs_Risingwave_TableSchema|TableSchema]] - Provides the schema information needed for deserialization
* [[Risingwavelabs_Risingwave_SinkWriterStreamObserver_OnNext|SinkWriterStreamObserver OnNext]] - The gRPC handler that invokes deserialization on incoming write batches
* [[Implementation:Risingwavelabs_Risingwave_SinkWriterStreamObserver_OnNext|SinkWriterStreamObserver OnNext]] - The gRPC handler that invokes deserialization on incoming write batches


[[Category:Implementations]]
[[Category:Implementations]]


[[Category:Implementations]]
[[Category:Implementations]]

Latest revision as of 10:50, 27 September 2026


Metadata

Property Value
File java/connector-node/connector-api/src/main/java/com/risingwave/connector/api/sink/Deserializer.java
Language Java
Module connector-api
Package com.risingwave.connector.api.sink
Classes Deserializer (interface)
Lines 24

Overview

Deserializer is an interface that defines the contract for deserializing protobuf WriteBatch messages into an iterable sequence of SinkRow objects. This abstraction allows different serialization formats to be supported by providing different Deserializer implementations, while the rest of the sink pipeline can consume rows uniformly.

The returned CloseableIterable<SinkRow> ensures that any resources allocated during deserialization can be properly released after the rows have been consumed.

Code Reference

Source Location

java/connector-node/connector-api/src/main/java/com/risingwave/connector/api/sink/Deserializer.java

Signature

public interface Deserializer {
    CloseableIterable<SinkRow> deserialize(
            ConnectorServiceProto.SinkWriterStreamRequest.WriteBatch writeBatch);
}

Imports

import com.risingwave.proto.ConnectorServiceProto;

I/O Contract

deserialize

Parameter Type Description
writeBatch ConnectorServiceProto.SinkWriterStreamRequest.WriteBatch A protobuf message containing a batch of rows to be written to a sink
Direction Type Description
Output CloseableIterable<SinkRow> An iterable of deserialized SinkRow objects that can be closed when consumption is complete

Contract:

  • The implementation must convert each row in the WriteBatch protobuf message into a SinkRow instance
  • The returned CloseableIterable must be closed after use to release any underlying resources
  • Each SinkRow in the iterable must have a valid operation type (Op) and column values

Usage Examples

// Typical usage within a sink writer stream handler
Deserializer deserializer = new JsonDeserializer(tableSchema);

// Deserialize a WriteBatch received via gRPC
ConnectorServiceProto.SinkWriterStreamRequest.WriteBatch batch = request.getWrite();
try (CloseableIterable<SinkRow> rows = deserializer.deserialize(batch)) {
    for (SinkRow row : rows) {
        // Process each row
        Data.Op op = row.getOp();
        Object value = row.get(0);
    }
}

Related Pages