Source:
<code>public ParameterAveragingTrainingMaster(boolean saveUpdater, Integer numWorkers, int rddDataSetNumExamples, int batchSizePerWorker, int averagingFrequency, int aggregationDepth, int prefetchNumBatches, Repartition repartition, RepartitionStrategy repartitionStrategy, StorageLevel storageLevel, boolean collectTrainingStats) { if (numWorkers <= 0) throw new IllegalArgumentException("Invalid number of workers: " + numWorkers + " (must be >= 1)"); if (rddDataSetNumExamples <= 0) throw new IllegalArgumentException( "Invalid rdd data set size: " + rddDataSetNumExamples + " (must be >= 1)"); <START> if (averagingFrequency <= 0) <END> throw new IllegalArgumentException("Invalid input: averaging frequency must be >= 1"); if (aggregationDepth <= 0) { throw new IllegalArgumentException("Invalid input: tree aggregation depth must be >= 1"); } this.saveUpdater = saveUpdater; this.numWorkers = numWorkers; this.rddDataSetNumExamples = rddDataSetNumExamples; this.batchSizePerWorker = batchSizePerWorker; this.averagingFrequency = averagingFrequency; this.aggregationDepth = aggregationDepth; this.prefetchNumBatches = prefetchNumBatches; this.collectTrainingStats = collectTrainingStats; this.repartition = repartition; this.repartitionStrategy = repartitionStrategy; this.storageLevel = storageLevel; if (collectTrainingStats) stats = new ParameterAveragingTrainingMasterStats.ParameterAveragingTrainingMasterStatsHelper(); String jvmuid = UIDProvider.getJVMUID(); this.trainingMasterUID = System.currentTimeMillis() + "_" + (jvmuid.length() <= 8 ? jvmuid : jvmuid.substring(0, 8)); this.rng = new Random(); }</code><technical_language>Great initiative, [Guava's preconditions](<LINK_0> do checks of this sort</technical_language>

Target:
public ParameterAveragingTrainingMaster(boolean saveUpdater, Integer numWorkers, int rddDataSetNumExamples, int batchSizePerWorker, int averagingFrequency, int aggregationDepth, int prefetchNumBatches, Repartition repartition, RepartitionStrategy repartitionStrategy, StorageLevel storageLevel, boolean collectTrainingStats) { checkArgument(numWorkers > 0, "Invalid number of workers: " + numWorkers + " (must be >= 1)"); checkArgument(rddDataSetNumExamples > 0, "Invalid rdd data set size: " + rddDataSetNumExamples + " (must be >= 1)"); checkArgument(averagingFrequency > 0, "Invalid input: averaging frequency must be >= 1"); checkArgument(aggregationDepth > 0, "Invalid input: tree aggregation depth must be >= 1"); this.saveUpdater = saveUpdater; this.numWorkers = numWorkers; this.rddDataSetNumExamples = rddDataSetNumExamples; this.batchSizePerWorker = batchSizePerWorker; this.averagingFrequency = averagingFrequency; this.aggregationDepth = aggregationDepth; this.prefetchNumBatches = prefetchNumBatches; this.collectTrainingStats = collectTrainingStats; this.repartition = repartition; this.repartitionStrategy = repartitionStrategy; this.storageLevel = storageLevel; if (collectTrainingStats) stats = new ParameterAveragingTrainingMasterStats.ParameterAveragingTrainingMasterStatsHelper(); String jvmuid = UIDProvider.getJVMUID(); this.trainingMasterUID = System.currentTimeMillis() + "_" + (jvmuid.length() <= 8 ? jvmuid : jvmuid.substring(0, 8)); this.rng = new Random(); }