On 10/03/2020 16:07, kishore g wrote:
The ideal state will always remain empty. check the external view, it
should reflect the ideal state you computed.
Thanks !
The ideal state is not empty with a semi-auto rebalancer, but it remains
empty with a user-defined balancer ?
The external view remains empty as well :
ExternalView for crawlDB:
{
"id" : "crawlDB",
"mapFields" : {
},
"listFields" : {
},
"simpleFields" : {
"BUCKET_SIZE" : "0",
"IDEAL_STATE_MODE" : "AUTO",
"NUM_PARTITIONS" : "20",
"REBALANCER_CLASS_NAME" : "com.exensa.wdl.controller.PerDiskBalancer",
"REBALANCE_MODE" : "USER_DEFINED",
"REBALANCE_STRATEGY" : "DEFAULT",
"REPLICAS" : "1",
"STATE_MODEL_DEF_REF" : "MasterSlave",
"STATE_MODEL_FACTORY_NAME" : "DEFAULT"
}
}
On Tue, Mar 10, 2020 at 8:01 AM Geoffroy Fouquier
<[email protected] <mailto:[email protected]>>
wrote:
Hello,
I am trying to define a user-defined balancer following the
tutorial
on helix web-page. I defined a simple balancer (a modulo ; based on
TestCustomizedIdealStateRebalancer.TestRebalancer) and configure the
balancer with :
---8<---
IdealState idealState = helixAdmin.getResourceIdealState(clusterName,
resourceName);
idealState.setRebalanceMode(IdealState.RebalanceMode.USER_DEFINED);
idealState.setRebalancerClassName(balancerClassName);
helixAdmin.setResourceIdealState(clusterName, resourceName,
idealState);
---8<---
I have a controller running on a standalone cluster with 3
instances).
Before the rebalance, resource looks like this :
IdealState for crawlDB:
{
"id" : "crawlDB",
"mapFields" : {
},
"listFields" : {
},
"simpleFields" : {
"IDEAL_STATE_MODE" : "AUTO",
"NUM_PARTITIONS" : "20",
"REBALANCER_CLASS_NAME" :
"com.exensa.wdl.controller.PerDiskBalancer",
"REBALANCE_MODE" : "USER_DEFINED",
"REBALANCE_STRATEGY" : "DEFAULT",
"REPLICAS" : "0",
"STATE_MODEL_DEF_REF" : "MasterSlave",
"STATE_MODEL_FACTORY_NAME" : "DEFAULT"
}
}
My custom rebalancer is called :
- PerDiskBalancer / init
- computeNewIdealState
- nodes: [standalone-1.localhost, standalone-3.localhost,
standalone-2.local
host] partitions: [crawlDB_0, crawlDB_1, crawlDB_10, crawlDB_11,
crawlDB_12, crawlDB_13, crawlDB_14, crawlDB_15, crawlDB_16,
crawlDB_17,
crawlDB_18, crawlDB_19, crawlDB_2, crawlDB_3, crawlDB_4, crawlDB_5,
crawlDB_6, craw
lDB_7, crawlDB_8, crawlDB_9]
- set partition preference list for crawlDB_0 to
standalone-1.localhost
- set instance state map for partition crawlDB_0 to
standalone-1.localhost
- set partition preference list for crawlDB_1 to
standalone-3.localhost
[...]
- set instance state map for partition crawlDB_8 to
standalone-1.localhost
- set partition preference list for crawlDB_9 to
standalone-3.localhost
- set instance state map for partition crawlDB_9 to
standalone-3.localhost
but the resulting IdealState doesn't have any mapping :
IdealState for crawlDB:
{
"id" : "crawlDB",
"mapFields" : {
"crawlDB_0" : {
},
"crawlDB_1" : {
},
"crawlDB_10" : {
},
"crawlDB_11" : {
},
"crawlDB_12" : {
},
"crawlDB_13" : {
},
"crawlDB_14" : {
},
"crawlDB_15" : {
},
"crawlDB_16" : {
},
"crawlDB_17" : {
},
"crawlDB_18" : {
},
"crawlDB_19" : {
},
"crawlDB_2" : {
},
"crawlDB_3" : {
},
"crawlDB_4" : {
},
"crawlDB_5" : {
},
"crawlDB_6" : {
},
"crawlDB_7" : {
},
"crawlDB_8" : {
},
"crawlDB_9" : {
}
},
"listFields" : {
"crawlDB_0" : [ ],
"crawlDB_1" : [ ],
"crawlDB_10" : [ ],
"crawlDB_11" : [ ],
"crawlDB_12" : [ ],
"crawlDB_13" : [ ],
"crawlDB_14" : [ ],
"crawlDB_15" : [ ],
"crawlDB_16" : [ ],
"crawlDB_17" : [ ],
"crawlDB_18" : [ ],
"crawlDB_19" : [ ],
"crawlDB_2" : [ ],
"crawlDB_3" : [ ],
"crawlDB_4" : [ ],
"crawlDB_5" : [ ],
"crawlDB_6" : [ ],
"crawlDB_7" : [ ],
"crawlDB_8" : [ ],
"crawlDB_9" : [ ]
},
"simpleFields" : {
"IDEAL_STATE_MODE" : "AUTO",
"NUM_PARTITIONS" : "20",
"REBALANCER_CLASS_NAME" :
"com.exensa.wdl.controller.PerDiskBalancer",
"REBALANCE_MODE" : "USER_DEFINED",
"REBALANCE_STRATEGY" : "DEFAULT",
"REPLICAS" : "1",
"STATE_MODEL_DEF_REF" : "MasterSlave",
"STATE_MODEL_FACTORY_NAME" : "DEFAULT"
}
}
did I miss something ?
Thanks !