Skip to content

Commit

Permalink
Rename --host to --fireStoreHost (#29201)
Browse files Browse the repository at this point in the history
* Rename --host to --fireStoreHost
  • Loading branch information
Abacn authored Oct 31, 2023
1 parent 8648e58 commit 9a83620
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
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();
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

0 comments on commit 9a83620

Please sign in to comment.