Skip to content
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

Refactor Optional parameters in the constructor of strategy #836

Merged
merged 12 commits into from
Jun 21, 2021

Conversation

vmaheshw
Copy link
Collaborator

There are lots of Optional fields added to the constructor of the strategy. Most of these fields are not really used as Optional. Refactoring the code to make it simpler and easier to maintain. We will make the fields Optional in future on need basis.

somandal
somandal previously approved these changes Jun 15, 2021
Copy link
Collaborator

@somandal somandal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, left a few minor comments that you can feel free to ignore

createStickyPartitionAssignmentStrategyObject(0, 0, null, _clusterName);
}

private void createStickyPartitionAssignmentStrategyObject(int partitionsPerTask, int partitionFullnessFactorPct,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rather than adding this extra function, can't you just directly call createStickyPartitionAssignmentStrategy with "enableElasticTask" set to 'false' and just ignore the returned assignment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a default to avoid modifying some of the defaults everywhere. It was easier to refactor and fix at one place.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you rename this function to either be the same as createStickyPartitionAssignmentStrategy or createStickyPartitionAssignmentStrategyWithElasticTaskDisabled?

createStickyPartitionAssignmentStrategyObject(0, 0, null, _clusterName);
}

private void createStickyPartitionAssignmentStrategyObject(int partitionsPerTask, int partitionFullnessFactorPct,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you rename this function to either be the same as createStickyPartitionAssignmentStrategy or createStickyPartitionAssignmentStrategyWithElasticTaskDisabled?

Copy link
Collaborator

@jzakaryan jzakaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vmaheshw vmaheshw merged commit 4be50d1 into linkedin:master Jun 21, 2021
@vmaheshw vmaheshw deleted the refactorStrategyConfig branch June 21, 2021 18:45
vmaheshw added a commit to vmaheshw/brooklin that referenced this pull request Mar 1, 2022
…#836)

There are lots of Optional fields added to the constructor of the strategy. Most of these fields are not really used as Optional. Refactoring the code to make it simpler and easier to maintain. We will make the fields Optional in future on need basis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants