Search code examples
powershellazureazure-elastic-scale

ShardManagement Binary ShardingKey Max Value


I am currently setting up my shardmap manager, shard map ... via the PowerShell script provided here.

While the example uses int as ShardingKey type, I have a binary(16) ShardingKey, does anyone know how to determine and pass a high key of max binary(16) to Add-RangeMapping ?


Solution

  • The Add-RangeMapping function calls the Range(low, high) constructor. In order to create a range with a max high value, it would need to call the Range(low) constructor. So you'll have to edit the Add-RangeMapping function appropriately (or just directly call into the library code without using the Add-RangeMapping function).

    The PowerShell helper scripts don't cover the complete Elastic Database Client Library surface area so you may find a few more gaps.