@Test public void testQuotaConfig() throws Exception { this.gobblinClusterManager.configureHelixQuotaBasedTaskScheduling(); ClusterConfig clusterConfig = this.gobblinClusterManager.multiManager.getJobClusterHelixManager().getConfigAccessor() .getClusterConfig(GobblinClusterManagerTest.class.getSimpleName()); Assert.assertEquals(clusterConfig.getTaskQuotaRatio("DEFAULT"), "1"); Assert.assertEquals(clusterConfig.getTaskQuotaRatio("OTHER"), "10"); }
@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); }
GobblinClusterManager implements ApplicationLauncher, StandardMetricsBridge, LeadershipChangeAwareComponent { @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); } }
GobblinClusterManager implements ApplicationLauncher, StandardMetricsBridge, LeadershipChangeAwareComponent { @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); } GobblinClusterManager(String clusterName, String applicationId, Config sysConfig,
      Optional<Path> appWorkDirOptional); }
GobblinClusterManager implements ApplicationLauncher, StandardMetricsBridge, LeadershipChangeAwareComponent { @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); } GobblinClusterManager(String clusterName, String applicationId, Config sysConfig,
      Optional<Path> appWorkDirOptional); @Override synchronized void start(); @Override synchronized void stop(); @SuppressWarnings("unused") @Subscribe void handleApplicationMasterShutdownRequest(ClusterManagerShutdownRequest shutdownRequest); @Override void close(); @Override Collection<StandardMetrics> getStandardMetricsCollection(); static void main(String[] args); @Override void becomeActive(); @Override void becomeStandby(); }
GobblinClusterManager implements ApplicationLauncher, StandardMetricsBridge, LeadershipChangeAwareComponent { @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); } GobblinClusterManager(String clusterName, String applicationId, Config sysConfig,
      Optional<Path> appWorkDirOptional); @Override synchronized void start(); @Override synchronized void stop(); @SuppressWarnings("unused") @Subscribe void handleApplicationMasterShutdownRequest(ClusterManagerShutdownRequest shutdownRequest); @Override void close(); @Override Collection<StandardMetrics> getStandardMetricsCollection(); static void main(String[] args); @Override void becomeActive(); @Override void becomeStandby();  }