You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Sergey Chernolyas <se...@gmail.com> on 2020/01/29 11:53:05 UTC

[IGNITE-12582] Configuration by property

Hi!
It is proposed to use the structure for configuration.

spring.data.ignite:
   - name: cache1
      sqlSchema: schema1
      atomicityMode: TRANSACTIONAL_SNAPSHOT
   - name: cache2
      sqlSchema: schema2
      storeKeepBinary: true
   - name: cache3
     sqlQuery: CREATE TABLE IF NOT EXISTS Person (id int, city_id int, name
varchar, age int,  company varchar, PRIMARY KEY (id, city_id))

Other ideas ?



-- 
---------------------

With best regards, Sergey Chernolyas

Re: [IGNITE-12582] Configuration by property

Posted by Sergey Chernolyas <se...@gmail.com>.
Hi!

Main subject is the example
https://apacheignite-mix.readme.io/docs/spring-data#section-apache-ignite-repository
demonstrates
mapping between particular repository and particular cache  by annotation
"RepositoryConfig".
I need to do it by spring configuration. For example, property "
*spring.data.mongodb.uri*" from spring data repository for mongodb

On Wed, 29 Jan 2020 at 15:16, Sergey Chernolyas <se...@gmail.com>
wrote:

> Hi!
>
>   It is seemed what I need.
>
> On Wed, 29 Jan 2020 at 15:14, Nikolay Izhikov <ni...@apache.org> wrote:
>
>> Hello, Sergey.
>>
>> What is «repository»? How it relates to the Ignite?
>>
>> ignite-spring-boot-autoconfigure confirms your requirements?
>>
>>
>> https://github.com/apache/ignite-extensions/blob/master/modules/spring-boot-autoconfigure/examples/main/resources/application.yml
>>
>> ```
>> ignite:
>>   igniteInstanceName: properties-instance-name
>>   communicationSpi:
>>     localPort: 5555
>>   dataStorageConfiguration:
>>     defaultDataRegionConfiguration:
>>       initialSize: 10485760 #10MB
>>     dataRegionConfigurations:
>>       - name: my-dataregion
>>         initialSize: 104857600 #100MB
>>   cacheConfiguration:
>>     - name: accounts
>>       queryEntities:
>>       - tableName: ACCOUNTS
>>         keyFieldName: ID
>>         keyType: java.lang.Long
>>         valueType: java.lang.Object
>>         fields:
>>           ID: java.lang.Long
>>           amount: java.lang.Double
>>           updateDate: java.util.Date
>>     - name: my-cache2
>> ```
>>
>>
>> > 29 янв. 2020 г., в 15:09, Sergey Chernolyas <
>> sergey.chernolyas@gmail.com> написал(а):
>> >
>> > Hi Nikolay!
>> > I need to configure particulate repository by usual Spring configuration
>> > without  using
>> >
>> https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/springdata20/repository/config/RepositoryConfig.html
>> >
>> > Am I investing to a bicycle?
>> >
>> > On Wed, 29 Jan 2020 at 14:58, Nikolay Izhikov <ni...@apache.org>
>> wrote:
>> >
>> >> Hello, Sergey.
>> >>
>> >> Your proposal is not clear for me
>> >> Can you, please, describe the issue you are trying to solve?
>> >> And the way you want to do it.
>> >>
>> >>
>> >>> 29 янв. 2020 г., в 14:53, Sergey Chernolyas <
>> sergey.chernolyas@gmail.com>
>> >> написал(а):
>> >>>
>> >>> Hi!
>> >>> It is proposed to use the structure for configuration.
>> >>>
>> >>> spring.data.ignite:
>> >>>  - name: cache1
>> >>>     sqlSchema: schema1
>> >>>     atomicityMode: TRANSACTIONAL_SNAPSHOT
>> >>>  - name: cache2
>> >>>     sqlSchema: schema2
>> >>>     storeKeepBinary: true
>> >>>  - name: cache3
>> >>>    sqlQuery: CREATE TABLE IF NOT EXISTS Person (id int, city_id int,
>> >> name
>> >>> varchar, age int,  company varchar, PRIMARY KEY (id, city_id))
>> >>>
>> >>> Other ideas ?
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> ---------------------
>> >>>
>> >>> With best regards, Sergey Chernolyas
>> >>
>> >>
>> >
>> > --
>> > ---------------------
>> >
>> > With best regards, Sergey Chernolyas
>>
>>
>
> --
> ---------------------
>
> With best regards, Sergey Chernolyas
>


