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

From Leeroopedia
Revision as of 16:31, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Risingwavelabs_Risingwave_Deserializer_Interface.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment