Skip to content

IGNITE-18540 Fixed processing of the default distribution zone.#1532

Merged
sanpwc merged 3 commits intoapache:mainfrom
gridgain:ignite-18540
Jan 18, 2023
Merged

IGNITE-18540 Fixed processing of the default distribution zone.#1532
sanpwc merged 3 commits intoapache:mainfrom
gridgain:ignite-18540

Conversation

@sergeyuttsel
Copy link
Copy Markdown
Contributor

@sergeyuttsel sergeyuttsel commented Jan 16, 2023

@sergeyuttsel sergeyuttsel force-pushed the ignite-18540 branch 3 times, most recently from 2e8cb9d to cb5962a Compare January 16, 2023 16:09
@sergeyuttsel sergeyuttsel changed the title IGNITE-18540 Added processing of the default distribution zone. IGNITE-18540 Fixed processing of the default distribution zone. Jan 16, 2023
@sergeyuttsel sergeyuttsel marked this pull request as ready for review January 16, 2023 16:47
logicalTopology = newLogicalTopology;

zonesConfiguration.distributionZones().value().namedListKeys()
Stream.of(
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.

I'd rather encapsulate all actions to be performed with zone into some fooBar method and simply call fooBar for defaultZone and fooBar for all other zones from the list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks.

throw new DistributionZoneRenameException(name, distributionZoneCfg.name(), e);
}
if (DEFAULT_ZONE_NAME.equals(name)) {
change = zonesConfiguration.change(zonesChange -> zonesChange
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.

I would use formatting like this

                change = zonesConfiguration.change(
                        zonesChange -> zonesChange.changeDefaultDistributionZone(
                                zoneChange -> updateZoneChange(zoneChange, distributionZoneCfg)
                        )
                );

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks.

* @param zoneChange Zone change.
* @param distributionZoneCfg Distribution zone configuration.
*/
private void updateZoneChange(DistributionZoneChange zoneChange, DistributionZoneConfigurationParameters distributionZoneCfg) {
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.

May be static.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

assertEquals(Integer.MAX_VALUE, zone1.dataNodesAutoAdjustScaleUp().value(), "dataNodesAutoAdjustScaleUp is wrong.");
assertEquals(Integer.MAX_VALUE, zone1.dataNodesAutoAdjustScaleDown().value(), "dataNodesAutoAdjustScaleDown is wrong.");
assertEquals(100, zone1.dataNodesAutoAdjust().value(), "dataNodesAutoAdjust is wrong.");
public void testUpdateZone(String zoneName) throws Exception {
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.

Suggested change
public void testUpdateZone(String zoneName) throws Exception {
private void testUpdateZone(String zoneName) throws Exception {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@sanpwc sanpwc merged commit 17473a4 into apache:main Jan 18, 2023
@sanpwc sanpwc deleted the ignite-18540 branch January 18, 2023 13:58
lowka pushed a commit to gridgain/apache-ignite-3 that referenced this pull request Mar 18, 2023
lowka pushed a commit to gridgain/apache-ignite-3 that referenced this pull request Apr 19, 2023
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