RebalanceOperation (Apache Geode 1.12.8)
Date: 2022-01-10

org.apache.geode.management.operation

## Class RebalanceOperation

- java.lang.Object
- - org.apache.geode.management.operation.RebalanceOperation

- All Implemented Interfaces:
    ClusterManagementOperation<RebalanceResult>

      @Experimental
      public class RebalanceOperation
      extends Object
      implements ClusterManagementOperation<RebalanceResult>

  Defines a distributed system request to optimize bucket allocation across members.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `REBALANCE_ENDPOINT` see `getEndpoint()`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RebalanceOperation()` by default, requests all partitioned regions to be rebalanced
    `RebalanceOperation(RebalanceOperation other)` copy constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getEndpoint()` must match the REST controller's RequestMapping
    `List<String>` | `getExcludeRegions()` Returns the list of regions NOT to be rebalanced (iff `getIncludeRegions()` is empty)
    `List<String>` | `getIncludeRegions()` Returns the list of regions to be rebalanced (or an empty list for all-except-excluded)
    `boolean` | `isSimulate()` Returns true if a "dry run" only is requested
    `void` | `setExcludeRegions(List<String> excludeRegions)` excludes specific regions from the rebalance, if `getIncludeRegions()` is empty, otherwise has no effect default: no regions are excluded
    `void` | `setIncludeRegions(List<String> includeRegions)` requests rebalance of the specified region(s) only.
    `void` | `setSimulate(boolean simulate)` true requests a "dry run" (no actual buckets will be moved) default is false

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### REBALANCE_ENDPOINT

          public static final String REBALANCE_ENDPOINT

      see `getEndpoint()`
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RebalanceOperation

          public RebalanceOperation()

      by default, requests all partitioned regions to be rebalanced

    - #### RebalanceOperation

          public RebalanceOperation(RebalanceOperation other)

      copy constructor

  - ### Method Detail

    - #### isSimulate

          public boolean isSimulate()

      Returns true if a "dry run" only is requested

    - #### setSimulate

          public void setSimulate(boolean simulate)

      true requests a "dry run" (no actual buckets will be moved) default is false

    - #### getIncludeRegions

          public List<String> getIncludeRegions()

      Returns the list of regions to be rebalanced (or an empty list for all-except-excluded)

    - #### setIncludeRegions

          public void setIncludeRegions(List<String> includeRegions)

      requests rebalance of the specified region(s) only. When at least one region is specified, this takes precedence over any excluded regions.

    - #### getExcludeRegions

          public List<String> getExcludeRegions()

      Returns the list of regions NOT to be rebalanced (iff `getIncludeRegions()` is empty)

    - #### setExcludeRegions

          public void setExcludeRegions(List<String> excludeRegions)

      excludes specific regions from the rebalance, if `getIncludeRegions()` is empty, otherwise has no effect default: no regions are excluded

    - #### getEndpoint

          public String getEndpoint()

      Description copied from interface: `ClusterManagementOperation`
      must match the REST controller's RequestMapping
      Specified by:
        `getEndpoint` in interface `ClusterManagementOperation<RebalanceResult>`
      Returns:
        the portion after /management/v1, e.g. /operations/name