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

Fix update dialog pops several times when click ok/cancel button issue #2013

Merged
merged 7 commits into from
Sep 18, 2018

Conversation

t-rufang
Copy link
Contributor

To fix #1920

Copy link
Member

@wezhang wezhang left a comment

Choose a reason for hiding this comment

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

Thanks Rui!

@@ -67,7 +67,7 @@ public SparkServerlessClusterNode(@NotNull Node parent,
protected void refreshItems() throws AzureCmdException {
try {
cluster.get().toBlocking().singleOrDefault(cluster);
if (Optional.ofNullable(cluster.getMasterState()).orElse("")
if (getNodeActionByName("Update") == null && Optional.ofNullable(cluster.getMasterState()).orElse("")
Copy link
Member

@wezhang wezhang Sep 17, 2018

Choose a reason for hiding this comment

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

I suppose you may need to remove all actions before adding one. The method name is refreshItems #Resolved

@@ -90,7 +90,7 @@ protected void loadActions() {
this, cluster, adlAccount, SparkServerlessClusterOps.getInstance().getDestroyAction()));
addAction("View Cluster Status", new SparkServerlessMonitorAction(
this, cluster, SparkServerlessClusterOps.getInstance().getMonitorAction()));
if (Optional.ofNullable(cluster.getMasterState()).orElse("")
if (getNodeActionByName("Update") == null && Optional.ofNullable(cluster.getMasterState()).orElse("")
.equals(SparkItemGroupState.STABLE.toString())) {
addAction("Update", new SparkServerlessUpdateAction(
Copy link
Member

@wezhang wezhang Sep 17, 2018

Choose a reason for hiding this comment

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

why the action needs to be added twice? #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After user provision a new cluster, the cluster state is not STABLE. So the actions for this new provisioned cluster node don't contain Update. Update action will be enabled when cluster is in STABLE state and user refreshes the node.


In reply to: 217964570 [](ancestors = 217964570)

this, cluster, SparkServerlessClusterOps.getInstance().getUpdateAction()));
}
Boolean isClusterStabled = Optional.ofNullable(cluster.getMasterState()).orElse("")
.equals(SparkItemGroupState.STABLE.toString());
Copy link
Member

@wezhang wezhang Sep 17, 2018

Choose a reason for hiding this comment

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

equalsIgnoreCase? #Resolved

addAction("Update", new SparkServerlessUpdateAction(
this, cluster, SparkServerlessClusterOps.getInstance().getUpdateAction()));
}
Boolean isClusterStabled = Optional.ofNullable(cluster.getMasterState()).orElse("")
Copy link
Member

@wezhang wezhang Sep 17, 2018

Choose a reason for hiding this comment

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

This val can be private function #Resolved

this, cluster, SparkServerlessClusterOps.getInstance().getUpdateAction()));
}

NodeAction updateAction = addAction("Update", new SparkServerlessUpdateAction(
Copy link
Member

@wezhang wezhang Sep 17, 2018

Choose a reason for hiding this comment

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

Can we assign Update to a const String value? #Resolved

@@ -115,6 +109,11 @@ protected void actionPerformed(NodeActionEvent e) throws AzureCmdException {
});
}

private Boolean isClusterStable() {
Copy link
Member

@wezhang wezhang Sep 18, 2018

Choose a reason for hiding this comment

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

no boxing, boolean is enough #Resolved

Copy link
Member

@wezhang wezhang left a comment

Choose a reason for hiding this comment

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

Thanks Rui! You can find the Squash operation.

@t-rufang t-rufang merged commit edf3a9c into microsoft:develop Sep 18, 2018
wezhang added a commit that referenced this pull request Sep 18, 2018
t-rufang added a commit that referenced this pull request Sep 18, 2018
@SummerSun SummerSun mentioned this pull request Sep 27, 2018
4 tasks
@t-rufang t-rufang deleted the issue_hotfix branch January 8, 2020 07:14
andxu pushed a commit to andxu/azure-tools-for-java that referenced this pull request Mar 24, 2020
microsoft#2013)

* Fix update dialog pops several times when click ok/cancel button issue

* Update based on review comments
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.

[IntelliJ][Spark on ADL] Update dialog pops twice when click OK button
2 participants