sarthaksin1857 commented on code in PR #14966:
URL: https://github.com/apache/iceberg/pull/14966#discussion_r2701237402
##########
azure/src/main/java/org/apache/iceberg/azure/adlsv2/ADLSFileIO.java:
##########
@@ -70,6 +73,27 @@ public ADLSFileIO() {}
this.azureProperties = azureProperties;
}
+ /**
+ * Constructor with custom DataLakeFileSystemClient supplier.
+ *
+ * <p>Calling {@link ADLSFileIO#initialize(Map)} will overwrite the
properties and azureProperties
+ * set in this constructor, but the clientSupplier will continue to be used.
+ *
+ * <p>Unlike the no-arg constructor, this constructor initializes properties
and azureProperties
+ * immediately, allowing immediate use without calling {@link
ADLSFileIO#initialize(Map)}.
+ *
+ * <p>Note: The provided client will be used for all file system operations.
If your use case
+ * requires accessing multiple containers, ensure the client is configured
appropriately or use
+ * the default constructor with {@link ADLSFileIO#initialize(Map)}.
+ *
+ * @param clientSupplier client supplier
+ */
+ public ADLSFileIO(SerializableSupplier<DataLakeFileSystemClient>
clientSupplier) {
+ this.clientSupplier = clientSupplier;
+ this.properties = SerializableMap.copyOf(Maps.newHashMap());
Review Comment:
https://github.com/sarthaksin1857/iceberg/blob/345140e9f7d428fcc3b4fcc639a690084a698b76/aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java#L128-L141
This constructor for example does not follow the contract either. The
contract in my eyes is
1. If you use the no arg constructor, you have to call initialize before
using it
2. If you use a constructor which has arguments you do not need to call
initialize
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]