You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Anil <an...@gmail.com> on 2017/01/27 09:06:37 UTC

Ignite java and xml configuration

Hi,

we are using combination of java and xml configuration for ignite.

for now, cache configuration uses java configuration and  swap, discovery
uses xml configuration.

Is there any way to move the cache configuration to xml which uses the java
annotations ? thanks.

Below is the current cache configuration.

CacheConfiguration<AffinityKey<String>, Person> pConfig = new
CacheConfiguration<AffinityKey<String>, Person>();
pConfig.setName("PERSON_CACHE");
pConfig.setBackups(1);
pConfig.setCacheMode(CacheMode.PARTITIONED);
pConfig.setIndexedTypes(AffinityKey.class, Person.class);
pConfig.setCopyOnRead(false);
pConfig.setSwapEnabled(true);
pConfig.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
pConfig.setOffHeapMaxMemory(1024 * 1024 * 1024 * 8);


i set the query entities in xml and tried to use @SqlQueryField for Person
pojo fields and did not work.

Thanks.

Re: Ignite java and xml configuration

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Anil,

Way not?

<property name="indexedTypes">
  <list>
    <value>java.lang.Integer</value>
    <value>java.lang.String</value>

*and so on pairs of classes*

  </list>
</property>

On Fri, Jan 27, 2017 at 1:18 PM, Anil <an...@gmail.com> wrote:

> But Indextypes cannot be set in xml configuration. Can we ? Thanks.
>
>


-- 
Vladislav Pyatkov

Re: Ignite java and xml configuration

Posted by Anil <an...@gmail.com>.
But Indextypes cannot be set in xml configuration. Can we ? Thanks.

Re: Ignite java and xml configuration

Posted by Vladislav Pyatkov <vp...@gridgain.com>.
Hi Anil,

You can use configuration cache in xml with annotation query field.
But you if you are use @SqlQueryField, then you should use
CacheConfiguration#setIndexedTypes property instead of QueryEntity.

On Fri, Jan 27, 2017 at 12:06 PM, Anil <an...@gmail.com> wrote:

> Hi,
>
> we are using combination of java and xml configuration for ignite.
>
> for now, cache configuration uses java configuration and  swap, discovery
> uses xml configuration.
>
> Is there any way to move the cache configuration to xml which uses the
> java annotations ? thanks.
>
> Below is the current cache configuration.
>
> CacheConfiguration<AffinityKey<String>, Person> pConfig = new
> CacheConfiguration<AffinityKey<String>, Person>();
> pConfig.setName("PERSON_CACHE");
> pConfig.setBackups(1);
> pConfig.setCacheMode(CacheMode.PARTITIONED);
> pConfig.setIndexedTypes(AffinityKey.class, Person.class);
> pConfig.setCopyOnRead(false);
> pConfig.setSwapEnabled(true);
> pConfig.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
> pConfig.setOffHeapMaxMemory(1024 * 1024 * 1024 * 8);
>
>
> i set the query entities in xml and tried to use @SqlQueryField for Person
> pojo fields and did not work.
>
> Thanks.
>
>