Interface IGDIDProvider
Represents an entity that provides unique Global Distributed IDs (GDIDs) via named sequences. Note: GDID.Zero is never returned as it indicates the absence of a value
Inherited Members
Namespace: NFX.DataAccess
Assembly: NFX.dll
Syntax
public interface IGDIDProvider : IUniqueSequenceProvider, INamed
Properties
TestingAuthorityNode
Gets/sets Authority Glue Node for testing. It can only be set once in the testing app container init before the first call to Generate is made. When this setting is set then any cluster authority nodes which would have been normally used will be completely bypassed during block allocation
Declaration
string TestingAuthorityNode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
GenerateOneGDID(String, String, Int32, Nullable<UInt64>, Boolean)
Generates Globally-Unique distributed ID (GDID) for the supplied sequence name. Note: do not confuse with block pre-allocation, which is an internal optimization. Even if 100 IDs are pre-allocated the method returns one unique GDID
Declaration
GDID GenerateOneGDID(string scopeName, string sequenceName, int blockSize = 0, ulong ? vicinity, bool noLWM = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName | The name of scope where sequences are kept |
System.String | sequenceName | The name of sequence within the scope for which ID to be obtained |
System.Int32 | blockSize | If >0 specifies how many sequence values to pre-allocate, otherwise provider would use its default setting |
System.Nullable<System.UInt64> | vicinity | The location on ID counter scale, the authority may disregard this parameter |
System.Boolean | noLWM | When true, does not start async fetch of the next ID block while the current block reaches low-water-mark. This may not be desired in some short-lived processes. The provider may disregard this flag |
Returns
Type | Description |
---|---|
GDID | The GDID instance |
TryGenerateManyConsecutiveGDIDs(String, String, Int32, Nullable<UInt64>, Boolean)
Tries to generate many consecutive Globally-Unique distributed ID (GDID) from the same authority for the supplied sequence name. If the reserved block gets exhausted, then the returned ID array length may be less than requested
Declaration
GDID[] TryGenerateManyConsecutiveGDIDs(string scopeName, string sequenceName, int gdidCount, ulong ? vicinity, bool noLWM = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | scopeName | The name of scope where sequences are kept |
System.String | sequenceName | The name of sequence within the scope for which ID to be obtained |
System.Int32 | gdidCount | How many Consecutive GDIDs from the same authority should the system try to reserve |
System.Nullable<System.UInt64> | vicinity | The location on ID counter scale, the authority may disregard this parameter |
System.Boolean | noLWM | When true, does not start async fetch of the next ID block while the current block reaches low-water-mark. This may not be desired in some short-lived processes. The provider may disregard this flag |
Returns
Type | Description |
---|---|
GDID[] | The GDID[] instance which may have less elements than requested by gdidCount |