Skip to main content

Interface for extracting shard key values from a record. More…

Inheritance diagram for kinetica.Records.IShardKeyExtractor:

Public Member Functions

ShardKeyValues GetShardKeyValues ()
 Returns shard key column names and their typed values.
 
ShardKeyValues GetShardKeyValues ()
 Returns shard key column names and their typed values.
 

Detailed Description

Interface for extracting shard key values from a record.

Equivalent to Rust’s ShardKeyExtractor trait.

Implementing this interface enables shard-aware routing in the BulkInserter, allowing records to be sent directly to the correct worker node based on their shard key values.

public class SensorReading : IShardKeyExtractor
public int Id get; set;
public string Region get; set;
public double Value get; set;
public ShardKeyValues GetShardKeyValues()
// Single shard key column
return ShardKeyValues.Single(“id”, ShardKeyValue.Int(Id));
// Or for composite shard keys:
// return new ShardKeyValues(
// (“id”, ShardKeyValue.Int(Id)),
// (“region”, ShardKeyValue.String(Region))
// );
Interface for extracting shard key values from a record.
ShardKeyValues GetShardKeyValues()
Returns shard key column names and their typed values.
static ShardKeyValues Single(string name, ShardKeyValue value)
Creates a ShardKeyValues collection with a single value.

Definition at line 34 of file IShardKeyExtractor.cs.

Member Function Documentation

◆ GetShardKeyValues() [1/2]

ShardKeyValues kinetica.Records.IShardKeyExtractor.GetShardKeyValues ()

Returns shard key column names and their typed values.

Only columns that are part of the shard key need to be included. The values are used for computing the routing hash to determine which worker node should receive the record.

For best performance, implement this method to avoid allocations when possible (e.g., use ShardKeyValues.Single() for single-column keys).

Returns
A collection of (column name, value) pairs for the shard key.

Implemented in Example.AllTypesExample.AllTypesRecord, Example.AllTypesExample.AllTypesRecord, Example.SensorReading, Example.SensorReading, Example.ShardKeyExample.ShardedRecord, Example.ShardKeyExample.ShardedRecord, Kinetica.Benchmarks.BulkInserterBenchmarks.BenchRecord, Kinetica.Benchmarks.BulkInserterBenchmarks.BenchRecord, Kinetica.LoadGenerator.IngestRecord, Kinetica.LoadGenerator.IngestRecord, Kinetica.LoadGenerator.IngestRecord2, Kinetica.LoadGenerator.IngestRecord2, kinetica.Records.GenericRecord, kinetica.Records.GenericRecord, Kinetica.Tests.IntegrationTests.BulkInserterDebugTest.TestRecord, Kinetica.Tests.IntegrationTests.BulkInserterDebugTest.TestRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.ShardedRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.ShardedRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.TestRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.TestRecord, Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.CompositeDecimal12Record, Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.CompositeDecimal12Record, Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.Decimal12ShardedRecord, and Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.Decimal12ShardedRecord.

◆ GetShardKeyValues() [2/2]

ShardKeyValues kinetica.Records.IShardKeyExtractor.GetShardKeyValues ()

Returns shard key column names and their typed values.

Only columns that are part of the shard key need to be included. The values are used for computing the routing hash to determine which worker node should receive the record.

For best performance, implement this method to avoid allocations when possible (e.g., use ShardKeyValues.Single() for single-column keys).

Returns
A collection of (column name, value) pairs for the shard key.

Implemented in Example.AllTypesExample.AllTypesRecord, Example.AllTypesExample.AllTypesRecord, Example.SensorReading, Example.SensorReading, Example.ShardKeyExample.ShardedRecord, Example.ShardKeyExample.ShardedRecord, Kinetica.Benchmarks.BulkInserterBenchmarks.BenchRecord, Kinetica.Benchmarks.BulkInserterBenchmarks.BenchRecord, Kinetica.LoadGenerator.IngestRecord, Kinetica.LoadGenerator.IngestRecord, Kinetica.LoadGenerator.IngestRecord2, Kinetica.LoadGenerator.IngestRecord2, kinetica.Records.GenericRecord, kinetica.Records.GenericRecord, Kinetica.Tests.IntegrationTests.BulkInserterDebugTest.TestRecord, Kinetica.Tests.IntegrationTests.BulkInserterDebugTest.TestRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.ShardedRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.ShardedRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.TestRecord, Kinetica.Tests.IntegrationTests.BulkInserterTests.TestRecord, Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.CompositeDecimal12Record, Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.CompositeDecimal12Record, Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.Decimal12ShardedRecord, and Kinetica.Tests.IntegrationTests.Decimal12ShardKeyTests.Decimal12ShardedRecord.


The documentation for this interface was generated from the following files: