You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "AMashenkov (via GitHub)" <gi...@apache.org> on 2023/09/22 14:54:40 UTC

[GitHub] [ignite-3] AMashenkov opened a new pull request, #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

AMashenkov opened a new pull request, #2619:
URL: https://github.com/apache/ignite-3/pull/2619

   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
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337162563


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > A new component IndexBuildController will appear, which will run the index building procedure, it will listen to events from IndexManager and PlacementDriver and react correctly to the its events.
   
   Should IndexBuildController listen for Catalog event directly, when an index is created?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337043732


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   As I see IGNITE-20330 is opened, but has a PR with concern from @ibessonov about architecture [1]. Also, I see IndexEvent is not used in PR.
   
   Usually, Events are used to notify external components (e.g. which we can't foresee in constructor) when state was changed.
   
   Here, IndexManager is fully responsible for index building flow. What external component needs subscribing to the IndexEvent? 
   
   As I see, Catalog can't do that because of position in dependency graph, it just know nothing about IndexManager. IndexBuilder looks like internal component relating to IndexManager, and I have no idea why it passed from the outside (however, this can be a IndexBuilder factory though). Thus, IndexManagere can call builder methods directly.
   
   [1] https://github.com/apache/ignite-3/pull/2538/files#r1317100029



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1338496715


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   We discussed it personally (with @AMashenkov and @ibessonov) and decided to get rid of the events.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337043732


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   As I see IGNITE-20330 is opened, but has a PR with concern from @ibessonov about architecture [1]. Also, I see IndexEvent is not used in PR.
   
   Usually, Events are used to notify external components when state was changed.
   Here, IndexManager is fully responsible for index building flow. What external component needs subscribing to the IndexEvent?
   As I see, Catalog can't do that because of position in dependency graph, it just know nothing about IndexManager. IndexBuilder looks like internal component relating to IndexManager, and I have no idea why it passed from the outside (however, this can be a IndexBuilder factory though). Thus, IndexManagere can call builder methods directly.
   
   [1] https://github.com/apache/ignite-3/pull/2538/files#r1317100029



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1338497713


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -147,35 +144,22 @@ public void stop() throws Exception {
     }
 
     private CompletableFuture<Boolean> onIndexDrop(DropIndexEventParameters parameters) {
-        int indexId = parameters.indexId();
-        int tableId = parameters.tableId();
-
-        long causalityToken = parameters.causalityToken();
-        int catalogVersion = parameters.catalogVersion();
-
         if (!busyLock.enterBusy()) {

Review Comment:
   U can use `IgniteUtils#inBusyLockAsync`



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -651,8 +642,6 @@ private CompletableFuture<Void> onTableDelete(DropTableEventParameters parameter
         int tableId = parameters.tableId();
 
         if (!busyLock.enterBusy()) {

Review Comment:
   U can use IgniteUtils#inBusyLockAsync



##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -193,12 +177,6 @@ private CompletableFuture<Boolean> onIndexCreate(CreateIndexEventParameters para
         int catalogVersion = parameters.catalogVersion();
 
         if (!busyLock.enterBusy()) {

Review Comment:
   same



##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1217,8 +1206,6 @@ private CompletableFuture<?> createTableLocally(long causalityToken, int catalog
         int tableId = tableDescriptor.id();
 
         if (!busyLock.enterBusy()) {

Review Comment:
   Same



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -319,16 +305,7 @@ public synchronized void stop() throws Exception {
 
         Stream<AutoCloseable> closableComponents = services.stream().map(s -> s::stop);

Review Comment:
   ```suggestion
   ```



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -319,16 +305,7 @@ public synchronized void stop() throws Exception {
 
         Stream<AutoCloseable> closableComponents = services.stream().map(s -> s::stop);
 
-        Stream<AutoCloseable> closableListeners = evtLsnrs.stream()
-                .map((p) -> () -> {
-                    if (p.left instanceof TableEvent) {
-                        tableManager.removeListener((TableEvent) p.left, p.right);
-                    } else {
-                        indexManager.removeListener((IndexEvent) p.left, p.right);
-                    }
-                });
-
-        IgniteUtils.closeAll(Stream.concat(closableComponents, closableListeners).collect(Collectors.toList()));
+        IgniteUtils.closeAll(closableComponents);

Review Comment:
   ```suggestion
           IgniteUtils.closeAll(services.stream().map(s -> s::stop));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337075983


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   Moreover, I think IndexManager is a IgniteComponent in the first place, and not an event Producer. The current approach with extending Producer class is wrong.
   
   If we decide at some point got extract common component behaviour into an abstract class, then a refactoring must be done. Let's rewrite event processing using incapsulation instead of inherintance.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337087402


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > Thus, IndexManager can just call builder methods directly.
   
   This is precisely my concern, I don't want index manager to depend on our internal stuff. Events allows us to remove such unnecessary dependencies.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337287069


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > Interesting. Do we have any precedents? I'm fine with it though.
   
   Not yet. We never took a look on components at high level to extract common parts.
   
   > Why wrong?
   
   Just common sense. I wonder that IndexManager name has 'index' and 'manager', but from your description it is just an event router. I expect the class/method names should reflect it's main purpose, and don't require to read a body to understand what they do.
   
   > I think that if we come up with something else, we will need to refactor something.
   
   We could avoid many refactorings by writing good code. I saw many good solution in your code, but can't understand why do we wasting a time arguing for the few lines of dead-code, which contains no valuable logic.
   Let's just drop it and write correct code from scratch, rather than thinking if this dead-code (potentially) fit your needs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1336879044


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   Is there any arh document to see how it will be used?



##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   @tkalkirill Is there any arh document to see how it will be used?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337087402


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > Thus, IndexManager can just call builder methods directly.
   
   This is precisely my concern, I don't want index manager to depend on our internal stuff. Events allows us to remove such unnecessary dependencies.
   > Let's rewrite event processing using incapsulation instead of inherintance.
   
   Interesting. Do we have any precedents? I'm fine with it though.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337043732


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   As I see IGNITE-20330 is opened, but has a PR with concern from @ibessonov about architecture [1]. Also, I see IndexEvent is not used in PR.
   
   Usually, Events are used to notify external components (e.g. which we can't foresee in constructor) when state was changed.
   
   Here, IndexManager is fully responsible for index building flow. What external component needs subscribing to the IndexEvent? 
   
   As I see, Catalog can't do that because of position in dependency graph, it just know nothing about IndexManager. Another candidate - IndexBuilder - looks like internal component relating to IndexManager, and I have no idea why it passed from the outside (however,  an IndexBuilder factory can be passes instead to resolve dependency issues). Thus, IndexManager can just call builder methods directly.
   What is the purpose to keep IndexEvent and related classes?
   
   [1] https://github.com/apache/ignite-3/pull/2538/files#r1317100029



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1336926016


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   @ygerzhedovich I didn’t quite understand why an architectural document was needed, I always thought it didn’t go deep into the implementation but revealed a high-level algorithm.



##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   @ygerzhedovich I didn’t quite understand why an architectural document was needed, I always thought it didn’t go deep into the implementation but revealed a high-level algorithm.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337043732


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   As I see IGNITE-20330 is opened, but has a PR with concern from @ibessonov about architecture [1]. Also, I see IndexEvent is not used in PR.
   
   Usually, Events is used to notify external components when state was changed.
   Here, IndexManager is fully responsible for index building flow. What external component needs subscribing to the IndexEvent?
   As I see, Catalog can't do that because of position in dependency graph, it just know nothing about IndexManager. IndexBuilder looks like internal component relating to IndexManager, and I have no idea why it passed from the outside (however, this can be a IndexBuilder factory though). Thus, IndexManagere can call builder methods directly.
   
   [1] https://github.com/apache/ignite-3/pull/2538/files#r1317100029



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337064149


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > As I see IGNITE-20330 is opened, but has a PR with concern from @ibessonov about architecture [1]. Also, I see IndexEvent is not used in PR.
   
   I closed the [PR](https://github.com/apache/ignite-3/pull/2538) because it is no longer valid because there will be a new implementation. We personally discussed (with @ibessonov and @sanpwc) the past decision and came to a new decision that will use the `IndexEvent` and `PrimaryReplicaEvent`.
   
   > Usually, Events are used to notify external components (e.g. which we can't foresee in constructor) when state was changed.
   > 
   > Here, IndexManager is fully responsible for index building flow. What external component needs subscribing to the IndexEvent?
   
   A new component `IndexBuildController` will appear, which will run the index building procedure, it will listen to events from `IndexManager` and `PlacementDriver` and react correctly to the its events.
   
   This is necessary firstly for less influence on the code of other components and also for merging two types of events:
   1. Index appeared/deleted.
   2. Appearance/loss of primacy of a replica.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337162563


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > A new component IndexBuildController will appear, which will run the index building procedure, it will listen to events from IndexManager and PlacementDriver and react correctly to the its events.
   
   Should IndexBuildController listen for Catalog event directly, when an index is created.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on pull request #2619: IGNITE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#issuecomment-1739025955

   In my PR, I deleted `IndexEvent` from `IndexManager` and `IndexManagerTest` but added several new tests to test the `IndexManager#getMvTableStorage`, please do not delete `IndexManagerTest` in your PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1338200980


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > you will delete these events, then I will return them anyway
   
   I agree, I'm afraid this it what will happen. @tkalkirill please link a JIRA where you're planning to use these events, maybe we'll take a look at it together. I'm surprised that thip particular JIRA was created byyou, and not closed when you changed the plans.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1338207280


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   Generally speaking, it is a dead code, and it looks inappropriate at times. So let's see on our plans, and if there's no JIRA or its intentions are not clear, we may as well proceed with deleting these classes. Returning them back won't be that hard
   EDIT: According to the comment in JIRA, events are already used in https://issues.apache.org/jira/browse/IGNITE-20330.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ygerzhedovich commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ygerzhedovich (via GitHub)" <gi...@apache.org>.
ygerzhedovich commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1335980511


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -1329,10 +1316,11 @@ private CompletableFuture<Void> createTableLocally(
         tablesById(causalityToken).thenRun(() -> inBusyLock(busyLock, () -> completeApiCreateFuture(table)));
 
         // TODO should be reworked in IGNITE-16763
-        // We use the event notification future as the result so that dependent components can complete the schema updates.
+        // We used the event notification future as the result so that dependent components can complete the schema updates.

Review Comment:
   what event do you mena here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1336823320


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   There is no need to get rid of **AbstractEventProducer** it will be needed for IGNITE-20330



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337075983


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   Moreover, I think IgniteManager is a IgniteComponent in the first place, and not an event Producer. The current approach with extending Producer class is wrong.
   
   If we decide at some point got extract common component behaviour into an abstract class, then a refactoring must be done. Let's rewrite event processing using incapsulation instead of inherintance.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337162563


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > A new component IndexBuildController will appear, which will run the index building procedure, it will listen to events from IndexManager and PlacementDriver and react correctly to the its events.
   
   Should IndexBuildController listen for Catalog event directly, when an index is created?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337287069


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > Interesting. Do we have any precedents? I'm fine with it though.
   
   Not yet. We never took a look on components at high level to extract common parts.
   
   > Why wrong?
   
   Just common sense. I wonder that IndexManager name has 'index' and 'manager', but from your description it is just an event router. I expect the class/method names should reflect it's main purpose, and don't require to read a body to understand what they do.
   
   > I think that if we come up with something else, we will need to refactor something.
   
   We could avoid many refactorings by writing good code. I saw many good solution in your code, but can't understand why you don't want to clean up the few lines of dead-code, which contains no valuable logic, then rewrite in correct way from scratch.
   Let's just drop it and write correct code from scratch, rather than thinking if this dead-code (potentially) fit your needs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] ibessonov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "ibessonov (via GitHub)" <gi...@apache.org>.
ibessonov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1338207280


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   Generally speaking, it is a dead code, and it looks inappropriate at times. So let's see on our plans, and if there's no JIRA or its intentions are not clear, we may as well proceed with deleting these classes. Returning them back won't be that hard



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337098634


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > Moreover, I think IgniteManager is a IgniteComponent in the first place, and not an event Producer. The current approach with extending Producer class is wrong.
   
   Why wrong?
   
   > If we decide at some point got extract common component behaviour into an abstract class, then a refactoring must be done. Let's rewrite event processing using incapsulation instead of inherintance.
   
   I think that if we come up with something else, we will need to refactor something.
   What do you propose it will look like with incapsulation? Will it be something like: `IndexManager#eventProduser` ?
   
   We would also need to decide where the creation of index storage (`MvTableStorage#getOrCreateIndex`) will take place, since there is a [IGNITE-19112](https://issues.apache.org/jira/browse/IGNITE-19112) to fixing this.
   The manager is in the right place for me at the moment - they listen the index creation event from catalog, created index storages.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1337287069


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   > Interesting. Do we have any precedents? I'm fine with it though.
   
   Not yet. We never took a look on components at high level to extract common parts.
   
   > Why wrong?
   
   Just common sense. I wonder that IndexManager name has 'index' and 'manager', but from your description it is just an event router. I expect the class/method names should reflect it's main purpose, and don't require to read a body to understand what they do.
   
   > I think that if we come up with something else, we will need to refactor something.
   
   We could avoid many refactorings by writing good code. I saw many good solution in your code, but can't understand why do we wasting a time arguing for the few lines of dead-code, which contains no valuable logic.
   Let's just drop it and write correct code from scratch, rather than thinking if this dead-code gives correct guarantees.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] tkalkirill commented on a diff in pull request #2619: IGNTIE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "tkalkirill (via GitHub)" <gi...@apache.org>.
tkalkirill commented on code in PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619#discussion_r1338028144


##########
modules/index/src/main/java/org/apache/ignite/internal/index/IndexManager.java:
##########
@@ -64,7 +61,7 @@
  * as well as managing indexes' lifecycle.
  */
 // TODO: IGNITE-19082 Delete this class
-public class IndexManager extends AbstractEventProducer<IndexEvent, IndexEventParameters> implements IgniteComponent {
+public class IndexManager implements IgniteComponent {

Review Comment:
   Look what happens, in the current ticket you will delete these events, then I will return them anyway, and I will need to deal with conflicts and return tests (it is clear that new ones will need to be added). Double work (even triple work) will be done, which would be better spent on other problems and/or bugs or tasks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [ignite-3] AMashenkov merged pull request #2619: IGNITE-20339 Get rid of legacy IndexEvent, TableEvent and SchemaEvent

Posted by "AMashenkov (via GitHub)" <gi...@apache.org>.
AMashenkov merged PR #2619:
URL: https://github.com/apache/ignite-3/pull/2619


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org