-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise queries #204
Revise queries #204
Conversation
…edStartTime parameter
…ything should be cleaned)
…es to entity metadata
…es what page size is convenient)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some warnings to address due to the struct to class change.
/// even though the entity does not "logically" exist, in the sense that it has no application-defined state. | ||
/// Stateless entities are usually transient. For example, they may be in the process of being created or deleted, or they may have been locked by a critical section. | ||
/// </remarks> | ||
public bool IncludeStateless { get; init; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having this in addition to IncludeState
does not look the most user friendly. Maybe an enum to combine the two bools would work better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure that I prefer an enum since the two are logically independent (all four combinations are possible), and one of them is going to be relevant for most queries (IncludeState) while the other is an obscure feature likely to never be touched by most users (IncludeStateless).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have renamed IncludeStateless to IncludeTransient as discussed.
|
||
/// <summary> | ||
/// Gets a value indicating whether to release orphaned locks or not. | ||
/// Gets a value indicating whether to release orphaned locks or not. Defaults to true. | ||
/// </summary> | ||
/// <remarks> | ||
/// Locks are considered orphaned, and are released, and if the orchestration that holds them is not in state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Locks are considered orphaned, and are released, and if the orchestration that holds them is not in state | |
/// Locks are considered orphaned, and are released, if the orchestration that holds them is not in state |
@@ -6,29 +6,29 @@ namespace Microsoft.DurableTask.Client.Entities; | |||
/// <summary> | |||
/// Request struct for <see cref="DurableEntityClient.CleanEntityStorageAsync"/>. | |||
/// </summary> | |||
public readonly record struct CleanEntityStorageRequest | |||
public record CleanEntityStorageRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a big fan of changing to a class here, but not sure what a good alternative would be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I agree. I couldn't figure out how to get the defaults specified without turning it into a class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose I could define the struct without defaults and then define a static member Default
which gets used as the default for the call. Let me try that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a static Default
factory method as a way to specify the defaults and still keep this a struct.
/// Gets the default request parameters. The default is meant to represent | ||
/// "maximal" cleaning that is safe to call at all times. | ||
/// </summary> | ||
public static CleanEntityStorageRequest Default => new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also add a parameterless constructor and set all the bool properties to true
there. This doesn't change default
- but just an idea for you to consider.
…-defaults # Conflicts: # src/Worker/Core/Shims/TaskEntityShim.cs
Several changes (they are separated by commits):