Samrat002 opened a new pull request, #28126:
URL: https://github.com/apache/flink/pull/28126
## What is the purpose of the change
This pull request cleans up null handling in the flink-s3-fs-native module
by adding proper preconditions for non-nullable constructor parameters,
annotating nullable fields explicitly, and replacing ad-hoc null && isEmpty()
checks with StringUtils.isNullOrWhitespaceOnly.
## Brief change log
- Replace Objects.requireNonNull with Preconditions.checkNotNull (Flink
convention) for all required constructor parameters in S3ClientProvider,
NativeS3FileSystem, and NativeS3OutputStream
- Remove @Nullable from encryptionConfig constructor parameters in
S3ClientProvider and NativeS3OutputStream; default the Builder field to
S3EncryptionConfig.none() so the contract is non-null end-to-end
- Remove dead null guards on s3Client and transferManager in
S3ClientProvider.closeAsync(), and on clientProvider in
NativeS3FileSystem.closeAsync().
- Replace manual `!= null && !isEmpty()` string checks in
S3ClientProvider.Builder with StringUtils.isNullOrWhitespaceOnly for
assumeRoleArn, assumeRoleExternalId, explicitRegion, and
credentialsProviderClasses
- Fix S3ClientProvider.Builder.assumeRoleSessionName() to drop its silent
null-guard (the config option has a default value, null was never a valid input)
- Fix the async S3AsyncClient builder to apply endpointOverride
conditionally, consistent with the sync S3Client builder
- Add @Nullable annotation to NativeS3FileSystemFactory.flinkConfig field
to make the deferred-initialization contract explicit
## Verifying this change
Existing tests cover the affected code paths:
- S3ClientProviderTest
- NativeS3FileSystemFactoryTest
- S3EncryptionConfigTest
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with
@Public(Evolving): no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: no
- The S3 file system connector: yes
Documentation
- Does this pull request introduce a new feature? no
---
Was generative AI tooling used to co-author this PR?
- No
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]