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

Improve performance of connectionOperation functions #11702

Merged
merged 3 commits into from
Apr 7, 2022

Conversation

malikdiarra
Copy link
Contributor

What

Optimize the way we fetch and delete connections operations

How

Create function in ConfigRepository using direct SQL to

  • delete connection operation
  • list all the connection using a give operation

Recommended reading order

  1. ConfigRepository.java
  2. ConfigRepositoryE2EReadWriteTest.java
  3. OperationsHandler.java
  4. OperationsHandlerTest.java

@github-actions github-actions bot added area/platform issues related to the platform area/server labels Apr 4, 2022
Copy link
Contributor

@lmossman lmossman left a comment

Choose a reason for hiding this comment

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

Left an important comment about removing the line of code that is hurting performance and is no longer necessary with this change. Other than that, this LGTM

}

@Test
public void testDeleteStandardSync()
Copy link
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 testDeleteStandardSync()
public void testDeleteStandardSyncOperation()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -173,9 +173,9 @@ public void deleteOperationsForConnection(final StandardSync standardSync, final
for (final UUID operationId : deleteOperationIds) {
operationIds.remove(operationId);
boolean sharedOperation = false;
for (final StandardSync sync : allStandardSyncs) {
for (final StandardSync sync : configRepository.listStandardSyncsUsingOperation(operationId)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not able to comment on it, but line 171 should be removed from this function, since we no longer need to list all standard syncs:

final List<StandardSync> allStandardSyncs = configRepository.listStandardSyncs();

If this is not removed, we likely will not see as much of a performance improvement from this as we would like!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I removed the line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants