Interface PlacementPluginFactory<T extends PlacementPluginConfig>
- All Superinterfaces:
ConfigurablePlugin<T>
- All Known Implementing Classes:
AffinityPlacementFactory,DelegatingPlacementPluginFactory,MinimizeCoresPlacementFactory,RandomPlacementFactory,SimplePlacementFactory
public interface PlacementPluginFactory<T extends PlacementPluginConfig>
extends ConfigurablePlugin<T>
Factory implemented by client code and configured in container plugins (see
ContainerPluginsApi.editAPI) allowing the creation of instances of
PlacementPlugin to be used for replica placement computation.
Note: configurable factory implementations should also implement ConfigurablePlugin with the appropriate configuration bean type.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classUseful type for plugins that don't use any configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key in the plugins registry under which this plugin and its configuration are defined. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidDefault implementation is a no-op.Returns an instance of the plugin that will be repeatedly (and concurrently) called to compute placement.default TReturn the configuration of the plugin.
-
Field Details
-
PLUGIN_NAME
The key in the plugins registry under which this plugin and its configuration are defined.- See Also:
-
-
Method Details
-
createPluginInstance
PlacementPlugin createPluginInstance()Returns an instance of the plugin that will be repeatedly (and concurrently) called to compute placement. Multiple instances of a plugin can be used in parallel (for example if configuration has to change, but plugin instances with the previous configuration are still being used). -
configure
Default implementation is a no-op. Override to provide meaningful behavior if needed.- Specified by:
configurein interfaceConfigurablePlugin<T extends PlacementPluginConfig>- Parameters:
cfg- value deserialized from JSON, not null.
-
getConfig
Return the configuration of the plugin. Default implementation returns null.
-