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

add multi instance query support logics #702

Merged
merged 6 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1923,13 +1923,7 @@ private static OrchestrationQueryResult ConvertFrom(DurableStatusQueryResult sta
results.Add(state);
}

cgillum marked this conversation as resolved.
Show resolved Hide resolved
var result = new OrchestrationQueryResult
{
OrchestrationState = results,
ContinuationToken = statusContext.ContinuationToken,
};

return result;
return new OrchestrationQueryResult(results, statusContext.ContinuationToken);
}

class PendingMessageBatch
Expand Down
8 changes: 3 additions & 5 deletions src/DurableTask.Core/Query/OrchestrationQuery.cs
Expand Up @@ -10,14 +10,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using System.Collections.Generic;

#nullable enable

namespace DurableTask.Core.Query
{
using System;
using System.Collections.Generic;

/// <summary>
/// Query condition for searching the status of orchestration instances.
/// </summary>
Expand Down
22 changes: 16 additions & 6 deletions src/DurableTask.Core/Query/OrchestrationQueryResult.cs
Expand Up @@ -11,25 +11,35 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System.Collections.Generic;

namespace DurableTask.Core.Query
{
using System.Collections.Generic;

/// <summary>
/// The status of all orchestration instances with paging for a given query.
/// </summary>
public class OrchestrationQueryResult
cgillum marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Gets or sets a collection of statuses of orchestration instances matching the query description.
/// Constructor of OrchestrationQueryResult Class.
/// </summary>
/// <param name="OrchestrationState">A collection of orchestration instance status values.</param>
/// <param name="ContinuationToken">A server-generated continuation token or <c>null</c> if there are no further continuations.</param>
public OrchestrationQueryResult(IReadOnlyCollection<OrchestrationState> OrchestrationState, string ContinuationToken)
cgillum marked this conversation as resolved.
Show resolved Hide resolved
{
this.OrchestrationState = OrchestrationState;
cgillum marked this conversation as resolved.
Show resolved Hide resolved
this.ContinuationToken = ContinuationToken;
}
/// <summary>
/// Gets a collection of statuses of orchestration instances matching the query description.
/// </summary>
/// <value>A collection of orchestration instance status values.</value>
public IEnumerable<OrchestrationState> OrchestrationState { get; set; }
public IReadOnlyCollection<OrchestrationState> OrchestrationState { get; }

/// <summary>
/// Gets or sets a token that can be used to resume the query with data not already returned by this query.
/// Gets token that can be used to resume the query with data not already returned by this query.
/// </summary>
/// <value>A server-generated continuation token or <c>null</c> if there are no further continuations.</value>
public string ContinuationToken { get; set; }
public string ContinuationToken { get; }
cgillum marked this conversation as resolved.
Show resolved Hide resolved
}
}