/** * Enable/Disable the resource * @param enabled */ public void enable(boolean enabled) { _record.setSimpleField(IdealStateProperty.HELIX_ENABLED.name(), Boolean.toString(enabled)); } }
/** * Disable (true) or enable (false) External View for this resource. */ public void setDisableExternalView(boolean disableExternalView) { _record .setSimpleField(IdealStateProperty.EXTERNAL_VIEW_DISABLED.name(), Boolean.toString(disableExternalView)); }
/** * Enable/Disable the resource * @param enabled */ public void enable(boolean enabled) { _record.setSimpleField(IdealStateProperty.HELIX_ENABLED.name(), Boolean.toString(enabled)); } }
/** * Get if the resource group routing feature is enabled or not * By default, it's disabled * * @return true if enabled; false otherwise */ public boolean isResourceGroupEnabled() { return _record.getBooleanField(IdealStateProperty.GROUP_ROUTING_ENABLED.name(), false); }
/** * Get rebalance delay time (in ms). * @return */ public long getRebalanceDelay() { return _record.getLongField(IdealStateProperty.REBALANCE_DELAY.name(), -1); }
/** * Specify the strategy for Helix to use to compute the partition-instance assignment, * i,e, the custom rebalance strategy that implements {@link org.apache.helix.controller.rebalancer.strategy.RebalanceStrategy} * * @param rebalanceStrategy * @return */ public void setRebalanceStrategy(String rebalanceStrategy) { _record.setSimpleField(IdealStateProperty.REBALANCE_STRATEGY.name(), rebalanceStrategy); }
/** * Disable (true) or enable (false) External View for this resource. */ public void setDisableExternalView(boolean disableExternalView) { _record .setSimpleField(IdealStateProperty.EXTERNAL_VIEW_DISABLED.name(), Boolean.toString(disableExternalView)); }
/** * Enable/Disable the aggregated routing on resource group. * * @param enabled */ public void enableGroupRouting(boolean enabled) { _record.setSimpleField(IdealStateProperty.GROUP_ROUTING_ENABLED.name(), Boolean.toString(enabled)); }
/** * Set the delay time (in ms) that Helix should move the partition after an instance goes offline. * @param delayInMilliseconds */ public void setRebalanceDelay(long delayInMilliseconds) { _record.setLongField(IdealStateProperty.REBALANCE_DELAY.name(), delayInMilliseconds); }
/** * Get the rebalance strategy for this resource. * * @return rebalance strategy, or null if not specified. */ public String getRebalanceStrategy() { return _record.getSimpleField(IdealStateProperty.REBALANCE_STRATEGY.name()); }
/** * Get if the resource is enabled or not * By default, it's enabled * @return true if enabled; false otherwise */ public boolean isEnabled() { return _record.getBooleanField(IdealStateProperty.HELIX_ENABLED.name(), true); }
/** * Enable/Disable the aggregated routing on resource group. * * @param enabled */ public void enableGroupRouting(boolean enabled) { _record.setSimpleField(IdealStateProperty.GROUP_ROUTING_ENABLED.name(), Boolean.toString(enabled)); }
/** * Get if the resource group routing feature is enabled or not * By default, it's disabled * * @return true if enabled; false otherwise */ public boolean isResourceGroupEnabled() { return _record.getBooleanField(IdealStateProperty.GROUP_ROUTING_ENABLED.name(), false); }
/** * Get if the resource is enabled or not * By default, it's enabled * @return true if enabled; false otherwise */ public boolean isEnabled() { return _record.getBooleanField(IdealStateProperty.HELIX_ENABLED.name(), true); }
/** * If the external view for this resource is disabled. by default, it is false. * * @return true if the external view should be disabled for this resource. */ public boolean isExternalViewDisabled() { return _record.getBooleanField(IdealStateProperty.EXTERNAL_VIEW_DISABLED.name(), false); }
/** * If the external view for this resource is disabled. by default, it is false. * * @return true if the external view should be disabled for this resource. */ public boolean isExternalViewDisabled() { return _record.getBooleanField(IdealStateProperty.EXTERNAL_VIEW_DISABLED.name(), false); }
/** * Set the delay time (in ms) that Helix should move the partition after an instance goes offline. * @param delayInMilliseconds */ public void setRebalanceDelay(long delayInMilliseconds) { _record.setLongField(IdealStateProperty.REBALANCE_DELAY.name(), delayInMilliseconds); }
/** * Specify the strategy for Helix to use to compute the partition-instance assignment, * i,e, the custom rebalance strategy that implements {@link org.apache.helix.controller.rebalancer.strategy.RebalanceStrategy} * * @param rebalanceStrategy * @return */ public void setRebalanceStrategy(String rebalanceStrategy) { _record.setSimpleField(IdealStateProperty.REBALANCE_STRATEGY.name(), rebalanceStrategy); }
/** * Get rebalance delay time (in ms). * @return */ public long getRebalanceDelay() { return _record.getLongField(IdealStateProperty.REBALANCE_DELAY.name(), -1); }
public IdealStateBuilderUtil disableIdealState() { _idealState.getRecord().setSimpleField(IdealState.IdealStateProperty.HELIX_ENABLED.name(), "false"); return this; }