Skip to content

Refactor Optional parameters in the constructor of strategy #836

Merged
vmaheshw merged 12 commits intolinkedin:masterfrom
vmaheshw:refactorStrategyConfig
Jun 21, 2021
Merged

Refactor Optional parameters in the constructor of strategy #836
vmaheshw merged 12 commits intolinkedin:masterfrom
vmaheshw:refactorStrategyConfig

Conversation

@vmaheshw
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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