Interface StorageProviderFactory
public interface StorageProviderFactory
Factory for creating
StorageProvider instances.
Two abstract methods: create(Settings) for cluster-settings-only construction, and
createTrackingConsumedKeys(Settings, Map) for per-query construction paired with the
keys this factory claims from the configuration map. Both must be implemented explicitly so a
factory cannot silently drop per-query configuration keys.
Two static helpers cover the common shapes:
noConfigKeys(Supplier)— for factories that recognise no per-query keys today. Forwards to the supplier in both methods; any non-empty config map is rejected by the generic validator at planning time as "unknown options".of(Supplier, Function, Function)— for factories that resolve a typedConfigurationfrom the map and construct a provider from it.
-
Method Summary
Modifier and TypeMethodDescriptiondefault StorageProviderPer-query overload that takes a configuration map.createTrackingConsumedKeys(Settings settings, Map<String, Object> config) Per-query overload paired with the keys consumed fromconfig.static <P extends StorageProvider>
StorageProviderFactorynoConfigKeys(Supplier<P> provider) Builds aStorageProviderFactoryfor providers that have no per-query configuration keys.static <C,P extends StorageProvider>
StorageProviderFactoryof(Supplier<P> defaultProvider, Function<Map<String, Object>, Configured<C>> configFactory, Function<C, P> providerCtor) Builds aStorageProviderFactoryfor the common pattern: the no-config path constructs a provider from a supplier (e.g.
-
Method Details
-
create
-
create
Per-query overload that takes a configuration map. Default delegates tocreateTrackingConsumedKeys(Settings, Map)and discards the consumed-keys set; use this overload when the caller does not need to validate against the consumed keys. -
createTrackingConsumedKeys
Configured<StorageProvider> createTrackingConsumedKeys(Settings settings, Map<String, Object> config) Per-query overload paired with the keys consumed fromconfig.Required override. Every factory must explicitly declare which per-query keys it claims, even if the answer is "none" (use
noConfigKeys(Supplier)for that case). The consumed-keys set is required byConfigKeyValidatorfor unknown-key rejection at planning time; a silent default would let typo'd configurations slip through. -
noConfigKeys
Builds aStorageProviderFactoryfor providers that have no per-query configuration keys. Bothcreate(Settings)andcreateTrackingConsumedKeys(Settings, Map)delegate toprovider; the tracking variant returnsConfigured.empty(T)soConfigKeyValidatorrejects any non-empty config map at planning time. -
of
static <C,P extends StorageProvider> StorageProviderFactory of(Supplier<P> defaultProvider, Function<Map<String, Object>, Configured<C>> configFactory, Function<C, P> providerCtor) Builds aStorageProviderFactoryfor the common pattern: the no-config path constructs a provider from a supplier (e.g.() -> new S3StorageProvider(null)); the per-query path resolves a configuration viaconfigFactory, threads its consumed-keys set through, and constructs a provider from the resolved configuration viaproviderCtor. Replaces the anonymous-class boilerplate that otherwise repeats per scheme.
-