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

IGNITE-22470 Switch IndexMetaStorage from Vault to MetaStorage #3917

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

tkalkirill
Copy link
Contributor

https://issues.apache.org/jira/browse/IGNITE-22470

Thank you for submitting the pull request.

To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:

The Review Checklist

  • Formal criteria: TC status, codestyle, mandatory documentation. Also make sure to complete the following:
    - There is a single JIRA ticket related to the pull request.
    - The web-link to the pull request is attached to the JIRA ticket.
    - The JIRA ticket has the Patch Available state.
    - The description of the JIRA ticket explains WHAT was made, WHY and HOW.
    - The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
  • Design: new code conforms with the design principles of the components it is added to.
  • Patch quality: patch cannot be split into smaller pieces, its size must be reasonable.
  • Code quality: code is clean and readable, necessary developer documentation is added if needed.
  • Tests code quality: test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.

Notes

* Creates a index meta instance.
*
* @param catalogIndexDescriptor Catalog index descriptor based on which the meta will be created.
* @param catalog Catalog version from which the {@code catalogIndexDescriptor} was taken.
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
* @param catalog Catalog version from which the {@code catalogIndexDescriptor} was taken.
* @param catalog Catalog from which the {@code catalogIndexDescriptor} was taken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not just a catalog, but a specific version of it, so I told you about it.

@@ -154,78 +169,86 @@ Collection<IndexMeta> indexMetasSnapshot() {
return List.copyOf(indexMetaByIndexId.values());
}

private void onCatalogIndexCreateEvent(CreateIndexEventParameters parameters) {
private CompletableFuture<Boolean> onCatalogIndexCreateEvent(CreateIndexEventParameters parameters) {
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
private CompletableFuture<Boolean> onCatalogIndexCreateEvent(CreateIndexEventParameters parameters) {
private CompletableFuture<Boolean> updateMetastoreOnCatalogIndexCreateEvent(CreateIndexEventParameters parameters) {

Let's change the name (or add doc?) to convey what happens on the events and what does boolean in the future mean

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The name may not be entirely obvious at first glance, but it has a certain pattern, and is found in our project:
on...Event - says that this is a reaction to an event.
Catalog - indicates that this is a CatalogEvent.
IndexCreate - a specific event when an index is created in a catalog.

I don't see any need for documentation since the described name and argument pattern self-documents the method.

);
}

private CompletableFuture<?> updateAndSaveIndexMetaToMetastore(
Copy link
Contributor

Choose a reason for hiding this comment

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

metaStorageManager.invoke returns CompletableFuture, why we use <?> here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because at the moment I don’t care what the future returns, I will ignore this value; if in the future someone needs the result, he can easily change it.

return new IndexMeta(catalogIndexDescriptor, catalog);
});
return IndexMeta.of(catalogIndexDescriptor, catalog);
}).thenApply(unused -> false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why all futures always complete with false? Can't wrap my head around it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please read javadoc of org.apache.ignite.internal.event.EventProducer and org.apache.ignite.internal.event.EventListener for understanding.

@tkalkirill tkalkirill merged commit d132a15 into apache:main Jun 14, 2024
1 check passed
@tkalkirill tkalkirill deleted the ignite-22470 branch June 14, 2024 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants