Skip to content

java: refactor SR cluster management#128

Merged
trstephen-amazon merged 4 commits intomainfrom
trs/cluster-mgmt-java
May 15, 2025
Merged

java: refactor SR cluster management#128
trstephen-amazon merged 4 commits intomainfrom
trs/cluster-mgmt-java

Conversation

@trstephen-amazon
Copy link
Copy Markdown
Collaborator

Changes

  • Deletes MR examples; this will be added back once SDKs are available with updated APIs
  • Combines all SR actions into a single test case. This'll let CI run faster because we don't have to create a cluster for each operation.
  • Adds a sweeper that deletes leaked clusters. Only runs in CI.
  • Remove unused and duplicate dependencies.
  • Readme corresponds to this code instead of pgJDBC ;)

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT-0 license.

Thank you for your contribution!

- Deletes MR examples; this will be added back once SDKs are available with
  updated APIs
- Combines all SR actions into a single test case. This'll let CI run
  faster because we don't have to create a cluster for each operation.
- Adds a sweeper that deletes leaked clusters. Only runs in CI.
- Remove unused and duplicate dependencies.
- Readme corresponds to this code instead of pgJDBC ;)
@trstephen-amazon trstephen-amazon marked this pull request as ready for review May 13, 2025 20:16
@trstephen-amazon
Copy link
Copy Markdown
Collaborator Author

trstephen-amazon commented May 13, 2025

bah, mis-clicked the 'ready for review' button. It's probably ready but I want to see CI go green.

edit: CI passed!

public class CreateCluster {

public static void main(String[] args) throws Exception {
public static void main(String[] args) {
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: style should we have main at bottom instead?

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.

As is it reads imperatively: marshal input params -> set up client -> invoke. Other languages may have stricter requirements about the order of declared methods (i.e. no use before declare) but I'm biasing for readability.

Comment thread java/cluster_management/src/main/java/org/example/DeleteCluster.java Outdated
Comment thread java/cluster_management/src/main/java/org/example/GetCluster.java Outdated
Comment thread java/cluster_management/src/main/java/org/example/UpdateCluster.java Outdated
* <li>Tagged with 'Name=java *'</li>
* </ol>
*/
static void deleteTestsClusters(DsqlClient client) {
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.

When we worked on HowTos in past we discovered that the github can interrupt so this should help resolve orphan clusters (Only caveat is if we have already reached our cluster limit we will get an ugly error first).

Comment thread java/cluster_management/README.md Outdated
Comment thread java/cluster_management/README.md Outdated
@trstephen-amazon
Copy link
Copy Markdown
Collaborator Author

Offline: got OK to merge from @imforster and @danielfrankcom

@trstephen-amazon trstephen-amazon merged commit 0871494 into main May 15, 2025
3 checks passed
@trstephen-amazon trstephen-amazon deleted the trs/cluster-mgmt-java branch May 15, 2025 03:20
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.

4 participants