Skip to content

Commit 79eb945

Browse files
ShubhamGupta29pralabhkumar
authored andcommitted
Fixing a condition result for disabling TuneIn (#594)
1 parent fbbe28d commit 79eb945

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

app/com/linkedin/drelephant/tuning/AbstractFitnessManager.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ private boolean isTuningEnabled(Integer jobDefinitionId) {
285285

286286
return tuningJobDefinitionNew != null && tuningJobDefinitionNew.tuningEnabled;
287287
} else {
288-
return tuningJobDefinition != null && tuningJobDefinition.tuningEnabled;
288+
return tuningJobDefinition.tuningEnabled;
289289
}
290290
}
291291

@@ -301,6 +301,8 @@ public void disableTuning(JobDefinition jobDefinition, String reason) {
301301
tuningJobDefinition.tuningEnabled = false;
302302
tuningJobDefinition.tuningDisabledReason = reason;
303303
tuningJobDefinition.save();
304+
logger.info(String.format("Disabled TuneIn for %d as %s", tuningJobDefinition.job.id,
305+
tuningJobDefinition.tuningDisabledReason));
304306
}
305307
}
306308

app/com/linkedin/drelephant/tuning/hbt/FitnessManagerHBT.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ protected void checkToDisableTuning(Set<JobDefinition> jobDefinitionSet) {
191191
if (disableTuningforUserSpecifiedIterations(jobDefinition, numberOfValidSuggestedParamExecution)
192192
|| disableTuningforHeuristicsPassed(jobDefinition, tuningJobExecutionParamSets,
193193
numberOfValidSuggestedParamExecution)) {
194-
logger.debug(" Tuning Disabled for Job " + jobDefinition.id);
194+
if (isDebugEnabled) {
195+
logger.debug(" Tuning Disabled for Job " + jobDefinition.id);
196+
}
195197
}
196198
} catch (Exception e) {
197199
logger.error(" Error while disabling tuneIn for job " + jobDefinition.id, e);
@@ -207,8 +209,9 @@ private boolean disableTuningforHeuristicsPassed(JobDefinition jobDefinition,
207209
if (areHeuristicsPassed(tuningJobExecutionParamSets)
208210
&& numberOfAppliedSuggestedParamExecution >= MINIMUM_HBT_EXECUTION) {
209211
disableTuning(jobDefinition, "All Heuristics Passed");
212+
return true;
210213
}
211-
return true;
214+
return false;
212215
}
213216

214217
private boolean areHeuristicsPassed(List<TuningJobExecutionParamSet> tuningJobExecutionParamSets) {
@@ -249,10 +252,10 @@ private boolean areAppResultsHaveSeverity(List<AppResult> results) {
249252
return true;
250253
}
251254
}
252-
return checkHeuriticsforSeverity(heuristicsWithHighSeverity);
255+
return checkHeuristicsForSeverity(heuristicsWithHighSeverity);
253256
}
254257

255-
private boolean checkHeuriticsforSeverity(List<String> heuristicsWithHighSeverity) {
258+
private boolean checkHeuristicsForSeverity(List<String> heuristicsWithHighSeverity) {
256259
if (heuristicsWithHighSeverity.size() == 0) {
257260
logger.debug(" No severe heursitics ");
258261
return true;

0 commit comments

Comments
 (0)