Thanks Kishore.

Sent from my iPad

On Feb 14, 2013, at 12:14 PM, kishore g <[email protected]> wrote:

> Hi Ming,
> 
> There is an example
> https://git-wip-us.apache.org/repos/asf?p=incubator-helix.git;a=blob;f=helix-core/src/main/java/org/apache/helix/examples/IdealStateExample.java;hb=437eb42e
> .
> admin.addResource(clusterName, resourceName, numPartitions,
> stateModelName, "AUTO");
> // rebalance resource "TestDB" using 3 replicas
> admin.rebalance(clusterName, resourceName, numReplica);
> 
> This will automatically do the partition placement among the nodes in the
> cluster. We use a mix of consistent hashing and crush
> http://www.ssrc.ucsc.edu/Papers/weil-sc06.pdf to do the placement.
> 
> But i think you need a way to come up with your own logic of assigning the
> replica set for a partition. You can find an example for that in
> BaseStageTest. See setupIdealState
> https://git-wip-us.apache.org/repos/asf?p=incubator-helix.git;a=blob;f=helix-core/src/test/java/org/apache/helix/controller/stages/BaseStageTest.java;h=ed54e6facdc17b40bd8eeb56c4cfaa5ad39ea91b;hb=437eb42e
> 
> Here is the code snippet.http://pastebin.com/e2LXtq46.
> 
> Hope this helps
> 
> Thanks,
> Kishore G
> 
> 
> 
> 
> 
> 
> 
> On Thu, Feb 14, 2013 at 8:03 AM, Ming Fang <[email protected]> wrote:
> 
>> Can someone point me to an example of how to specify partition placement
>> when using AUTO mode?
>> The link here http://helix.incubator.apache.org/Features.html says it's
>> possible but I was not able to find any example or unit test that does this.
>> Thanks
>> --ming

Reply via email to