-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 interfaces for direct path, and StreamingEngineClient #28835
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d399b66
add interfaces for direct path
m-trieu 6f9977e
address first round of cl comments
m-trieu 8c97941
Add/modify tests
m-trieu a5f874a
add budget behavior in GrpcDirectGetWorkStream
m-trieu 13b9249
address CL comments
m-trieu b6362e4
Address CL comments.
m-trieu 2d82662
Address CL comments
m-trieu 16253d0
use vendored google libs
m-trieu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...er/src/main/java/org/apache/beam/runners/dataflow/worker/windmill/WindmillConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.beam.runners.dataflow.worker.windmill; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import java.util.Optional; | ||
import java.util.function.Function; | ||
import org.apache.beam.runners.dataflow.worker.windmill.CloudWindmillServiceV1Alpha1Grpc.CloudWindmillServiceV1Alpha1Stub; | ||
import org.apache.beam.runners.dataflow.worker.windmill.WindmillEndpoints.Endpoint; | ||
import org.apache.beam.sdk.annotations.Internal; | ||
|
||
@AutoValue | ||
@Internal | ||
public abstract class WindmillConnection { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add Internal annotation here and all other public classes in files this PR covers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
public static WindmillConnection from( | ||
Endpoint windmillEndpoint, | ||
Function<Endpoint, CloudWindmillServiceV1Alpha1Stub> endpointToStubFn) { | ||
WindmillConnection.Builder windmillWorkerConnection = WindmillConnection.builder(); | ||
|
||
windmillEndpoint.workerToken().ifPresent(windmillWorkerConnection::setBackendWorkerToken); | ||
windmillWorkerConnection.setStub(endpointToStubFn.apply(windmillEndpoint)); | ||
|
||
return windmillWorkerConnection.build(); | ||
} | ||
|
||
public static Builder builder() { | ||
return new AutoValue_WindmillConnection.Builder(); | ||
} | ||
|
||
public abstract Optional<String> backendWorkerToken(); | ||
|
||
public abstract CloudWindmillServiceV1Alpha1Stub stub(); | ||
|
||
@AutoValue.Builder | ||
abstract static class Builder { | ||
abstract Builder setBackendWorkerToken(String backendWorkerToken); | ||
|
||
abstract Builder setStub(CloudWindmillServiceV1Alpha1Stub stub); | ||
|
||
abstract WindmillConnection build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this class? It seems like we can just have a map from Endpoint to streams based upon the endpoint with a shared stub without needing to keep this object around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will need it if we want to use the backend worker tokens approach.