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 support for specialized purge interface #167

Merged
merged 1 commit into from
Jun 13, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ namespace DurableTask.Netherite
/// <summary>
/// Local partition of the distributed orchestration service.
/// </summary>
public class NetheriteOrchestrationService :
IOrchestrationService,
IOrchestrationServiceClient,
IOrchestrationServiceQueryClient,
public class NetheriteOrchestrationService :
DurableTask.Core.IOrchestrationService,
DurableTask.Core.IOrchestrationServiceClient,
DurableTask.Core.IOrchestrationServicePurgeClient,
DurableTask.Netherite.IOrchestrationServiceQueryClient,
TransportAbstraction.IHost,
IStorageProvider
{
Expand Down Expand Up @@ -707,6 +708,15 @@ async Task<int> IOrchestrationServiceQueryClient.PurgeInstanceHistoryAsync(DateT
async Task<InstanceQueryResult> IOrchestrationServiceQueryClient.QueryOrchestrationStatesAsync(InstanceQuery instanceQuery, int pageSize, string continuationToken, CancellationToken cancellationToken)
=> await (await this.GetClientAsync()).QueryOrchestrationStatesAsync(instanceQuery, pageSize, continuationToken, cancellationToken);

/// <inheritdoc />
async Task<PurgeResult> IOrchestrationServicePurgeClient.PurgeInstanceStateAsync(string instanceId)
=> new PurgeResult(await (await this.GetClientAsync()).DeleteAllDataForOrchestrationInstance(this.GetPartitionId(instanceId), instanceId));

/// <inheritdoc />
async Task<PurgeResult> IOrchestrationServicePurgeClient.PurgeInstanceStateAsync(PurgeInstanceFilter purgeInstanceFilter)
=> new PurgeResult(await (await this.GetClientAsync()).PurgeInstanceHistoryAsync(purgeInstanceFilter.CreatedTimeFrom, purgeInstanceFilter.CreatedTimeTo, purgeInstanceFilter.RuntimeStatus));


/******************************/
// Task orchestration methods
/******************************/
Expand Down