private List<MRTaskExecutionResponse.SuggestionResult> getSpillSuggest(double smallerSpillBytes, double largerSpillBytes) { if (smallerSpillBytes == 0) { smallerSpillBytes = 1; } double deviation = largerSpillBytes / smallerSpillBytes; String suggestion = null; if (deviation > threshold) { suggestion = String.format(SPILL_SUGGESTION_FORMAT, threshold, largerSpillBytes, smallerSpillBytes); } List<MRTaskExecutionResponse.SuggestionResult> suggestionResults = new ArrayList<>(); String suggestName = String.format(SPILL_RATIO_NAME_FORMAT, JobCounters.CounterName.SPLIT_RAW_BYTES.getName()); suggestionResults.add(new MRTaskExecutionResponse.SuggestionResult(suggestName, deviation, suggestion)); return suggestionResults; } }
private List<MRTaskExecutionResponse.SuggestionResult> getGCsuggest(double smallerRatio, double largerRatio) { if (smallerRatio <= 0) { smallerRatio = 1; } double deviation = largerRatio / smallerRatio; String suggestName = String.format(GC_RATIO_NAME_FORMAT, JobCounters.CounterName.GC_MILLISECONDS.getName(), JobCounters.CounterName.CPU_MILLISECONDS.getName()); String suggestion = null; if (deviation > threshold) { suggestion = String.format(GC_SUGGESTION_FORMAT, threshold, largerRatio, smallerRatio); } List<MRTaskExecutionResponse.SuggestionResult> suggestionResults = new ArrayList<>(); suggestionResults.add(new MRTaskExecutionResponse.SuggestionResult(suggestName, deviation, suggestion)); return suggestionResults; }
private List<MRTaskExecutionResponse.SuggestionResult> getDeviationSuggest(double avgSmaller, double avgLarger) { if (avgSmaller <= 0) { avgSmaller = 1; } double deviation = avgLarger / avgSmaller; String suggestName = String.format(DEVIATION_SUGGEST_FORMAT, counterName.getName()); String suggestion = null; if (deviation > threshold) { suggestion = String.format(DATA_SKEW_SUGGESTION_FORMAT, counterName.getName(), threshold, avgLarger, avgSmaller); } List<MRTaskExecutionResponse.SuggestionResult> suggestionResults = new ArrayList<>(); suggestionResults.add(new MRTaskExecutionResponse.SuggestionResult(suggestName, deviation, suggestion)); return suggestionResults; } }