@VisibleForTesting
  void configureHelixQuotaBasedTaskScheduling() {
    // set up the cluster quota config
    List<String> quotaConfigList = ConfigUtils.getStringList(this.config,
        GobblinClusterConfigurationKeys.HELIX_TASK_QUOTA_CONFIG_KEY);

    if (quotaConfigList.isEmpty()) {
      return;
    }

    // retrieve the cluster config for updating
    ClusterConfig clusterConfig = this.multiManager.getJobClusterHelixManager().getConfigAccessor()
        .getClusterConfig(this.clusterName);
    clusterConfig.resetTaskQuotaRatioMap();

    for (String entry : quotaConfigList) {
      List<String> quotaConfig = Splitter.on(":").limit(2).trimResults().omitEmptyStrings().splitToList(entry);

      if (quotaConfig.size() < 2) {
        throw new IllegalArgumentException(
            "Quota configurations must be of the form <key1>:<value1>,<key2>:<value2>,...");
      }

      clusterConfig.setTaskQuotaRatio(quotaConfig.get(0), Integer.parseInt(quotaConfig.get(1)));
    }

    this.multiManager.getJobClusterHelixManager().getConfigAccessor()
        .setClusterConfig(this.clusterName, clusterConfig); // Set the new ClusterConfig
  }
@ VisibleForTesting void configureHelixQuotaBasedTaskScheduling ( ) { List < String > quotaConfigList = ConfigUtils . getStringList ( this . config , GobblinClusterConfigurationKeys . HELIX_TASK_QUOTA_CONFIG_KEY ) ; if ( quotaConfigList . isEmpty ( ) ) { return ; } ClusterConfig clusterConfig = this . multiManager . getJobClusterHelixManager ( ) . getConfigAccessor ( ) . getClusterConfig ( this . clusterName ) ; clusterConfig . resetTaskQuotaRatioMap ( ) ; for ( String entry : quotaConfigList ) { List < String > quotaConfig = Splitter . on ( ":" ) . limit ( 2 ) . trimResults ( ) . omitEmptyStrings ( ) . splitToList ( entry ) ; if ( quotaConfig . size ( ) < 2 ) { throw new IllegalArgumentException ( "Quota configurations must be of the form <key1>:<value1>,<key2>:<value2>,..." ) ; } clusterConfig . setTaskQuotaRatio ( quotaConfig . get ( 0 ) , Integer . parseInt ( quotaConfig . get ( 1 ) ) ) ; } this . multiManager . getJobClusterHelixManager ( ) . getConfigAccessor ( ) . setClusterConfig ( this . clusterName , clusterConfig ) ; }
Configure Helix quota-based task scheduling