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 (seeContainerPluginsApi.editAPI
) allowing the creation of instances ofPlacementPlugin
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 Classes Modifier and Type Interface Description static class
PlacementPluginFactory.NoConfig
Useful type for plugins that don't use any configuration.
-
Field Summary
Fields Modifier and Type Field Description static String
PLUGIN_NAME
The key in the plugins registry under which this plugin and its configuration are defined.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
configure(T cfg)
Default implementation is a no-op.PlacementPlugin
createPluginInstance()
Returns an instance of the plugin that will be repeatedly (and concurrently) called to compute placement.default T
getConfig()
Return the configuration of the plugin.
-
-
-
Field Detail
-
PLUGIN_NAME
static final String PLUGIN_NAME
The key in the plugins registry under which this plugin and its configuration are defined.- See Also:
- Constant Field Values
-
-
Method Detail
-
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 void configure(T cfg)
Default implementation is a no-op. Override to provide meaningful behavior if needed.- Specified by:
configure
in interfaceConfigurablePlugin<T extends PlacementPluginConfig>
- Parameters:
cfg
- value deserialized from JSON, not null.
-
getConfig
default T getConfig()
Return the configuration of the plugin. Default implementation returns null.
-
-