Skip to content

Rename pipeline status methods for clarity and consistency #1018

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions service/Abstractions/Pipeline/IPipelineOrchestrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ public interface IPipelineOrchestrator
Task RunPipelineAsync(DataPipeline pipeline, CancellationToken cancellationToken = default);

/// <summary>
/// Fetch the pipeline status from storage
/// Get pipeline from storage
/// </summary>
/// <param name="index">Index where memory is stored</param>
/// <param name="documentId">Id of the document and pipeline execution instance</param>
/// <param name="cancellationToken">Async task cancellation token</param>
/// <returns>Pipeline status if available</returns>
Task<DataPipeline?> ReadPipelineStatusAsync(string index, string documentId, CancellationToken cancellationToken = default);
/// <returns>Pipeline if available</returns>
Task<DataPipeline?> GetPipelineAsync(string index, string documentId, CancellationToken cancellationToken = default);

/// <summary>
/// Fetch the pipeline status from storage
/// Get pipeline status from storage
/// </summary>
/// <param name="index">Index where memory is stored</param>
/// <param name="documentId">Id of the document and pipeline execution instance</param>
/// <param name="cancellationToken">Async task cancellation token</param>
/// <returns>Pipeline status if available</returns>
Task<DataPipelineStatus?> ReadPipelineSummaryAsync(string index, string documentId, CancellationToken cancellationToken = default);
Task<DataPipelineStatus?> GetPipelineStatusAsync(string index, string documentId, CancellationToken cancellationToken = default);

/// <summary>
/// Check if a document ID exists in a user memory and is ready for usage.
Expand Down
3 changes: 1 addition & 2 deletions service/Core/MemoryServerless.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ public async Task<bool> IsDocumentReadyAsync(
index = IndexName.CleanName(index, this._defaultIndexName);
try
{
DataPipeline? pipeline = await this._orchestrator.ReadPipelineStatusAsync(index: index, documentId, cancellationToken).ConfigureAwait(false);
return pipeline?.ToDataPipelineStatus();
return await this._orchestrator.GetPipelineStatusAsync(index: index, documentId, cancellationToken).ConfigureAwait(false); ;
}
catch (PipelineNotFoundException)
{
Expand Down
2 changes: 1 addition & 1 deletion service/Core/MemoryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public Task<bool> IsDocumentReadyAsync(
CancellationToken cancellationToken = default)
{
index = IndexName.CleanName(index, this._defaultIndexName);
return this._orchestrator.ReadPipelineSummaryAsync(index: index, documentId, cancellationToken);
return this._orchestrator.GetPipelineStatusAsync(index: index, documentId, cancellationToken);
}

/// <inheritdoc />
Expand Down
10 changes: 5 additions & 5 deletions service/Core/Pipeline/BaseOrchestrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public DataPipeline PrepareNewDocumentUpload(
}

///<inheritdoc />
public async Task<DataPipeline?> ReadPipelineStatusAsync(string index, string documentId, CancellationToken cancellationToken = default)
public async Task<DataPipeline?> GetPipelineAsync(string index, string documentId, CancellationToken cancellationToken = default)
{
index = IndexName.CleanName(index, this._defaultIndexName);

Expand Down Expand Up @@ -193,13 +193,13 @@ public DataPipeline PrepareNewDocumentUpload(
}

///<inheritdoc />
public async Task<DataPipelineStatus?> ReadPipelineSummaryAsync(string index, string documentId, CancellationToken cancellationToken = default)
public async Task<DataPipelineStatus?> GetPipelineStatusAsync(string index, string documentId, CancellationToken cancellationToken = default)
{
index = IndexName.CleanName(index, this._defaultIndexName);

try
{
DataPipeline? pipeline = await this.ReadPipelineStatusAsync(index: index, documentId: documentId, cancellationToken).ConfigureAwait(false);
DataPipeline? pipeline = await this.GetPipelineAsync(index: index, documentId: documentId, cancellationToken).ConfigureAwait(false);
return pipeline?.ToDataPipelineStatus();
}
catch (PipelineNotFoundException)
Expand All @@ -216,7 +216,7 @@ public async Task<bool> IsDocumentReadyAsync(string index, string documentId, Ca
try
{
this.Log.LogDebug("Checking if document {Id} on index {Index} is ready", documentId, index);
DataPipeline? pipeline = await this.ReadPipelineStatusAsync(index: index, documentId, cancellationToken).ConfigureAwait(false);
DataPipeline? pipeline = await this.GetPipelineAsync(index: index, documentId, cancellationToken).ConfigureAwait(false);

if (pipeline == null)
{
Expand Down Expand Up @@ -396,7 +396,7 @@ protected async Task UploadFilesAsync(DataPipeline currentPipeline, Cancellation
DataPipeline? previousPipeline;
try
{
previousPipeline = await this.ReadPipelineStatusAsync(currentPipeline.Index, currentPipeline.DocumentId, cancellationToken).ConfigureAwait(false);
previousPipeline = await this.GetPipelineAsync(currentPipeline.Index, currentPipeline.DocumentId, cancellationToken).ConfigureAwait(false);
}
catch (PipelineNotFoundException)
{
Expand Down
2 changes: 1 addition & 1 deletion service/Core/Pipeline/DistributedPipelineOrchestrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public override async Task AddHandlerAsync(
DataPipeline? pipeline;
try
{
pipeline = await this.ReadPipelineStatusAsync(pipelinePointer.Index, pipelinePointer.DocumentId, cancellationToken).ConfigureAwait(false);
pipeline = await this.GetPipelineAsync(pipelinePointer.Index, pipelinePointer.DocumentId, cancellationToken).ConfigureAwait(false);
}
catch (PipelineNotFoundException)
{
Expand Down