Skip to content

Commit 4b24045

Browse files
authored
GCS client library migration in Java SDK - part 1 (#36876)
* Make a copy of GcsUtil.java as GcsUtilLegacy.java * Change references from GcsUtil to GcsUtilLegacy in GcsUtilLegacy.java * Change public apis in GcsUtil.java to call the GcsUtilLegacy.java * Add mocking GcsUtilLegacy for tests and remove unnecessary references of gcsio in GcsUtil * Possible breaking change: removed unused public functions. * Get rid of the last bit (read option) gcsio references in GcsUtil.java. * Route the code path of open reading files to include api count metric. * Spotless check * Remove BatchInterface and RewriteOp from GcsUtil.java. Simplify some functions. * Rename GcsUtilLegacy to GcsUtilV1 * Make GcsUtilV1 package private * Import ExperimentalOptions * Move GcsReadOptionsFactory from GcsUtilV1 to GcsOptions * Fix a failed test * Add comments to SupressWarnings * Fix test
1 parent 27ae93b commit 4b24045

File tree

6 files changed

+1700
-1233
lines changed

6 files changed

+1700
-1233
lines changed

sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/options/GcsOptions.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,24 @@ public interface GcsOptions extends ApplicationNameOptions, GcpOptions, Pipeline
4646

4747
void setGcsUtil(GcsUtil value);
4848

49+
class GcsReadOptionsFactory implements DefaultValueFactory<GoogleCloudStorageReadOptions> {
50+
@Override
51+
public GoogleCloudStorageReadOptions create(PipelineOptions options) {
52+
return GoogleCloudStorageReadOptions.DEFAULT;
53+
}
54+
}
55+
56+
/** @deprecated This option will be removed in a future release. */
4957
@JsonIgnore
5058
@Description(
5159
"The GoogleCloudStorageReadOptions instance that should be used to read from Google Cloud Storage.")
52-
@Default.InstanceFactory(GcsUtil.GcsReadOptionsFactory.class)
60+
@Default.InstanceFactory(GcsReadOptionsFactory.class)
5361
@Hidden
62+
@Deprecated
5463
GoogleCloudStorageReadOptions getGoogleCloudStorageReadOptions();
5564

65+
/** @deprecated This option will be removed in a future release. */
66+
@Deprecated
5667
void setGoogleCloudStorageReadOptions(GoogleCloudStorageReadOptions value);
5768

5869
/**

0 commit comments

Comments
 (0)