RebalanceOperation (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache.control, interface: RebalanceOperation

Package org.apache.geode.cache.control

# Interface RebalanceOperation

public interface RebalanceOperation
Operation for rebalancing resources used by the `Cache`.

Since:
  GemFire 6.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `cancel()`
  Cancels this rebalance operation.
  `RebalanceResults`
  `getResults()`
  Wait for this operation to complete and return the results.
  `RebalanceResults`
  `getResults(long timeout, TimeUnit unit)`
  Wait for this operation to complete and return the results.
  `boolean`
  `isCancelled()`
  Returns true if this operation was cancelled before it completed.
  `boolean`
  `isDone()`
  Returns true if this operation completed.

- ## Method Details

  - ### isCancelled

    boolean isCancelled()
    Returns true if this operation was cancelled before it completed.
    Returns:
      whether this operation was cancelled before it completed

  - ### isDone

    boolean isDone()
    Returns true if this operation completed.
    Returns:
      whether this operation completed

  - ### cancel

    boolean cancel()
    Cancels this rebalance operation. The rebalance operation will find a safe point and then stop.
    Returns:
      false if this operation could not be cancelled, typically because it has already completed; true otherwise

  - ### getResults

    RebalanceResults getResults() throws CancellationException, InterruptedException
    Wait for this operation to complete and return the results.
    Returns:
      the rebalance results
    Throws:
      `CancellationException` - if the operation was cancelled
      `InterruptedException` - if the wait was interrupted

  - ### getResults

    RebalanceResults getResults(long timeout, TimeUnit unit) throws CancellationException, TimeoutException, InterruptedException
    Wait for this operation to complete and return the results.
    Parameters:
      `timeout` - the maximum time to wait
      `unit` - the time unit of the timeout argument
    Returns:
      the rebalance results
    Throws:
      `CancellationException` - if the operation was cancelled
      `TimeoutException` - if the wait timed out
      `InterruptedException` - if the wait was interrupted