-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pre-configuration based assignment #11578
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
Merged
siddharthteotia
merged 19 commits into
apache:master
from
jasperjiaguo:PreConfiguredInstancePartitionSelector
Oct 30, 2023
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
60877d1
add tenant partition map rest resource
jasperjiaguo 1c66e5f
checkstyle
jasperjiaguo 19282ce
checkstyle
jasperjiaguo f77e90b
checkstyle
jasperjiaguo 0df73b6
Trigger Test
jasperjiaguo eb66f9f
Address comments
jasperjiaguo b4cccad
refactored branches
jasperjiaguo 37d7fe1
address comments
jasperjiaguo e8587c5
address comments
jasperjiaguo 764c8fc
address comments
jasperjiaguo 9b5c4a9
Change the shuffling logic to be compatible with future changes
jasperjiaguo ad941aa
add test cases
jasperjiaguo db49349
address comments
jasperjiaguo dab3299
address comments
jasperjiaguo c646567
address comments
jasperjiaguo 367af71
change table validation logic
jasperjiaguo b044af0
Trigger Test
jasperjiaguo 545e7d0
update shuffling logic
jasperjiaguo 8479b70
add more logging
jasperjiaguo 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -60,19 +60,31 @@ public InstancePartitions assignInstances(InstancePartitionsType instancePartiti | |
| InstanceAssignmentConfigUtils.getInstanceAssignmentConfig(_tableConfig, instancePartitionsType); | ||
| return getInstancePartitions( | ||
| instancePartitionsType.getInstancePartitionsName(TableNameBuilder.extractRawTableName(tableNameWithType)), | ||
| assignmentConfig, instanceConfigs, existingInstancePartitions); | ||
| assignmentConfig, instanceConfigs, existingInstancePartitions, null); | ||
| } | ||
|
|
||
| public InstancePartitions assignInstances(InstancePartitionsType instancePartitionsType, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: can the existing |
||
| List<InstanceConfig> instanceConfigs, @Nullable InstancePartitions existingInstancePartitions, @Nullable | ||
| InstancePartitions preConfiguredInstancePartitions) { | ||
| String tableNameWithType = _tableConfig.getTableName(); | ||
| InstanceAssignmentConfig assignmentConfig = | ||
| InstanceAssignmentConfigUtils.getInstanceAssignmentConfig(_tableConfig, instancePartitionsType); | ||
| return getInstancePartitions( | ||
| instancePartitionsType.getInstancePartitionsName(TableNameBuilder.extractRawTableName(tableNameWithType)), | ||
| assignmentConfig, instanceConfigs, existingInstancePartitions, preConfiguredInstancePartitions); | ||
| } | ||
|
|
||
| public InstancePartitions assignInstances(String tierName, List<InstanceConfig> instanceConfigs, | ||
| @Nullable InstancePartitions existingInstancePartitions, InstanceAssignmentConfig instanceAssignmentConfig) { | ||
| return getInstancePartitions( | ||
| InstancePartitionsUtils.getInstancePartitionsNameForTier(_tableConfig.getTableName(), tierName), | ||
| instanceAssignmentConfig, instanceConfigs, existingInstancePartitions); | ||
| instanceAssignmentConfig, instanceConfigs, existingInstancePartitions, null); | ||
| } | ||
|
|
||
| private InstancePartitions getInstancePartitions(String instancePartitionsName, | ||
| InstanceAssignmentConfig instanceAssignmentConfig, List<InstanceConfig> instanceConfigs, | ||
| @Nullable InstancePartitions existingInstancePartitions) { | ||
| @Nullable InstancePartitions existingInstancePartitions, | ||
| @Nullable InstancePartitions preConfiguredInstancePartitions) { | ||
| String tableNameWithType = _tableConfig.getTableName(); | ||
| LOGGER.info("Starting {} instance assignment for table {}", instancePartitionsName, tableNameWithType); | ||
|
|
||
|
|
@@ -93,7 +105,8 @@ private InstancePartitions getInstancePartitions(String instancePartitionsName, | |
|
|
||
| InstancePartitionSelector instancePartitionSelector = | ||
| InstancePartitionSelectorFactory.getInstance(instanceAssignmentConfig.getPartitionSelector(), | ||
| instanceAssignmentConfig.getReplicaGroupPartitionConfig(), tableNameWithType, existingInstancePartitions); | ||
| instanceAssignmentConfig.getReplicaGroupPartitionConfig(), tableNameWithType, existingInstancePartitions, | ||
| preConfiguredInstancePartitions); | ||
| InstancePartitions instancePartitions = new InstancePartitions(instancePartitionsName); | ||
| instancePartitionSelector.selectInstances(poolToInstanceConfigsMap, instancePartitions); | ||
| return instancePartitions; | ||
|
|
||
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.