You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2020/06/21 12:12:19 UTC

[GitHub] [ignite] SammyVimes opened a new pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

SammyVimes opened a new pull request #7949:
URL: https://github.com/apache/ignite/pull/7949


   


----------------------------------------------------------------
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.

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



[GitHub] [ignite] dmagda commented on a change in pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

Posted by GitBox <gi...@apache.org>.
dmagda commented on a change in pull request #7949:
URL: https://github.com/apache/ignite/pull/7949#discussion_r445781419



##########
File path: modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactoryBean.java
##########
@@ -64,13 +64,13 @@ protected IgniteRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
     /** {@inheritDoc} */
     @Override protected RepositoryFactorySupport createRepositoryFactory() {
         try {
-            Ignite ignite = (Ignite)ctx.getBean("igniteInstance");
+            Ignite ignite = ctx.getBean(Ignite.class);
 
             return new IgniteRepositoryFactory(ignite);
         }
         catch (BeansException ex) {
             try {
-                IgniteConfiguration cfg = (IgniteConfiguration)ctx.getBean("igniteCfg");

Review comment:
       That would be a rare use case and I don't think we should focus on it. Anyway, I missed the fact that your updated version looks for IgniteConfiguration bean of any name. Let's just add a test that checks that the logic works if the bean is named as "igniteCfg". Again, just to ensure backward compatibility.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] SammyVimes closed pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

Posted by GitBox <gi...@apache.org>.
SammyVimes closed pull request #7949:
URL: https://github.com/apache/ignite/pull/7949


   


-- 
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.

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



[GitHub] [ignite] dmagda commented on a change in pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

Posted by GitBox <gi...@apache.org>.
dmagda commented on a change in pull request #7949:
URL: https://github.com/apache/ignite/pull/7949#discussion_r444559692



##########
File path: modules/spring-data/src/test/java/org/apache/ignite/springdata/misc/ApplicationConfiguration.java
##########
@@ -37,7 +37,7 @@
      * @return Ignite instance.
      */
     @Bean
-    public Ignite igniteInstance() {

Review comment:
       Let's keep the test where the instance is named as it was required before - "igniteInstance". Just for the sake of backward compatibility. Feel free to add a new one where the bean is named differently.

##########
File path: modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactoryBean.java
##########
@@ -64,13 +64,13 @@ protected IgniteRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
     /** {@inheritDoc} */
     @Override protected RepositoryFactorySupport createRepositoryFactory() {
         try {
-            Ignite ignite = (Ignite)ctx.getBean("igniteInstance");
+            Ignite ignite = ctx.getBean(Ignite.class);
 
             return new IgniteRepositoryFactory(ignite);
         }
         catch (BeansException ex) {
             try {
-                IgniteConfiguration cfg = (IgniteConfiguration)ctx.getBean("igniteCfg");

Review comment:
       Let's keep the "igniteCfg" approach to ensure backward compatibility. Some fo the folks might have already used this approach.




----------------------------------------------------------------
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.

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



[GitHub] [ignite] SammyVimes commented on a change in pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

Posted by GitBox <gi...@apache.org>.
SammyVimes commented on a change in pull request #7949:
URL: https://github.com/apache/ignite/pull/7949#discussion_r445649687



##########
File path: modules/spring-data/src/main/java/org/apache/ignite/springdata/repository/support/IgniteRepositoryFactoryBean.java
##########
@@ -64,13 +64,13 @@ protected IgniteRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
     /** {@inheritDoc} */
     @Override protected RepositoryFactorySupport createRepositoryFactory() {
         try {
-            Ignite ignite = (Ignite)ctx.getBean("igniteInstance");
+            Ignite ignite = ctx.getBean(Ignite.class);
 
             return new IgniteRepositoryFactory(ignite);
         }
         catch (BeansException ex) {
             try {
-                IgniteConfiguration cfg = (IgniteConfiguration)ctx.getBean("igniteCfg");

Review comment:
       Do you think users can have multiple beans of IgniteConfiguration? This can break only in that case 




----------------------------------------------------------------
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.

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



[GitHub] [ignite] SammyVimes commented on a change in pull request #7949: IGNITE-13169 Remove Ignite bean name requirement for Spring Data repository

Posted by GitBox <gi...@apache.org>.
SammyVimes commented on a change in pull request #7949:
URL: https://github.com/apache/ignite/pull/7949#discussion_r445650569



##########
File path: modules/spring-data/src/test/java/org/apache/ignite/springdata/misc/ApplicationConfiguration.java
##########
@@ -37,7 +37,7 @@
      * @return Ignite instance.
      */
     @Bean
-    public Ignite igniteInstance() {

Review comment:
       Sounds legit, I'll just add another test




----------------------------------------------------------------
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.

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