bf2b487ac4ed92fac230751d872c675d338a00bb
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementPanel.java
| ... | ... | @@ -325,7 +325,8 @@ public class LandscapeManagementPanel extends SimplePanel { |
| 325 | 325 | applicationReplicaSetsActionColumn.addAction(ApplicationReplicaSetsImagesBarCell.ACTION_UPGRADE, |
| 326 | 326 | applicationReplicaSetToUpgrade -> { |
| 327 | 327 | if (applicationReplicaSetToUpgrade.isArchive()) { |
| 328 | - GWT.log("Replica set: " + applicationReplicaSetToUpgrade.getName()); |
|
| 328 | + upgradeArchiveReplicaSet(stringMessages, |
|
| 329 | + regionsTable.getSelectionModel().getSelectedObject(), Collections.singleton(applicationReplicaSetToUpgrade)); |
|
| 329 | 330 | } else { |
| 330 | 331 | upgradeApplicationReplicaSet(stringMessages, |
| 331 | 332 | regionsTable.getSelectionModel().getSelectedObject(), Collections.singleton(applicationReplicaSetToUpgrade)); |
| ... | ... | @@ -1413,7 +1414,7 @@ public class LandscapeManagementPanel extends SimplePanel { |
| 1413 | 1414 | new Timer() { |
| 1414 | 1415 | @Override |
| 1415 | 1416 | public void run() { |
| 1416 | - landscapeManagementService.upgradeApplicationReplicaSet(regionId, replicaSet, |
|
| 1417 | + landscapeManagementService.upgradeApplicationReplicaSet(regionId, replicaSet, |
|
| 1417 | 1418 | upgradeInstructions.getReleaseNameOrNullForLatestMaster(), |
| 1418 | 1419 | sshKeyManagementPanel.getSelectedKeyPair()==null?null:sshKeyManagementPanel.getSelectedKeyPair().getName(), |
| 1419 | 1420 | sshKeyManagementPanel.getPassphraseForPrivateKeyDecryption() != null |
| ... | ... | @@ -1454,6 +1455,55 @@ public class LandscapeManagementPanel extends SimplePanel { |
| 1454 | 1455 | } |
| 1455 | 1456 | }); |
| 1456 | 1457 | } |
| 1458 | + |
|
| 1459 | + private void upgradeArchiveReplicaSet(StringMessages stringMessages, String regionId, |
|
| 1460 | + Iterable<SailingApplicationReplicaSetDTO<String>> replicaSets) { |
|
| 1461 | + landscapeManagementService.getReleases(new AsyncCallback<ArrayList<ReleaseDTO>>() { |
|
| 1462 | + @Override |
|
| 1463 | + public void onFailure(Throwable caught) { |
|
| 1464 | + errorReporter.reportError(caught.getMessage()); |
|
| 1465 | + } |
|
| 1466 | + |
|
| 1467 | + @Override |
|
| 1468 | + public void onSuccess(ArrayList<ReleaseDTO> result) { |
|
| 1469 | + new UpgradeApplicationReplicaSetDialog(landscapeManagementService, result.stream().map(r->r.getName())::iterator, |
|
| 1470 | + stringMessages, errorReporter, new DialogCallback<UpgradeApplicationReplicaSetDialog.UpgradeApplicationReplicaSetInstructions>() { |
|
| 1471 | + @Override |
|
| 1472 | + public void ok(UpgradeApplicationReplicaSetInstructions upgradeInstructions) { |
|
| 1473 | + final int[] howManyMoreToGo = new int[] { Util.size(replicaSets) }; |
|
| 1474 | + for (final SailingApplicationReplicaSetDTO<String> replicaSet : replicaSets) { |
|
| 1475 | + landscapeManagementService.startArchiveServer(replicaSet, replicaSet.getName(), |
|
| 1476 | + new AsyncCallback<SailingApplicationReplicaSetDTO<String>>() { |
|
| 1477 | + @Override |
|
| 1478 | + public void onFailure(Throwable caught) { |
|
| 1479 | + decrementHowManyMoreToGoAndSetNonBusyIfDone(howManyMoreToGo); |
|
| 1480 | + errorReporter.reportError(caught.getMessage()); |
|
| 1481 | + } |
|
| 1482 | + |
|
| 1483 | + @Override |
|
| 1484 | + public void onSuccess(SailingApplicationReplicaSetDTO<String> result) { |
|
| 1485 | + decrementHowManyMoreToGoAndSetNonBusyIfDone(howManyMoreToGo); |
|
| 1486 | + if (result != null) { |
|
| 1487 | + Notification.notify(stringMessages.successfullyUpgradedApplicationReplicaSet( |
|
| 1488 | + result.getName(), result.getVersion()), NotificationType.SUCCESS); |
|
| 1489 | + applicationReplicaSetsTable.replaceBasedOnEntityIdentityComparator(result); |
|
| 1490 | + applicationReplicaSetsTable.refresh(); |
|
| 1491 | + } else { |
|
| 1492 | + Notification.notify(stringMessages.upgradingApplicationReplicaSetFailed(replicaSet.getName()), |
|
| 1493 | + NotificationType.ERROR); |
|
| 1494 | + } |
|
| 1495 | + } |
|
| 1496 | + }); |
|
| 1497 | + } |
|
| 1498 | + } |
|
| 1499 | + |
|
| 1500 | + @Override |
|
| 1501 | + public void cancel() { |
|
| 1502 | + } |
|
| 1503 | + }).show(); |
|
| 1504 | + } |
|
| 1505 | + }); |
|
| 1506 | + } |
|
| 1457 | 1507 | |
| 1458 | 1508 | private void refreshRegionsTable(UserService userService) { |
| 1459 | 1509 | landscapeManagementService.getRegions(new AsyncCallback<ArrayList<String>>() { |
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementWriteService.java
| ... | ... | @@ -166,6 +166,9 @@ public interface LandscapeManagementWriteService extends RemoteService { |
| 166 | 166 | SailingApplicationReplicaSetDTO<String> replicaSet, String instanceTypeName, |
| 167 | 167 | String optionalKeyName, byte[] privateKeyEncryptionPassphrase) throws Exception; |
| 168 | 168 | |
| 169 | + SailingApplicationReplicaSetDTO<String> startArchiveServer( |
|
| 170 | + SailingApplicationReplicaSetDTO<String> replicaSet, String replicaSetName) throws Exception; |
|
| 171 | + |
|
| 169 | 172 | ArrayList<LeaderboardNameDTO> getLeaderboardNames(SailingApplicationReplicaSetDTO<String> replicaSet, String bearerToken) throws Exception; |
| 170 | 173 | |
| 171 | 174 | void addShard(String shardName, ArrayList<LeaderboardNameDTO> selectedLeaderBoardNames, SailingApplicationReplicaSetDTO<String> replicaSet, |
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/client/LandscapeManagementWriteServiceAsync.java
| ... | ... | @@ -189,6 +189,8 @@ public interface LandscapeManagementWriteServiceAsync { |
| 189 | 189 | Integer optionalMemoryInMegabytesOrNull, Integer optionalMemoryTotalSizeFactorOrNull, Integer optionalIgtimiRiotPort, |
| 190 | 190 | AwsInstanceDTO optionalPreferredInstanceToDeployUnmanagedReplicaTo, |
| 191 | 191 | AsyncCallback<SailingApplicationReplicaSetDTO<String>> callback); |
| 192 | + |
|
| 193 | + void startArchiveServer(SailingApplicationReplicaSetDTO<String> replicaSet, String replicaSetName, AsyncCallback<SailingApplicationReplicaSetDTO<String>> callback); |
|
| 192 | 194 | |
| 193 | 195 | /** |
| 194 | 196 | * For the given replica set ensures there is at least one healthy replica, then stops replicating on all replicas and |
java/com.sap.sailing.landscape.ui/src/com/sap/sailing/landscape/ui/server/LandscapeManagementWriteServiceImpl.java
| ... | ... | @@ -676,6 +676,12 @@ public class LandscapeManagementWriteServiceImpl extends ResultCachingProxiedRem |
| 676 | 676 | optionalMemoryTotalSizeFactorOrNull, optionalIgtimiRiotPort, optionalPreferredInstanceToDeployUnmanagedReplicaTo); |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | + @Override |
|
| 680 | + public SailingApplicationReplicaSetDTO<String> startArchiveServer(SailingApplicationReplicaSetDTO<String> replicaSet, String replicaSetName) throws Exception { |
|
| 681 | + logger.info(replicaSet.getName()); |
|
| 682 | + return null; |
|
| 683 | + } |
|
| 684 | + |
|
| 679 | 685 | /** |
| 680 | 686 | * Starts a first master process of a new replica set whose name is provided by the {@code replicaSetName} |
| 681 | 687 | * parameter. The process is started on the host identified by the {@code hostToDeployTo} parameter. A set of |