Initial work on fixing out rebalance to more evenly distributed stealing and donating.
Hack to better balance stealing/donation
Re-wrote logic for re-balancing partitions in RebalanceUtils.generateMinCluster().

* Separates stealer nodes from donor nodes within each zone based on a goal of evenly distributing partitions within a zone across all nodes within that zone.
* Permits rebalancing logic to be run for a target cluster.xml that does not include any new nodes.
* Much more verbose output
* A few TODOs outstanding for review discussion
  - Do multiple tries serve any purpose?
  - Does the change that may make an existing node a stealer to smooth out the partition distribution break any other rebalance logic?
  - Why does RebalanceUtils.getCrossZoneMoves sometimes return 0? This tool code be sped up by many orders of magnitude for large clusters if we could avoid calling RebalanceUtils.getCrossZoneMoves
Add many options to vary how generating partitions works.

- turn on/off check to keep primary partitions within same zone
- turn on/off check for other partitions that move zones
- specify amount of randomness among num partitions per node (w/in zone)
Made analyze cluster option much more verbose. Dumps all partition maps and summarizes some aggregate partitions per node information.
Add option to limit the number of contiguous partitions within a zone.

- code to better balance partitions between zones is currently added
  to the main rebalance code. this may not be the right place for this
  code.

- TODO outstanding to figure out if the contig partitions manipulation
  can be done and then the rest of rebalancing can
  continue. Currently, the rest of the code gets broken and a separate
  instantiion of rebalancing needs to be done.
Added more rebalance options and refactored some of the rebalance utils code

- added random swap option that swaps random partitions between random nodes within a zone. This is a poor version of "simulated annealing". It produced some good results though in initial tests.

- Extended the cross zone partition move code that ensures there are no long contiguous runs of partitions within a single zone. Now, this code is followed by code that can balance the number of partitions in each zone. All of this code now runs in a loop until no further cross zone moves are performed. (A single pass of cross zone moves followed by balancing # of partitions per zone runs the risk of having contiguous partitions again.)

- Made most parameters that control these features command line options for the rebalancing --generate option.
Tweaked rebalance swapping algorithm to improve effectiveness. Cleaned up code.

Changed logic of random swapping to iterate over zones while randomly swapping. Because of the dependencies between zones, this appears to work much better.

Cleaned up comments, TODOs, and so on to prepare for code review.
complete transition to max/min ratio for balancing cluster.
Initial implementation of a greedy swapping algorithm.

Greedy swapping is unbelievably expensive because it tests every
possible pair-wise partition swap within a zone before making a single
swap. The goal is to get the most improvement possible with each swap
(to minimize the number of swaps total and so the amount of data
movement).
Improvements to greedy swapping algorithm.

The completely greedy algorithm was too expensive. Have balanced the greedy approach with optional randomness & limits on number of swaps attempted in each round.

Exposed options all the way through the CLI.
Addressed code review feedback on rebalance utility and cleaned up code

src/java/voldemort/client/rebalance/RebalanceCLI.java
- Changed pattern for boolean command line options to be cleaner
- Added more options to control when cross zone moves are checked
- Added more tests to confirm the specified sub-options for generate are mutually compatible
- Revised expansive secondary documentation of various options to cover all options

src/java/voldemort/client/rebalance/RebalanceClientConfig.java
- minor varaible rename

src/java/voldemort/cluster/Cluster.java
- add members and methods to track partitions & nodes by zone

src/java/voldemort/cluster/Node.java
- minor fix

src/java/voldemort/utils/RebalanceUtils.java
- refactored many of the methods I added to break them into smaller pieces
- by moving helper methods into Cluster.java, got rid of lots of redundant code
- cleaned up javadoc comments for the methods
- now prints out analysis for each try that improves balance
- validates num partitions for modified cluster same as original cluster

test/unit/voldemort/utils/RebalanceUtilsTest.java
- tests for some of the complicated/nuanced helper methods
Module level refactor : split bunch of stuff out of RebalanceUtils.java into new file RebalanceClusterUtils.java

All of the algorithms to generate a new cluster.xml that is (more) balanced has been moved into this new util class.
Module level refactor: split methods out of RebalanceUtils and RebalanceClusterUtils.java into new modules NodeUtils.java and ClusterUtils.java.

Any helper methods that operate on individual clusters or on individual (sets of) nodes are now in the appropriate util class.
Minor tweaks and refactoring

src/java/voldemort/utils/ClusterUtils.java
- added method to pretty print partition lists
- added methods to determine histogram of contiguous partition run lengths and pretty print
- moved verbose pretty printing of cluster details from ClusterRebalanceUtils to here

src/java/voldemort/utils/RebalanceClusterUtils.java
- randomized order in which zones are processed for shuffle algorithms
Update copyright notices.
Fixed minor issue with tests in AdminServiceBasicTest. They were not including an appropriate zone list when constructing a cluster.
Minor tweak to dealing with contiguous runs of partitions.

- Hard code 10 repeated attempts to get rid of contiguous partitions.
- Added a TODO to do something perfect at some unspecified time in the future...
Minor fix due to merging of persistency-check and rebalance-bug-fix branches