You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We need to generate a 80-bits stamp, and also need to mark it as 'incomplete' by forcing the highest bit to 1.
306
+
// Since this is supposed to be a version number with a ~1M tickrate per seconds, we will play it safe, and force the 8 highest bits to 1,
307
+
// meaning that we only reduce the database potential lifetime but 1/256th, before getting into trouble.
308
+
//
309
+
// By doing some empirical testing, it also seems that the last 16 bits are a transction batch order which is usually a low number.
310
+
// Again, we will force the 4 highest bit to 1 to reduce the change of collision with a complete version stamp.
311
+
//
312
+
// So the final token will look like: 'FF xx xx xx xx xx xx xx Fy yy', were 'x' is the random token, and 'y' will lowest 12 bits of the transaction retry count
/// <summary>Return a place-holder 80-bit VersionStamp, whose value is not yet known, but will be filled by the database at commit time.</summary>
336
+
/// <returns>This value can used to generate temporary keys or value, for use with the <see cref="FdbMutationType.VersionStampedKey"/> or <see cref="FdbMutationType.VersionStampedValue"/> mutations</returns>
337
+
/// <remarks>
338
+
/// The generate placeholder will use a random value that is unique per transaction (and changes at reach retry).
339
+
/// If the key contains the exact 80-bit byte signature of this token, the corresponding location will be tagged and replaced with the actual VersionStamp at commit time.
340
+
/// If another part of the key contains (by random chance) the same exact byte sequence, then an error will be triggered, and hopefully the transaction will retry with another byte sequence.
/// <summary>Return a place-holder 96-bit VersionStamp with an attached user version, whose value is not yet known, but will be filled by the database at commit time.</summary>
351
+
/// <returns>This value can used to generate temporary keys or value, for use with the <see cref="FdbMutationType.VersionStampedKey"/> or <see cref="FdbMutationType.VersionStampedValue"/> mutations</returns>
352
+
/// <remarks>
353
+
/// The generate placeholder will use a random value that is unique per transaction (and changes at reach retry).
354
+
/// If the key contains the exact 80-bit byte signature of this token, the corresponding location will be tagged and replaced with the actual VersionStamp at commit time.
355
+
/// If another part of the key contains (by random chance) the same exact byte sequence, then an error will be triggered, and hopefully the transaction will retry with another byte sequence.
356
+
/// </remarks>
357
+
public VersionStamp CreateVersionStamp(intuserVersion)
Copy file name to clipboardExpand all lines: FoundationDB.Client/IFdbTransaction.cs
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,24 @@ public interface IFdbTransaction : IFdbReadOnlyTransaction
120
120
/// </remarks>
121
121
Task<VersionStamp>GetVersionStampAsync();
122
122
123
+
/// <summary>Return a place-holder 80-bit VersionStamp, whose value is not yet known, but will be filled by the database at commit time.</summary>
124
+
/// <returns>This value can used to generate temporary keys or value, for use with the <see cref="FdbMutationType.VersionStampedKey"/> or <see cref="FdbMutationType.VersionStampedValue"/> mutations</returns>
125
+
/// <remarks>
126
+
/// The generate placeholder will use a random value that is unique per transaction (and changes at reach retry).
127
+
/// If the key contains the exact 80-bit byte signature of this token, the corresponding location will be tagged and replaced with the actual VersionStamp at commit time.
128
+
/// If another part of the key contains (by random chance) the same exact byte sequence, then an error will be triggered, and hopefully the transaction will retry with another byte sequence.
129
+
/// </remarks>
130
+
VersionStampCreateVersionStamp();
131
+
132
+
/// <summary>Return a place-holder 96-bit VersionStamp with an attached user version, whose value is not yet known, but will be filled by the database at commit time.</summary>
133
+
/// <returns>This value can used to generate temporary keys or value, for use with the <see cref="FdbMutationType.VersionStampedKey"/> or <see cref="FdbMutationType.VersionStampedValue"/> mutations</returns>
134
+
/// <remarks>
135
+
/// The generate placeholder will use a random value that is unique per transaction (and changes at reach retry).
136
+
/// If the key contains the exact 80-bit byte signature of this token, the corresponding location will be tagged and replaced with the actual VersionStamp at commit time.
137
+
/// If another part of the key contains (by random chance) the same exact byte sequence, then an error will be triggered, and hopefully the transaction will retry with another byte sequence.
0 commit comments