/** * Get the rebalancing mode on this resource * @return {@link IdealStateModeProperty} */ @Deprecated public IdealStateModeProperty getIdealStateMode() { return _record.getEnumField(IdealStateProperty.IDEAL_STATE_MODE.toString(), IdealStateModeProperty.class, IdealStateModeProperty.AUTO); }
/** * Get the rebalancing mode on this resource * @return {@link IdealStateModeProperty} */ @Deprecated public IdealStateModeProperty getIdealStateMode() { return _record.getEnumField(IdealStateProperty.IDEAL_STATE_MODE.toString(), IdealStateModeProperty.class, IdealStateModeProperty.AUTO); }
/** * Set the rebalance mode of the ideal state * @param mode {@link IdealStateModeProperty} */ @Deprecated public void setIdealStateMode(String mode) { _record.setSimpleField(IdealStateProperty.IDEAL_STATE_MODE.toString(), mode); RebalanceMode rebalanceMode = normalizeRebalanceMode(IdealStateModeProperty.valueOf(mode)); _record.setEnumField(IdealStateProperty.REBALANCE_MODE.toString(), rebalanceMode); }
/** * Set the state model associated with this resource * @param stateModel state model identifier */ public void setStateModelDefRef(String stateModel) { _record.setSimpleField(IdealStateProperty.STATE_MODEL_DEF_REF.toString(), stateModel); }
/** * Define a custom rebalancer that implements {@link Rebalancer} * @param rebalancerClassName the name of the custom rebalancing class */ public void setRebalancerClassName(String rebalancerClassName) { _record .setSimpleField(IdealStateProperty.REBALANCER_CLASS_NAME.toString(), rebalancerClassName); }
/** * Set the number of minimal active partitions for this resource. * * @param minActiveReplicas */ public void setMinActiveReplicas(int minActiveReplicas) { _record.setIntField(IdealStateProperty.MIN_ACTIVE_REPLICAS.toString(), minActiveReplicas); }
/** * Get the name of the user-defined rebalancer associated with this resource * @return the rebalancer class name, or null if none is being used */ public String getRebalancerClassName() { return _record.getSimpleField(IdealStateProperty.REBALANCER_CLASS_NAME.toString()); }
/** * Set a tag to check to enforce assignment to certain instances * @param groupTag the instance group tag */ public void setInstanceGroupTag(String groupTag) { _record.setSimpleField(IdealStateProperty.INSTANCE_GROUP_TAG.toString(), groupTag); }
/** * Set the frequency with which to rebalance * @return the rebalancing timer period */ public long getRebalanceTimerPeriod() { return _record.getLongField(IdealStateProperty.REBALANCE_TIMER_PERIOD.toString(), -1); }
/** * Set the resource type * @param resourceType */ public void setResourceType(String resourceType) { _record.setSimpleField(IdealStateProperty.RESOURCE_TYPE.toString(), resourceType); }
/** * Check for a tag that will restrict assignment to instances with a matching tag * @return the group tag, or null if none is present */ public String getInstanceGroupTag() { return _record.getSimpleField(IdealStateProperty.INSTANCE_GROUP_TAG.toString()); }
/** * Set the frequency with which to rebalance * @return the rebalancing timer period */ public long getRebalanceTimerPeriod() { return _record.getLongField(IdealStateProperty.REBALANCE_TIMER_PERIOD.toString(), -1); }
/** * Set the state model factory associated with this resource * @param name state model factory name */ public void setStateModelFactoryName(String name) { _record.setSimpleField(IdealStateProperty.STATE_MODEL_FACTORY_NAME.toString(), name); }
/** * Set the maximum number of partitions of this resource that an instance can serve * @param max the maximum number of partitions supported */ public void setMaxPartitionsPerInstance(int max) { _record.setIntField(IdealStateProperty.MAX_PARTITIONS_PER_INSTANCE.toString(), max); }
/** * Check for a tag that will restrict assignment to instances with a matching tag * @return the group tag, or null if none is present */ public String getInstanceGroupTag() { return _record.getSimpleField(IdealStateProperty.INSTANCE_GROUP_TAG.toString()); }
/** * Set the state model factory associated with this resource * @param name state model factory name */ public void setStateModelFactoryName(String name) { _record.setSimpleField(IdealStateProperty.STATE_MODEL_FACTORY_NAME.toString(), name); }
/** * Set the maximum number of partitions of this resource that an instance can serve * @param max the maximum number of partitions supported */ public void setMaxPartitionsPerInstance(int max) { _record.setIntField(IdealStateProperty.MAX_PARTITIONS_PER_INSTANCE.toString(), max); }
/** * Get the resource group name * * @return */ public String getResourceGroupName() { return _record.getSimpleField(IdealStateProperty.RESOURCE_GROUP_NAME.toString()); }
/** * Get the resource type * @return the resource type, or null if none is being set */ public String getResourceType() { return _record.getSimpleField(IdealStateProperty.RESOURCE_TYPE.toString()); }
/** * Set the rebalance mode of the resource * @param rebalancerType */ public void setRebalanceMode(RebalanceMode rebalancerType) { _record.setEnumField(IdealStateProperty.REBALANCE_MODE.toString(), rebalancerType); IdealStateModeProperty idealStateMode = denormalizeRebalanceMode(rebalancerType); _record.setEnumField(IdealStateProperty.IDEAL_STATE_MODE.toString(), idealStateMode); }