You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by devinbost <de...@gmail.com> on 2019/11/13 18:35:27 UTC

Is there a way to convert a cache (setup from the XML config file) to a table that we can query?

Hi,

We set up a cache in the default-config.xml file, but we're having trouble
getting visibility into the cache's data. We'd like to be able to use SQL
queries (or something we can run in an ad-hoc CLI or web tool) to
occasionally inspect the data. 
1. Is there a way to inspect the data in an ad-hoc way without converting
the cache to a table?
2. How can we convert the cache to a table-representation? If we can do that
without losing data, that would be ideal. (We currently are using native
persistence on the cache.)

Here's the config for the cache. (I'm omitting the other parts of the
default-config.xml file.)

<bean class="org.apache.ignite.configuration.CacheConfiguration">
                <property name="name" value="ignite-internal-cache-0"/>
                <property name="atomicityMode" value="ATOMIC"/>
                <property name="backups" value="2"/>
                <property name="eagerTtl" value="true"/>
                <property name="cacheMode" value="PARTITIONED"/> 
                <property name="statisticsEnabled" value="true"/>
                <property name="expiryPolicyFactory">
                  <bean class="javax.cache.expiry.CreatedExpiryPolicy"
factory-method="factoryOf">
                      <constructor-arg>
                          <bean class="javax.cache.expiry.Duration">
                              <constructor-arg value="HOURS"/>
                              <constructor-arg value="12"/>
                          </bean>
                      </constructor-arg>
                  </bean>
              </property>
            </bean>






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

Re: Is there a way to convert a cache (setup from the XML config file) to a table that we can query?

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

You can't inspect data with SQL if table not present, but you can use
ScanQuery for that.

You can't add tables to already existing caches, unfortunately.

Regards,
-- 
Ilya Kasnacheev


ср, 13 нояб. 2019 г. в 21:35, devinbost <de...@gmail.com>:

> Hi,
>
> We set up a cache in the default-config.xml file, but we're having trouble
> getting visibility into the cache's data. We'd like to be able to use SQL
> queries (or something we can run in an ad-hoc CLI or web tool) to
> occasionally inspect the data.
> 1. Is there a way to inspect the data in an ad-hoc way without converting
> the cache to a table?
> 2. How can we convert the cache to a table-representation? If we can do
> that
> without losing data, that would be ideal. (We currently are using native
> persistence on the cache.)
>
> Here's the config for the cache. (I'm omitting the other parts of the
> default-config.xml file.)
>
> <bean class="org.apache.ignite.configuration.CacheConfiguration">
>                 <property name="name" value="ignite-internal-cache-0"/>
>                 <property name="atomicityMode" value="ATOMIC"/>
>                 <property name="backups" value="2"/>
>                 <property name="eagerTtl" value="true"/>
>                 <property name="cacheMode" value="PARTITIONED"/>
>                 <property name="statisticsEnabled" value="true"/>
>                 <property name="expiryPolicyFactory">
>                   <bean class="javax.cache.expiry.CreatedExpiryPolicy"
> factory-method="factoryOf">
>                       <constructor-arg>
>                           <bean class="javax.cache.expiry.Duration">
>                               <constructor-arg value="HOURS"/>
>                               <constructor-arg value="12"/>
>                           </bean>
>                       </constructor-arg>
>                   </bean>
>               </property>
>             </bean>
>
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>