anchor.diff:  -spec start_rebalance([node()], [node()], [node()]) ->
                                ok | in_progress | already_balanced.
   start_rebalance(KeepNodes, EjectNodes, FailedNodes) ->
  +    wait_for_orchestrator(),
       gen_fsm:sync_send_event(?SERVER, {start_rebalance, KeepNodes,
                                         EjectNodes, FailedNodes}).
   
   
   -spec stop_rebalance() -> ok | not_rebalancing.
   stop_rebalance() ->
  +    wait_for_orchestrator(),
       gen_fsm:sync_send_event(?SERVER, stop_rebalance).
   
   
  
positive.code: start_link() ->
      misc:start_singleton(gen_fsm, ?MODULE, [], []).
  
  
  -spec create_bucket(memcached|membase, nonempty_string(), list()) ->
                             ok | {error, {already_exists, nonempty_string()}} |
  
negative.code:                            {error, {invalid_name, nonempty_string()}} |
                             rebalance_running.
  create_bucket(BucketType, BucketName, NewConfig) ->
      wait_for_orchestrator(),
      gen_fsm:sync_send_event(?SERVER, {create_bucket, BucketType, BucketName,
                                        NewConfig}, infinity).
  
  %% deletes bucket. Makes sure that once it returns it's already dead.
  delete_bucket(BucketName) ->
      wait_for_orchestrator(),
      gen_fsm:sync_send_event(?SERVER, {delete_bucket, BucketName}, infinity).
  
  
  -spec failover(atom()) -> ok.
  failover(Node) ->
      wait_for_orchestrator(),
      gen_fsm:sync_send_event(?SERVER, {failover, Node}, infinity).
  
  
  