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 Classes
    Modifier and Type
    Interface
    Description
    static class 
    Useful type for plugins that don't use any configuration.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The key in the plugins registry under which this plugin and its configuration are defined.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    configure(T cfg)
    Default implementation is a no-op.
    Returns an instance of the plugin that will be repeatedly (and concurrently) called to compute placement.
    default T
    Return the configuration of the plugin.
  • Field Details

    • PLUGIN_NAME

      static final String 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 void configure(T cfg)
      Default implementation is a no-op. Override to provide meaningful behavior if needed.
      Specified by:
      configure in interface ConfigurablePlugin<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.