More here..

http://mail-archives.apache.org/mod_mbox/helix-user/201502.mbox/%3c23ca11dc8830ba44a37c6b44b14d013cb9d0d...@esv4-mb02.linkedin.biz%3e



On Tue, Mar 17, 2015 at 10:19 AM, kishore g <[email protected]> wrote:

> 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,%20java.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,%20java.lang.String,%20org.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 <[email protected]>
> 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
>>
>
>

Reply via email to