-- 
---------------------

With best regards, Sergey Chernolyas

Re: [IGNITE-12582] Configuration by property

Posted by Sergey Chernolyas <se...@gmail.com>.
Hi!

  It is seemed what I need.

On Wed, 29 Jan 2020 at 15:14, Nikolay Izhikov <ni...@apache.org> wrote:

> Hello, Sergey.
>
> What is «repository»? How it relates to the Ignite?
>
> ignite-spring-boot-autoconfigure confirms your requirements?
>
>
> https://github.com/apache/ignite-extensions/blob/master/modules/spring-boot-autoconfigure/examples/main/resources/application.yml
>
> ```
> ignite:
>   igniteInstanceName: properties-instance-name
>   communicationSpi:
>     localPort: 5555
>   dataStorageConfiguration:
>     defaultDataRegionConfiguration:
>       initialSize: 10485760 #10MB
>     dataRegionConfigurations:
>       - name: my-dataregion
>         initialSize: 104857600 #100MB
>   cacheConfiguration:
>     - name: accounts
>       queryEntities:
>       - tableName: ACCOUNTS
>         keyFieldName: ID
>         keyType: java.lang.Long
>         valueType: java.lang.Object
>         fields:
>           ID: java.lang.Long
>           amount: java.lang.Double
>           updateDate: java.util.Date
>     - name: my-cache2
> ```
>
>
> > 29 янв. 2020 г., в 15:09, Sergey Chernolyas <se...@gmail.com>
> написал(а):
> >
> > Hi Nikolay!
> > I need to configure particulate repository by usual Spring configuration
> > without  using
> >
> https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/springdata20/repository/config/RepositoryConfig.html
> >
> > Am I investing to a bicycle?
> >
> > On Wed, 29 Jan 2020 at 14:58, Nikolay Izhikov <ni...@apache.org>
> wrote:
> >
> >> Hello, Sergey.
> >>
> >> Your proposal is not clear for me
> >> Can you, please, describe the issue you are trying to solve?
> >> And the way you want to do it.
> >>
> >>
> >>> 29 янв. 2020 г., в 14:53, Sergey Chernolyas <
> sergey.chernolyas@gmail.com>
> >> написал(а):
> >>>
> >>> Hi!
> >>> It is proposed to use the structure for configuration.
> >>>
> >>> spring.data.ignite:
> >>>  - name: cache1
> >>>     sqlSchema: schema1
> >>>     atomicityMode: TRANSACTIONAL_SNAPSHOT
> >>>  - name: cache2
> >>>     sqlSchema: schema2
> >>>     storeKeepBinary: true
> >>>  - name: cache3
> >>>    sqlQuery: CREATE TABLE IF NOT EXISTS Person (id int, city_id int,
> >> name
> >>> varchar, age int,  company varchar, PRIMARY KEY (id, city_id))
> >>>
> >>> Other ideas ?
> >>>
> >>>
> >>>
> >>> --
> >>> ---------------------
> >>>
> >>> With best regards, Sergey Chernolyas
> >>
> >>
> >
> > --
> > ---------------------
> >
> > With best regards, Sergey Chernolyas
>
>

-- 
---------------------

With best regards, Sergey Chernolyas

Re: [IGNITE-12582] Configuration by property

Posted by Nikolay Izhikov <ni...@apache.org>.
Hello, Sergey.

What is «repository»? How it relates to the Ignite?

ignite-spring-boot-autoconfigure confirms your requirements?

https://github.com/apache/ignite-extensions/blob/master/modules/spring-boot-autoconfigure/examples/main/resources/application.yml

```
ignite:
  igniteInstanceName: properties-instance-name
  communicationSpi:
    localPort: 5555
  dataStorageConfiguration:
    defaultDataRegionConfiguration:
      initialSize: 10485760 #10MB
    dataRegionConfigurations:
      - name: my-dataregion
        initialSize: 104857600 #100MB
  cacheConfiguration:
    - name: accounts
      queryEntities:
      - tableName: ACCOUNTS
        keyFieldName: ID
        keyType: java.lang.Long
        valueType: java.lang.Object
        fields:
          ID: java.lang.Long
          amount: java.lang.Double
          updateDate: java.util.Date
    - name: my-cache2
```


