Skip to content

Commit

Permalink
Rename includeStateless to includeTransient in entity queries (#985)
Browse files Browse the repository at this point in the history
* rename includeStateless to includeTransient

* rename variable also
  • Loading branch information
sebastianburckhardt authored Oct 9, 2023
1 parent 42ab8c1 commit 25c0e76
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
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

0 comments on commit 25c0e76

Please sign in to comment.