Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • ResourceManager - base class for resource management. Only one instance of resource manager is created per Solr node (CoreContainer)
    • DefaultResourceManager - default implementation.
  • ResourceManagerPoolFactory - base class for creating type-specific pool instances.
    • DefaultResourceManagerPoolFactory - default implementation, containing default registry of pool implementations (currently just cache → CacheManagerPool).
  • ResourceManagerPool - base class for managing components in a pool.
    • CacheManagerPool - pool implementation specific to cache resource management.
  • ChangeListener - listener interface for component limit changes. Pools report any changes to their managed components' limits via this interface.
  • ManagedComponent - interface for components to be managed
  • ManagedComponentId - hierarchical unique component ID
  • SolrResourceContext - component's context that helps to register and unregister the component from its pool(s)
  • ResourceManagerHandler ResourceManagerAPI - public v2 API for pool operations (CRUD) and resource component operations (RUD)

CacheManagerPool implementation

...

User-level APIs

Config files

The only change in configuration is a new optional section in ZK in /clusterprops.json/poolConfigs. This section contains a map of pre-defined pools and their initial limits and properties.instance of ResourceManager that is created and initialized uses the configuration in /resourceMgr/managerConfig.json. This contains the typical Solr plugin info, ie. implementation class and its initArgs.

Pool configurations are kept in ZK in /resourceMgr/poolConfigs.json. Changes made to this file via API are watched by all live nodes, and upon change each node refreshes its internal copy of the config and re-configures local pools to match the config.

Currently Currently the PR doesn't use any other configuration files or system properties. Also, the updates to the pool configuration are not persisted (or watched for) yet.

Remote API

Remote API

There's a new handler ResourceManagerHandler accessible v2 ResourceManagerAPI accessible at /admincluster/resources (v1 API only for now - I plan to add v2 API once the functionality stabilizes).

NOTE: Persisting the changes is not yet implemented in the PR. Also, the handler supports only local operations - it needs to be modified to watch the changes in the config file in ZK and modify local pools and resources accordingly.

for managing cluster-level aspects of the framework (such as pool configurations, their limits and parametersrs) and /node/resource for managing node-level parameters (such as directly modifying individual component's limits).

Changes to pool configurations are persisted in ZK . Also, each node watches the changes in this file and upon change it reloads the config and re-configures local pools to match the config - this may include removing, adding pools, changing their limits and parameters.

Per-node (component) operations that select named items Operations that select named items (pools or resources) all treat the name as a prefix, ie. the selected items are those that match the prefix provided as the name parameterprovided as the name parameter. This is required because of the quickly changing identifiers of the components.

The following operations are supported:

  • Pool operations
    • LIST - lists selected pools and their limits and parameters.STATUS - lists selected pools and their components, and current total resource consumption per pool.
    • CREATE - create a new pool, with the provided limits (limit.<name>=<value>) and parameters (param.<name>=<value>).
    • DELETE - delete an existing pool (and unregister its components)
    • SETLIMITS - set, modify or delete existing pool(s) limits
    • SETPARAMS - set, modify or delete existing pool(s) parameters
  • Resource Component operations
    • LIST - list components in specified pool(s) and their current resource limits
    • STATUS - list components in specified pool(s) and their current limits and their current monitored values
    • GETLIMITS - get the current limits of specified component(s)
    • SETLIMITS - set the current limits of specified component(s)
    • DELETE - unregister specified components from the pool(s) 

...