-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIHADOOP-39635: Add new configuration parameters heuristic #463
Merged
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
05cc90b
Add new configuration parameters heuristic
edwinalu 35c7ab4
add configuration
edwinalu f976b0e
check for execution memory spill before adjusting executor memory
edwinalu 4abc701
code review comments
edwinalu 5bc6d6b
remove partitions
edwinalu aae9c16
consolidate case classes
edwinalu 73a3606
add license
edwinalu 5010e41
add more licenses
edwinalu 4ba707b
remove stage level GC analysis/warnings, due to too many false positi…
edwinalu ca9d1f4
code review comments
edwinalu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
app/com/linkedin/drelephant/spark/heuristics/ConfigurationParameterAdjustment.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.linkedin.drelephant.spark.heuristics | ||
varunsaxena marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* Adjustments to configuration parameters for fixing flagged issues. | ||
*/ | ||
private[heuristics] sealed trait ConfigurationParameterAdjustment[T] { | ||
|
||
/** | ||
* Determine if the value should be adjusted. | ||
* | ||
* @param value the value to adjust. | ||
* @return true if the value should be adjusted, false otherwise. | ||
*/ | ||
def canAdjust(value: T): Boolean | ||
|
||
/** Adjust the value. | ||
* | ||
* @param value the value to adjust. | ||
* @return the adjusted recommended value. | ||
*/ | ||
def adjust(value: T): T | ||
} | ||
|
||
/** If the number of cores is greater than the threshold, then divide by divisor. */ | ||
private[heuristics] case class CoreDivisorAdjustment( | ||
threshold: Int, | ||
divisor: Double) extends ConfigurationParameterAdjustment[Int] { | ||
override def canAdjust(numCores: Int): Boolean = (numCores > threshold) | ||
override def adjust(numCores: Int): Int = Math.ceil(numCores / divisor).toInt | ||
} | ||
|
||
/** Set the number of cores to threshold, if the number of cores is greater. */ | ||
private[heuristics] case class CoreSetAdjustment( | ||
threshold: Int) extends ConfigurationParameterAdjustment[Int] { | ||
override def canAdjust(numCores: Int): Boolean = (numCores > threshold) | ||
override def adjust(numCores: Int): Int = threshold | ||
} | ||
|
||
/** If the memory is less than the threshold, then multiply by multiplier. */ | ||
private[heuristics] case class MemoryMultiplierAdjustment( | ||
threshold: Long, | ||
multiplier: Double) extends ConfigurationParameterAdjustment[Long] { | ||
override def canAdjust(memBytes: Long): Boolean = (memBytes < threshold) | ||
override def adjust(memBytes: Long): Long = (memBytes * multiplier).toLong | ||
} | ||
|
||
/** If the memory is less than the threshold, then set to the theshold. */ | ||
private[heuristics] case class MemorySetAdjustment( | ||
threshold: Long) extends ConfigurationParameterAdjustment[Long] { | ||
override def canAdjust(memBytes: Long): Boolean = (memBytes < threshold) | ||
override def adjust(memBytes: Long): Long = threshold | ||
} | ||
|
||
/** If the number of partitions is less than the threshold, then multiply by multiplier. */ | ||
private[heuristics] case class PartitionMultiplierAdjustment( | ||
threshold: Int, | ||
multiplier: Double) extends ConfigurationParameterAdjustment[Int] { | ||
override def canAdjust(numPartitions: Int): Boolean = (numPartitions < threshold) | ||
override def adjust(numPartitions: Int): Int = (numPartitions * multiplier).toInt | ||
} | ||
|
||
/** If the number of partitions is less than the threshold, then set to threshold. */ | ||
private[heuristics] case class PartitionSetAdjustment( | ||
threshold: Int) extends ConfigurationParameterAdjustment[Int] { | ||
override def canAdjust(numPartitions: Int): Boolean = (numPartitions < threshold) | ||
override def adjust(numPartitions: Int): Int = threshold | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is LinkedIn specific REST endpoint and wont work in open source till it's contributed back to Spark upstream. Probably going ahead we should refactor the code and have our own SparkRestClient implementation. The abstraction for us is primarily at the fetcher level. So probably have a linkedin specific spark fetcher implementation which extends SparkFetcher which currently exists, reuses the part where we are fetching event logs but has custom Spark rest client implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is LinkedIn specific, and separating out the code would make sense. Could the refactoring be done later?