Slackbot
02/01/2024, 11:28 AMRohan Garg
02/01/2024, 3:48 PMAzureCloudBlobIterableFactory is currently created via guice (through FactoryModuleBuilder https://google.github.io/guice/api-docs/3.0/javadoc/com/google/inject/assistedinject/FactoryModuleBuilder.html)Rohan Garg
02/01/2024, 3:50 PMAzureCloudBlobIterableFactory ). If you see, the create method contains all the parameters needed to construct AzureCloudBlobIterable - so the automatically created factory just uses the parameters to create an AzureCloudBlobIterable object.
If you don't want to use guice, you can create a factory manually which just creates new AzureCloudBlobIterable objects given the create parametersRohan Garg
02/01/2024, 3:50 PMFabrice Baranski
02/01/2024, 4:13 PMRohan Garg
02/01/2024, 6:43 PMclass MyAzureCloudBlobIterableFactory {
AzureCloudBlobIteratorFactory azureCloudBlobIteratorFactory; // have this as a member variable in the factory
AzureCloudBlobIterable create(Iterable<URI> prefixes, int maxListingLength, AzureStorage azureStorage) {
return new AzureCloudBlobIterable(azureCloudBlobIteratorFactory, prefixes, maxListingLength, azureStorage);
}
}
guice is also doing something like this implicitly. does that make sense?Fabrice Baranski
02/02/2024, 12:31 PM