Kinetica   C#   API  Version 7.2.3.1
Example.ShardKeyExample.ShardedRecord Class Reference

Record class with multiple shard key columns demonstrating allowed shard key types. More...

+ Inheritance diagram for Example.ShardKeyExample.ShardedRecord:
+ Collaboration diagram for Example.ShardKeyExample.ShardedRecord:

Public Member Functions

override string ToString ()
 
ShardKeyValues GetShardKeyValues ()
 Returns shard key column names and their typed values. More...
 

Properties

int id [get, set]
 Primary key - integer ID (also shard key) More...
 
string region_code = string.Empty [get, set]
 Region code - CHAR4 shard key for geographic distribution More...
 
int category_id [get, set]
 Category ID - INT16 shard key More...
 
long event_timestamp [get, set]
 Event timestamp - stored as LONG (not part of shard key for simpler expression building) More...
 
string device_uuid = string.Empty [get, set]
 Device UUID - stored for reference More...
 
string event_name = string.Empty [get, set]
 Event name - regular string column More...
 
double event_value [get, set]
 Event value - double (cannot be shard key) More...
 
string client_ip = string.Empty [get, set]
 IP address of the client More...
 
string metadata = string.Empty [get, set]
 Additional JSON metadata More...
 

Detailed Description

Record class with multiple shard key columns demonstrating allowed shard key types.

The combination of all shard key columns determines the worker node for each record.

Note: For RecordRetriever to work properly, shard keys should be simple types (INT, LONG, STRING with charN) that can be easily expressed in filter expressions.

Definition at line 33 of file ShardKeyExample.cs.

Member Function Documentation

◆ GetShardKeyValues()

ShardKeyValues Example.ShardKeyExample.ShardedRecord.GetShardKeyValues ( )
inline

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.

Implements IShardKeyExtractor.

Definition at line 75 of file ShardKeyExample.cs.

◆ ToString()

override string Example.ShardKeyExample.ShardedRecord.ToString ( )
inline

Definition at line 69 of file ShardKeyExample.cs.

Property Documentation

◆ category_id

int Example.ShardKeyExample.ShardedRecord.category_id
getset

Category ID - INT16 shard key

Definition at line 46 of file ShardKeyExample.cs.

◆ client_ip

string Example.ShardKeyExample.ShardedRecord.client_ip = string.Empty
getset

IP address of the client

Definition at line 64 of file ShardKeyExample.cs.

◆ device_uuid

string Example.ShardKeyExample.ShardedRecord.device_uuid = string.Empty
getset

Device UUID - stored for reference

Definition at line 55 of file ShardKeyExample.cs.

◆ event_name

string Example.ShardKeyExample.ShardedRecord.event_name = string.Empty
getset

Event name - regular string column

Definition at line 58 of file ShardKeyExample.cs.

◆ event_timestamp

long Example.ShardKeyExample.ShardedRecord.event_timestamp
getset

Event timestamp - stored as LONG (not part of shard key for simpler expression building)

Definition at line 52 of file ShardKeyExample.cs.

◆ event_value

double Example.ShardKeyExample.ShardedRecord.event_value
getset

Event value - double (cannot be shard key)

Definition at line 61 of file ShardKeyExample.cs.

◆ id

int Example.ShardKeyExample.ShardedRecord.id
getset

Primary key - integer ID (also shard key)

Definition at line 37 of file ShardKeyExample.cs.

◆ metadata

string Example.ShardKeyExample.ShardedRecord.metadata = string.Empty
getset

Additional JSON metadata

Definition at line 67 of file ShardKeyExample.cs.

◆ region_code

string Example.ShardKeyExample.ShardedRecord.region_code = string.Empty
getset

Region code - CHAR4 shard key for geographic distribution

Definition at line 43 of file ShardKeyExample.cs.


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