简体   繁体   English

如何使用 pyignite 访问我的 ignite 缓存

[英]How do I access my ignite cache using pyignite

I am running an Ignite++ node using the following cache configuration我正在使用以下缓存配置运行 Ignite++ 节点

<property name="cacheConfiguration">
    <list>
        <bean class="org.apache.ignite.configuration.CacheConfiguration">
            <property name="name" value="CACHE_SCHEMA"/>

            ....

            <property name="queryEntities">
              <list>
                <bean class="org.apache.ignite.cache.QueryEntity">
                  <property name="keyType" value="java.lang.String"/>
                  <property name="valueType" value="CACHE_NAME"/>

                  <property name="fields">
                    <map>
                      <entry key="Ref" value="java.lang.Integer"/>
                    </map>
                  </property>
                </bean>
              </list>
            </property>
        </bean>
    </list>
</property>

Using Ignite++ I can put & get data to this cache just fine (I very much follow the put_and_get example that comes with ignite).使用 Ignite++ 我可以将数据放入和获取到这个缓存就好了(我非常遵循 ignite 附带的 put_and_get 示例)。 However, I can't see to do the same using pyignite.但是,我看不到使用 pyignite 做同样的事情。

>>> from pyignite import Client
>>> igniteClient = Client()
>>> igniteClient.connect('10.1.8.166', 10800)
>>> igniteClient.get_cache_names()
['CACHE_SCHEMA']

How do I Put & Get into CACHE_NAME when that isn't there?当 CACHE_NAME 不存在时,我如何放入并进入 CACHE_NAME?

Well, the cache is named CACHE_SCHEMA .好吧,缓存被命名为CACHE_SCHEMA

It's the value type, and table name, that are called CACHE_NAME .值类型和表名称为CACHE_NAME

So for put-get you need to use former, for any SQL including INSERT 's, the latter.所以对于 put-get 你需要使用前者,对于包括INSERT在内的任何 SQL,后者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM