-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the read concern header to the top level Configuration. Set the consistent read concern header in the cache client test fixture if the CONSISTENT_READS env var is set. Add a new make target for the github build to use that sets the header. Update the test-cache-service make target to set the header so that the canaries will use consistent reads.
- Loading branch information
Showing
9 changed files
with
155 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
|
||
namespace Momento.Sdk.Config; | ||
|
||
/// <summary> | ||
/// The read consistency setting for the cache client. Consistent guarantees read after write consistency, but applies a | ||
/// 6x multiplier to your operation usage. | ||
/// </summary> | ||
public enum ReadConcern | ||
{ | ||
/// <summary> | ||
/// Balanced is the default read concern for the cache client. | ||
/// </summary> | ||
Balanced, | ||
/// <summary> | ||
/// Consistent read concern guarantees read after write consistency. | ||
/// </summary> | ||
Consistent | ||
} | ||
|
||
/// <summary> | ||
/// Extension methods for the ReadConcern enum. | ||
/// </summary> | ||
public static class ReadConcernExtensions | ||
{ | ||
/// <summary> | ||
/// Converts the read concern to a string value. | ||
/// </summary> | ||
/// <param name="readConcern">to convert to a string</param> | ||
/// <returns></returns> | ||
/// <exception cref="ArgumentOutOfRangeException">if given an unknown read concern</exception> | ||
public static string ToStringValue(this ReadConcern readConcern) | ||
{ | ||
return readConcern switch | ||
{ | ||
ReadConcern.Balanced => "balanced", | ||
ReadConcern.Consistent => "consistent", | ||
_ => throw new ArgumentOutOfRangeException() | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters