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

Rename --host to --fireStoreHost #29201

Merged
merged 2 commits into from
Oct 31, 2023
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ should handle this. ([#25252](https://github.com/apache/beam/issues/25252)).
classes finally moved to `extensions/avro`. In case if it's still required to use `AvroCoder` for `CounterMark`, then,
as a workaround, a copy of "old" `CountingSource` class should be placed into a project code and used directly
([#25252](https://github.com/apache/beam/issues/25252)).
* Renamed `host` to `firestoreHost` in `FirestoreOptions` to avoid potential conflict of command line arguments (Java) ([#29201](https://github.com/apache/beam/pull/29201)).

## Deprecations

Expand Down
8 changes: 4 additions & 4 deletions sdks/java/io/google-cloud-platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ task integrationTest(type: Test, dependsOn: processTestResources) {
def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing'
def gcpTempRoot = project.findProperty('gcpTempRoot') ?: 'gs://temp-storage-for-end-to-end-tests'
def firestoreDb = project.findProperty('firestoreDb') ?: 'firestoredb'
def host = project.findProperty('host') ?: 'batch-firestore.googleapis.com:443'
def firestoreHost = project.findProperty('firestoreHost') ?: 'batch-firestore.googleapis.com:443'
systemProperty "beamTestPipelineOptions", JsonOutput.toJson([
"--runner=DirectRunner",
"--project=${gcpProject}",
"--tempRoot=${gcpTempRoot}",
"--firestoreDb=${firestoreDb}",
"--host=${host}",
"--firestoreHost=${firestoreHost}",
])

// Disable Gradle cache: these ITs interact with live service that should always be considered "out of date"
Expand Down Expand Up @@ -220,14 +220,14 @@ task integrationTestKms(type: Test) {
def gcpTempRoot = project.findProperty('gcpTempRootKms') ?: 'gs://temp-storage-for-end-to-end-tests-cmek'
def dataflowKmsKey = project.findProperty('dataflowKmsKey') ?: "projects/apache-beam-testing/locations/global/keyRings/beam-it/cryptoKeys/test"
def firestoreDb = project.findProperty('firestoreDb') ?: 'firestoredb'
def host = project.findProperty('host') ?: 'batch-firestore.googleapis.com:443'
def firestoreHost = project.findProperty('firestoreHost') ?: 'batch-firestore.googleapis.com:443'
systemProperty "beamTestPipelineOptions", JsonOutput.toJson([
"--runner=DirectRunner",
"--project=${gcpProject}",
"--tempRoot=${gcpTempRoot}",
"--dataflowKmsKey=${dataflowKmsKey}",
"--firestoreDb=${firestoreDb}",
"--host=${host}",
"--firestoreHost=${firestoreHost}",
])

// Disable Gradle cache: these ITs interact with live service that should always be considered "out of date"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public interface FirestoreOptions extends PipelineOptions {
*/
@Description("Firestore endpoint (host and port)")
@Default.String("batch-firestore.googleapis.com:443")
String getHost();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this ok to do these breaking changes? Do we need to mention this in CHANGES.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah let me add another item to CHANGES.md

String getFirestoreHost();

/**
* Define a host port pair to allow connecting to a Cloud Firestore instead of the default live
* service.
*
* @param host the host and port to connect to
*/
void setHost(String host);
void setFirestoreHost(String host);
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ FirestoreStub getFirestoreStub(PipelineOptions options) {
GcpOptions gcpOptions = options.as(GcpOptions.class);
builder
.setCredentialsProvider(FixedCredentialsProvider.create(gcpOptions.getGcpCredential()))
.setEndpoint(firestoreOptions.getHost());
.setEndpoint(firestoreOptions.getFirestoreHost());
headers.put(
"x-goog-request-params",
"project_id="
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public FirestoreTestingHelper(CleanupMode cleanupMode) {
.setCredentials(gcpOptions.getGcpCredential())
.setProjectId(gcpOptions.getProject())
.setDatabaseId(firestoreBeamOptions.getFirestoreDb())
.setHost(firestoreBeamOptions.getHost())
.setHost(firestoreBeamOptions.getFirestoreHost())
.build();
fs = firestoreOptions.getService();
rpc = (FirestoreRpc) firestoreOptions.getRpc();
Expand Down
Loading