> 29 янв. 2020 г., в 15:09, Sergey Chernolyas <se...@gmail.com> написал(а):
> 
> Hi Nikolay!
> I need to configure particulate repository by usual Spring configuration
> without  using
> https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/springdata20/repository/config/RepositoryConfig.html
> 
> Am I investing to a bicycle?
> 
> On Wed, 29 Jan 2020 at 14:58, Nikolay Izhikov <ni...@apache.org> wrote:
> 
>> Hello, Sergey.
>> 
>> Your proposal is not clear for me
>> Can you, please, describe the issue you are trying to solve?
>> And the way you want to do it.
>> 
>> 
>>> 29 янв. 2020 г., в 14:53, Sergey Chernolyas <se...@gmail.com>
>> написал(а):
>>> 
>>> Hi!
>>> It is proposed to use the structure for configuration.
>>> 
>>> spring.data.ignite:
>>>  - name: cache1
>>>     sqlSchema: schema1
>>>     atomicityMode: TRANSACTIONAL_SNAPSHOT
>>>  - name: cache2
>>>     sqlSchema: schema2
>>>     storeKeepBinary: true
>>>  - name: cache3
>>>    sqlQuery: CREATE TABLE IF NOT EXISTS Person (id int, city_id int,
>> name
>>> varchar, age int,  company varchar, PRIMARY KEY (id, city_id))
>>> 
>>> Other ideas ?
>>> 
>>> 
>>> 
>>> --
>>> ---------------------
>>> 
>>> With best regards, Sergey Chernolyas
>> 
>> 
> 
> -- 
> ---------------------
> 
> With best regards, Sergey Chernolyas


Re: [IGNITE-12582] Configuration by property

Posted by Sergey Chernolyas <se...@gmail.com>.
Hi Nikolay!
I need to configure particulate repository by usual Spring configuration
without  using
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/springdata20/repository/config/RepositoryConfig.html

Am I investing to a bicycle?

On Wed, 29 Jan 2020 at 14:58, Nikolay Izhikov <ni...@apache.org> wrote:

> Hello, Sergey.
>
> Your proposal is not clear for me
> Can you, please, describe the issue you are trying to solve?
> And the way you want to do it.
>
>
> > 29 янв. 2020 г., в 14:53, Sergey Chernolyas <se...@gmail.com>
> написал(а):
> >
> > Hi!
> > It is proposed to use the structure for configuration.
> >
> > spring.data.ignite:
> >   - name: cache1
> >      sqlSchema: schema1
> >      atomicityMode: TRANSACTIONAL_SNAPSHOT
> >   - name: cache2
> >      sqlSchema: schema2
> >      storeKeepBinary: true
> >   - name: cache3
> >     sqlQuery: CREATE TABLE IF NOT EXISTS Person (id int, city_id int,
> name
> > varchar, age int,  company varchar, PRIMARY KEY (id, city_id))
> >
> > Other ideas ?
> >
> >
> >
> > --
> > ---------------------
> >
> > With best regards, Sergey Chernolyas
>
>

-- 
---------------------

With best regards, Sergey Chernolyas

Re: [IGNITE-12582] Configuration by property

Posted by Nikolay Izhikov <ni...@apache.org>.
Hello, Sergey.

Your proposal is not clear for me 
Can you, please, describe the issue you are trying to solve?
And the way you want to do it.


> 29 янв. 2020 г., в 14:53, Sergey Chernolyas <se...@gmail.com> написал(а):
> 
> Hi!
> It is proposed to use the structure for configuration.
> 
> spring.data.ignite:
>   - name: cache1
>      sqlSchema: schema1
>      atomicityMode: TRANSACTIONAL_SNAPSHOT
>   - name: cache2
>      sqlSchema: schema2
>      storeKeepBinary: true
>   - name: cache3
>     sqlQuery: CREATE TABLE IF NOT EXISTS Person (id int, city_id int, name
> varchar, age int,  company varchar, PRIMARY KEY (id, city_id))
> 
> Other ideas ?
> 
> 
> 
> -- 
> ---------------------
> 
> With best regards, Sergey Chernolyas