Kinetica   C#   API  Version 7.2.3.1
DirectRequestEncoder Class Reference

Direct binary encoder for RawInsertRecordsRequest that bypasses the Apache Avro library. More...

Static Public Member Functions

static byte [] Encode (string tableName, IReadOnlyList< byte[]> records, IDictionary< string, string >? options)
 Encodes a RawInsertRecordsRequest directly to Avro binary format. More...
 
static byte [] EncodeZeroCopy (string tableName, byte[] recordsBuffer,(int Offset, int Length)[] recordSegments, IDictionary< string, string >? options)
 Encodes using pre-encoded records stored in a contiguous buffer with segments. More...
 

Detailed Description

Direct binary encoder for RawInsertRecordsRequest that bypasses the Apache Avro library.

This eliminates the overhead of GenericRecord creation and reflection during request serialization.

The request is encoded directly to Avro binary format:

  • table_name: string (length-prefixed UTF-8)
  • list: array of bytes (each element is length-prefixed)
  • list_str: array of strings (empty for binary encoding)
  • list_encoding: string ("binary")
  • options: map of string->string

Definition at line 675 of file AvroEncoders.cs.

Member Function Documentation

◆ Encode()

static byte [] DirectRequestEncoder.Encode ( string  tableName,
IReadOnlyList< byte[]>  records,
IDictionary< string, string >?  options 
)
inlinestatic

Encodes a RawInsertRecordsRequest directly to Avro binary format.

This is 5-10x faster than using the standard Avro encoder.

Definition at line 684 of file AvroEncoders.cs.

◆ EncodeZeroCopy()

static byte [] DirectRequestEncoder.EncodeZeroCopy ( string  tableName,
byte []  recordsBuffer,
(int Offset, int Length) []  recordSegments,
IDictionary< string, string >?  options 
)
inlinestatic

Encodes using pre-encoded records stored in a contiguous buffer with segments.

This is the zero-copy path when records are already encoded.

Definition at line 724 of file AvroEncoders.cs.


The documentation for this class was generated from the following file: