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

Progress Bar API Changes. #18953

Merged
merged 2 commits into from
Nov 4, 2022
Merged
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
43 changes: 43 additions & 0 deletions airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2266,6 +2266,26 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/InternalOperationResult"
/v1/attempt/save_stats:
post:
tags:
- attempt
- internal
summary: For worker to set sync stats of a running attempt.
operationId: saveStats
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/SaveStatsRequestBody"
required: true
responses:
"200":
description: Successful Operation
content:
application/json:
schema:
$ref: "#/components/schemas/InternalOperationResult"

components:
securitySchemes:
Expand Down Expand Up @@ -4049,6 +4069,12 @@ components:
recordsCommitted:
type: integer
format: int64
estimatedRecords:
type: integer
format: int64
estimatedBytes:
type: integer
format: int64
AttemptStreamStats:
type: object
required:
Expand Down Expand Up @@ -4892,6 +4918,23 @@ components:
processingTaskQueue:
type: string
default: ""
SaveStatsRequestBody:
type: object
required:
- jobId
- attemptNumber
- stats
properties:
jobId:
$ref: "#/components/schemas/JobId"
attemptNumber:
$ref: "#/components/schemas/AttemptNumber"
stats:
$ref: "#/components/schemas/AttemptStats"
streamStats:
type: array
items:
$ref: "#/components/schemas/AttemptStreamStats"
InternalOperationResult:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

import io.airbyte.api.generated.AttemptApi;
import io.airbyte.api.model.generated.InternalOperationResult;
import io.airbyte.api.model.generated.SaveStatsRequestBody;
import io.airbyte.api.model.generated.SetWorkflowInAttemptRequestBody;
import io.airbyte.server.handlers.AttemptHandler;
import javax.ws.rs.Path;

@Path("/v1/attempt/set_workflow_in_attempt")
@Path("/v1/attempt/")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made this a less restrictive path so this will continue to override 2 different routes.

This works since the path, while less restrictive, is still more restrictive than the general V1 path in the ConfigurationApi class.

public class AttemptApiController implements AttemptApi {

private final AttemptHandler attemptHandler;
Expand All @@ -19,6 +20,11 @@ public AttemptApiController(final AttemptHandler attemptHandler) {
this.attemptHandler = attemptHandler;
}

@Override
public InternalOperationResult saveStats(final SaveStatsRequestBody saveStatsRequestBody) {
throw new UnsupportedOperationException();
}

@Override
public InternalOperationResult setWorkflowInAttempt(final SetWorkflowInAttemptRequestBody requestBody) {
return ConfigurationApi.execute(() -> attemptHandler.setWorkflowInAttempt(requestBody));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import io.airbyte.api.model.generated.PrivateDestinationDefinitionReadList;
import io.airbyte.api.model.generated.PrivateSourceDefinitionRead;
import io.airbyte.api.model.generated.PrivateSourceDefinitionReadList;
import io.airbyte.api.model.generated.SaveStatsRequestBody;
import io.airbyte.api.model.generated.SetInstancewideDestinationOauthParamsRequestBody;
import io.airbyte.api.model.generated.SetInstancewideSourceOauthParamsRequestBody;
import io.airbyte.api.model.generated.SetWorkflowInAttemptRequestBody;
Expand Down Expand Up @@ -362,6 +363,11 @@ public void revokeSourceDefinitionFromWorkspace(final SourceDefinitionIdWithWork
});
}

@Override
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: could you add a comment about where the implementation lives?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes! will do that real quick in a follow up

public InternalOperationResult saveStats(SaveStatsRequestBody saveStatsRequestBody) {
throw new UnsupportedOperationException();
}

// SOURCE SPECIFICATION

@Override
Expand Down
Loading