Skip to content
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

Rename includeStateless to includeTransient in entity queries #985

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async ValueTask<List<EntityMetadata>> ConvertResultsAsync(IEnumerable<Orchestrat
entityResult = new List<EntityMetadata>();
foreach (OrchestrationState entry in states)
{
EntityMetadata? entityMetadata = await this.GetEntityMetadataAsync(entry, filter.IncludeStateless, filter.IncludeState);
EntityMetadata? entityMetadata = await this.GetEntityMetadataAsync(entry, filter.IncludeTransient, filter.IncludeState);
if (entityMetadata.HasValue)
{
entityResult.Add(entityMetadata.Value);
Expand Down Expand Up @@ -200,7 +200,7 @@ bool OrchestrationIsRunning(OrchestrationStatus? status)
};
}

async ValueTask<EntityMetadata?> GetEntityMetadataAsync(OrchestrationState? state, bool includeStateless, bool includeState)
async ValueTask<EntityMetadata?> GetEntityMetadataAsync(OrchestrationState? state, bool includeTransient, bool includeState)
{
if (state == null)
{
Expand All @@ -209,7 +209,7 @@ bool OrchestrationIsRunning(OrchestrationStatus? status)

if (!includeState)
{
if (!includeStateless)
if (!includeTransient)
{
// it is possible that this entity was logically deleted even though its orchestration was not purged yet.
// we can check this efficiently (i.e. without deserializing anything) by looking at just the custom status
Expand Down Expand Up @@ -247,7 +247,7 @@ bool OrchestrationIsRunning(OrchestrationStatus? status)
string? serializedEntityState = ClientEntityHelpers.GetEntityState(serializedSchedulerState);

// return the result to the user
if (!includeStateless && serializedEntityState == null)
if (!includeTransient && serializedEntityState == null)
{
return null;
}
Expand Down
13 changes: 7 additions & 6 deletions src/DurableTask.Core/Entities/EntityBackendQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,15 @@ public struct EntityQuery
public bool IncludeState { get; set; }

/// <summary>
/// Gets a value indicating whether to include metadata about entities that have no user-defined state.
/// Gets a value indicating whether to include metadata about transient entities.
/// </summary>
/// <remarks> Stateless entities occur when the storage provider is tracking metadata about an entity for synchronization purposes
/// 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> Transient entities are entities that do not have an application-defined state, but for which the storage provider is
/// tracking metadata for synchronization purposes.
/// For example, a transient entity may be observed when the entity is in the process of being created or deleted, or
/// when the entity has been locked by a critical section. By default, transient entities are not included in queries since they are
/// considered to "not exist" from the perspective of the user application.
/// </remarks>
public bool IncludeStateless { get; set; }
public bool IncludeTransient { get; set; }

/// <summary>
/// Gets or sets the desired size of each page to return.
Expand Down