-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[FLINK-4871] [mini cluster] Add memory calculation for TaskManagers to MiniCluster #2669
Conversation
7041f93
to
930334e
Compare
58e8d6c
to
4918b63
Compare
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.
+1 LGTM with just some minor comments.
* | ||
* @return | ||
*/ | ||
private long calculateManagedMemoryPerTaskManager() { |
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.
getOrCalculateManagedMemoryPerTaskManager
? 😃
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, will rename the method.
// ------------------------------------------------------------------------ | ||
// getters | ||
// ------------------------------------------------------------------------ | ||
|
||
public Configuration getConfiguration() { | ||
// update the memory in case that we've changed the number of components (TM, RM, JM) | ||
long memory = calculateManagedMemoryPerTaskManager(); |
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.
Getters should usually not perform any calculation. How about changing the method name to updateConfiguration()
?
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.
After this method has been called, you can't change the memory configuration anymore because the config value will prevent new calculation in calculateManagedMemoryPerTaskManager
. Is that desired?
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.
True. I guess we should create a new configuration every time this method is called. Will rename the method to then togenerateConfiguration
.
Thanks for the review @mxm. I will address your comments and if Travis gives green light, I will merge the PR. |
Allowing the RpcEndpoint.start/shutDown to throw exceptions will help to let rpc endpoints to quickly fail without having to use a callback like the FatalErrorHandler. This closes apache#2651.
This PR introduces a FatalErrorHandler and the MetricRegistry to the RM. The FatalErrorHandler is used to handle fatal errors. Additionally, the PR adds the MetricRegistry to the RM which can be used to register metrics. Apart from these changes the PR restructures the code of the RM a little bit and fixes some blocking operations. The PR also moves the TestingFatalErrorHandler into the util package of flink-runtime test. That it is usable across multiple tests. Introduce ResourceManagerRunner to handle errors in the ResourceManager This closes apache#2655.
…anager Introduce the JobLeaderIdService which automatically retrieves the current job leader id. This job leader id is used to validate job manager registartion attempts. Additionally, it is used to disconnect old job leaders from the resource manager. Add comments This closes apache#2657.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
4918b63
to
f2cdd2f
Compare
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes #2669.
Merged |
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes #2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
…o MiniCluster If the managed memory size for the task manager has not been set in the Configuration, then it is automatically calculated by dividing the available memory by the number of distributed components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner. That way it is possible to use the MiniCluster's MetricRegistry. Add memory calculation for task managers This closes apache#2669.
This PR is based on #2651, #2655 and #2657. Only 4918b63 is relevant.
If the managed memory size for the task manager has not been set in the Configuration, then
it is automatically calculated by dividing the available memory by the number of distributed
components. Additionally this PR allows to provide a MetricRegistry to the TaskManagerRunner.
That way it is possible to use the MiniCluster's MetricRegistry.
Add memory calculation for task managers.