helix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kishore g <g.kish...@gmail.com>
Subject Re: Adding partitions
Date Tue, 17 Mar 2015 17:19:10 GMT
Hi Chris,

Yes, you can change the number of partitions dynamically (increase and
decrease should work). Add resource will not work for adding more
partitions.

You have to read the idealstate, change the partition number and set it
back.

IdealState idealstate = admin.getResourceIdealState
<http://helix.apache.org/javadocs/0.6.3/reference/org/apache/helix/HelixAdmin.html#getResourceIdealState(java.lang.String,
java.lang.String)>(String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 clusterName, String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 resourceName)
idealstate.setNumPartitions
<http://helix.apache.org/javadocs/0.6.3/reference/org/apache/helix/model/IdealState.html#setNumPartitions(int)>(int
numPartitions)
admin.setResourceIdealState
<http://helix.apache.org/javadocs/0.6.3/reference/org/apache/helix/HelixAdmin.html#setResourceIdealState(java.lang.String,
java.lang.String, org.apache.helix.model.IdealState)>(String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 clusterName, String
<http://download.oracle.com/javase/6/docs/api/index.html?java/lang/String.html>
 resourceName, IdealState
<http://helix.apache.org/javadocs/0.6.3/reference/org/apache/helix/model/IdealState.html>
 idealState)


thanks,
Kishore G

On Tue, Mar 17, 2015 at 10:07 AM, Chris Riccomini <criccomini@apache.org>
wrote:

> Hey all,
>
> Is it possible to add partitions to a cluster after it's been created?
> Following the RabbitMQ example, if I use:
>
>   admin.addResource(clusterName, resourceName, 6, "OnlineOffline",
> "AUTO_REBALANCE");
>
> Can I then update resourceName with 8 partitions later?
>
> Cheers,
> Chris
>

Mime
View raw message