You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by gene <ge...@gm.com> on 2018/01/15 16:27:47 UTC

Default Cache template

Hello,  I'm having difficulties setting the default template while using the
DDL create table.  I've tried multiple ways, however I don't believe I have
the register cache template part down.  While trying to create any Table w/
DDL using template=<my template name> I get a cache not found error.

please advise.

-gene



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Default Cache template

Posted by Вячеслав Коптилин <sl...@gmail.com>.
Thanks for catching that. I already proposed the fix of xml example. I hope
the doc will be updated soon.

Regards,
S.

ср, 30 янв. 2019 г. в 22:30, mahesh76private <ma...@gmail.com>:

> It works.
>
> it isn't in your documentation though.
> https://apacheignite.readme.io/docs/cache-template
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Default Cache template

Posted by mahesh76private <ma...@gmail.com>.
It works.

it isn't in your documentation though. 
https://apacheignite.readme.io/docs/cache-template




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Default Cache template

Posted by Вячеслав Коптилин <sl...@gmail.com>.
Hello,

You have to add '*' to the cache name as follows:

<property name="cacheConfiguration">
    <list>
        <bean id="cache-template-bean"
abstract="true" class="org.apache.ignite.configuration.CacheConfiguration">
            <property name="name" value="SQLTABLE_TEMPLATE*"/>
            <property name="cacheMode" value="PARTITIONED" />
            <property name="backups" value="1" />
        </bean>
    </list>
</property>

Thanks,
S.

вт, 29 янв. 2019 г. в 11:07, mahesh76private <ma...@gmail.com>:

> Hi,
>
> I added the below, in node config.xml file. However, SQL table create from
> client side keep complaining that "SQLTABLE_TEMPLATE" template is not
> found.
>
>
> <property name="cacheConfiguration">
>     <list>
>         <bean id="cache-template-bean" abstract="true"
> class="org.apache.ignite.configuration.CacheConfiguration">
>             <property name="name" value="SQLTABLE_TEMPLATE"/>
>             <property name="cacheMode" value="PARTITIONED" />
>             <property name="backups" value="1" />
>         </bean>
>     </list>
> </property>
>
> The only way this works is from Java code, when I use the
> CacheConfiguration.addCacheConfiguration and register the template with the
> cluster.
>
> My need is to set the template in node config xml and ensure it
> automatically resisters the template and there should be no need to
> explicitly set it.
>
> Please let me know, if I am doing something wrong.
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Default Cache template

Posted by mahesh76private <ma...@gmail.com>.
Hi, 

I added the below, in node config.xml file. However, SQL table create from
client side keep complaining that "SQLTABLE_TEMPLATE" template is not found.


<property name="cacheConfiguration"> 
    <list> 
        <bean id="cache-template-bean" abstract="true" 
class="org.apache.ignite.configuration.CacheConfiguration"> 
            <property name="name" value="SQLTABLE_TEMPLATE"/> 
            <property name="cacheMode" value="PARTITIONED" /> 
            <property name="backups" value="1" /> 
        </bean> 
    </list> 
</property> 

The only way this works is from Java code, when I use the
CacheConfiguration.addCacheConfiguration and register the template with the
cluster. 

My need is to set the template in node config xml and ensure it
automatically resisters the template and there should be no need to
explicitly set it. 

Please let me know, if I am doing something wrong.






--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Default Cache template

Posted by "slava.koptilin" <sl...@gmail.com>.
Hello,

Cache template can be configured in the following way

<property name="cacheConfiguration">
    <list>
        <bean id="cache-template-bean" abstract="true"
class="org.apache.ignite.configuration.CacheConfiguration">
            <property name="name" value="cachetemplate*"/>
            <property name="cacheMode" value="PARTITIONED" />
            <property name="backups" value="1" />
        </bean>
    </list>
</property>

In that case, you should be able to create a table: 
CREATE TABLE TEST(id LONG, name VARCHAR, PRIMARY KEY (id)) WITH 
template=cachetemplate;

Thanks, 
Slava.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Default Cache template

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi gene,

You just need to create the template in Ignite before it:
https://apacheignite.readme.io/v2.1/docs/distributed-ddl#section-extended-parameters

The template should be registered as the common cache, but with symbol '*'
in its name.

If you are not able to create it from java API or xml config file, you can
use one of the default templates, for example: TEMPLATE=PARTITIONED or
TEMPLATE=REPLICATED

If you still can't use templates. please share what you've already tried.

Evgenii

2018-01-15 19:27 GMT+03:00 gene <ge...@gm.com>:

> Hello,  I'm having difficulties setting the default template while using
> the
> DDL create table.  I've tried multiple ways, however I don't believe I have
> the register cache template part down.  While trying to create any Table w/
> DDL using template=<my template name> I get a cache not found error.
>
> please advise.
>
> -gene
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>