PartitionIdthat you see in Service Explorer is the unique identifier for the section where the service request ends. PartitionKey- this is not the same as, PartitionIdbut rather, the key that is included in the hashing of partitions and is based on the fact that the partition on which the query ends with this key is calculated from.
In ApplicationManifest.xmlthe application project, the separation key for the newly created service is as follows:
<Service Name="MyService">
<StatefulService ServiceTypeName="MyServiceType"
TargetReplicaSetSize="[MyService_TargetReplicaSetSize]"
MinReplicaSetSize="[MyService_MinReplicaSetSize]">
<UniformInt64Partition PartitionCount="[MyService_PartitionCount]"
LowKey="-9223372036854775808"
HighKey="9223372036854775807" />
</StatefulService>
</Service>
UniformInt64Partition , Int64Range. LowKey HighKey . PartitionCount , . , . , , specificik. :.
<Parameters>
...
<Parameter Name="MyService_PartitionCount" DefaultValue="2" />
...
</Parameters>
...
<Service Name="MyService">
<StatefulService ServiceTypeName="MyServiceType"
TargetReplicaSetSize="[MyService_TargetReplicaSetSize]"
MinReplicaSetSize="[MyService_MinReplicaSetSize]">
<UniformInt64Partition PartitionCount="[MyService_PartitionCount]"
LowKey="0"
HighKey="11" />
</StatefulService>
</Service>
2 , :
, , , , . () 4, :
- 0 - 2: 0
- 3 - 5: 1
- 6 - 8: 2
- 9 - 11: 3
, , . . Stateless.
Microsoft :
https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-concepts-partitioning
, LowKey HighKey, ( UniformInt64Partition). , FABRIC_E_INVALID_PARTITION_KEY, , . , FABRIC_E_KEY_NOT_FOUND .