Skip to content

Commit

Permalink
add support for specialized purge interface DurableTask.Core.IOrchest…
Browse files Browse the repository at this point in the history
…rationServicePurgeClient (#167)
  • Loading branch information
sebastianburckhardt authored Jun 13, 2022
1 parent c8cc1ff commit e52e236
Showing 1 changed file with 14 additions and 4 deletions.
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

0 comments on commit e52e236

Please sign in to comment.