ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgenii Zhuravlev <e.zhuravlev...@gmail.com>
Subject Re: How to configure a QueryEntity for a BinaryObject
Date Wed, 20 Sep 2017 07:21:38 GMT
If you're configuring QueryEntity, you don't need to add to the
configuration indexedTypes too. It's just different ways to configure
Indexes and queryable fields.

Evgenii

2017-09-20 10:10 GMT+03:00 Savagearts <eisen.zhong@huawei.com>:

> I failed to configure the binaryobject ignitecache. My cache configuration
> as
> following:
>             <bean
> class="org.apache.ignite.configuration.CacheConfiguration">
>                 <property name="name" value="cache1" />
>                 <property name="storeKeepBinary" value="true" />
>                 <property name="queryEntities">
>                     <bean class="org.apache.ignite.cache.QueryEntity">
>                         <property name="keyType" value="java.lang.String"/>
>                         <property name="valueType" value="com.Foo.Bar" />
>                         <property name="fields">
>                             <map>
>                                 <entry key="name" value="java.lang.String"
> />
>                                 <entry key="bar.name"
> value="java.lang.String" />
>                             </map>
>                         </property>
>                         <property name="indexes">
>                             <list>
>                                 <value>name</value>
>                             </list>
>                         </property>
>                     </bean>
>                 </property>
>                 <property name="indexedTypes">
>                     <list>
>                         <value>java.lang.String</value>
>                         <value>org.apache.ignite.
> binary.BinaryObject</value>
>                     </list>
>                 </property>
>             </bean>
>
> I can apply BinaryObjectBuilder to build a binaryobject with type
> name:"com.example.Foo" and put it in the cache. But when i apply SqlQuery,
> a
> IgniteSQLException is thrown with message:"Failed to find SQL table for
> type: com.example.Foo". But when i change the cache configuration's
> indexedTypes with com.example.Foo, The ignite fail to create such a cache,
> cause of "com.example.Foo" doesn't exist. My binary object builder code as
> following:
>        final  Collection<BinaryObject> result = new ArrayList<>(numbers);
>         IntStream.range(1,numbers).forEach((i)->{
>             BinaryObjectBuilder fooBuilder
> =ignite.binary().builder("com.example.Foo");
>             fooBuilder.setField("name","foo"+i).setField("age",i);
>             result.add(fooBuilder.build());
>         });
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Mime
View raw message