<commit_before># Modular Load Manager
The modular load manager, implemented in `ModularLoadManagerImpl`, is a flexible alternative to the previously
implemented load manager `SimpleLoadManagerImpl` which attempts to simplify how load is manager while also providing
abstractions so that complex load management strategies may be implemented.

## Usage
To use the modular load manager, change

`loadManagerClassName=com.yahoo.broker.loadbalance.impl.SimpleLoadManagerImpl`

in `broker.conf` to

`loadManagerClassName=com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`

Alternatively, the load manager may also be changed dynamically via the `pulsar-admin` tool as follows:

`pulsar-admin update-dynamic-config --config loadManagerClassName --value
com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`

The admin tool may also be used to change back to `com.yahoo.broker.loadbalance.impl.SimpleLoadManagerImpl`. In either
case, any mistake in specifying the load manager will cause Pulsar to default to `SimpleLoadManagerImpl`.

## Verification

There are a few different ways to determine which load manager is being used:

1. Run `pulsar-admin brokers get-all-dynamic-config` and examine the `loadManagerClassName` element:

```
$ ./pulsar-admin brokers get-all-dynamic-config
{
  "loadManagerClassName" : "com.yahoo.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl"
}
```

If there is no `loadManagerClassName` element, then the default load manager (`com.yahoo.broker.loadbalance.impl.SimpleLoadManagerImpl`)
is being used.

2. Look at a load report in ZooKeeper

With `com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`, the load report in `/loadbalance/brokers/...`
will have many differences. E.g., the `systemResourceUsage` subelements (`bandwidthIn`, `bandwidthOut`, ...) are now all at the top-level.
Here is an example load report from `com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`:

```
ndwidthIn": {
        "limit": 10240000.0,
        "usage": 4.256510416666667
    },
    "bandwidthOut": {
        "limit": 10240000.0,
        "usage": 5.287239583333333
    },
    "bundles": [],
    "cpu": {
        "limit": 2400.0,
        "usage": 5.7353247655435915
    },
    "directMemory": {<commit_msg>Fix typo in documentation page for ModularLoadManagerImpl (#413)<commit_after># Modular Load Manager
The modular load manager, implemented in `ModularLoadManagerImpl`, is a flexible alternative to the previously
implemented load manager `SimpleLoadManagerImpl` which attempts to simplify how load is manager while also providing
abstractions so that complex load management strategies may be implemented.

## Usage
To use the modular load manager, change

`loadManagerClassName=com.yahoo.broker.loadbalance.impl.SimpleLoadManagerImpl`

in `broker.conf` to

`loadManagerClassName=com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`

Alternatively, the load manager may also be changed dynamically via the `pulsar-admin` tool as follows:

`pulsar-admin update-dynamic-config --config loadManagerClassName --value
com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`

The admin tool may also be used to change back to `com.yahoo.broker.loadbalance.impl.SimpleLoadManagerImpl`. In either
case, any mistake in specifying the load manager will cause Pulsar to default to `SimpleLoadManagerImpl`.

## Verification

There are a few different ways to determine which load manager is being used:

1. Run `pulsar-admin brokers get-all-dynamic-config` and examine the `loadManagerClassName` element:

```
$ ./pulsar-admin brokers get-all-dynamic-config
{
  "loadManagerClassName" : "com.yahoo.pulsar.broker.loadbalance.impl.ModularLoadManagerImpl"
}
```

If there is no `loadManagerClassName` element, then the default load manager (`com.yahoo.broker.loadbalance.impl.SimpleLoadManagerImpl`)
is being used.

2. Look at a load report in ZooKeeper

With `com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`, the load report in `/loadbalance/brokers/...`
will have many differences. E.g., the `systemResourceUsage` subelements (`bandwidthIn`, `bandwidthOut`, ...) are now all at the top-level.
Here is an example load report from `com.yahoo.broker.loadbalance.impl.ModularLoadManagerImpl`:

```
{
    "bandwidthIn": {
        "limit": 10240000.0,
        "usage": 4.256510416666667
    },
    "bandwidthOut": {
        "limit": 10240000.0,
        "usage": 5.287239583333333
    },
    "bundles": [],
    "cpu": {
        "limit": 2400.0,
        "usage": 5.7353247655435915
    },
    "directMemory": {
{'fraction_non_alphanumeric': 0.09648351648351648, 'fraction_numerical': 0.033186813186813185, 'mean_word_length': 4.556776556776557, 'pattern_counts': {'":': 22, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4792498', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1301, 'n_words': 421}