Re:Re:Re: delete data error
Is there any suggestion? At 2018-01-18 09:56:51, "Lucky"wrote: This did not happen every time. When I run it several times,it will happen .And when it happened, then it will happened every time. This table is simple; I insert some data and when I finish the job,I will delete the data. Thanks. At 2018-01-17 20:20:34, "ilya.kasnacheev" wrote: >Hello Lucky! > >Does this happen every time when you try, or it is a one-time occurrence? > >Can you please share logs from your nodes and cache/table configurations? >Ideally a small reproducer project. > >Regards, > > >
.Net standard target for Ignite.Net client
All, Are there any plans for porting the current Ignite.Net client to .Net Standard? Has anyone investigated how much effort there would be involved? We would like to use dockerised deployments and as we use a .Net development stack .Net Standard is our target platform for those deployments. Thanks, Raymond.
Option meta schema in cache level?
I'm trying to use Binary Marshaller to replace old OptimizedMarshaller which is really a pain for deployment. But according to document of Type Metadata, it could be changed at runtime, that means if I access to a 3rd party cache which was created by someone else without explicit type settings, I'll have to get a sample row to retrieve its type manually prior to further operations. is this correct? why not just set a default optional meta type in cache level? as an option, it won't be negative for dynamic row schema. #access to a cache 'SQL_PUBLIC_CITY' (created by JDBC 'Create Table' statement) and do some normal operations. #GetSchema() is weird public class App { private static SchemaType schema=null; public static void main( String[] args ) { Ignite ignite = Ignition.start("C://apache//ignite//apache-ignite-fabric-2.2.0-bin//config//client.xml"); CacheConfigurationcfg = new CacheConfiguration ("SQL_PUBLIC_CITY"); IgniteCache cache = ignite.getOrCreateCache(cfg).withKeepBinary(); if(schema==null) schema=GetSchema(cache); Put(ignite,cache,4L,"Los Angeles"); GetAll(cache); Get(ignite,cache,4L); Query(cache,4L); ignite.close(); } public static void GetAll(IgniteCache cache) { Iterator > itr = cache.iterator(); while(itr.hasNext()){ Cache.Entry item = itr.next(); System.out.println("id="+item.getKey().field("id")+" KeyType="+item.getKey().type().typeName().toString()+" V="+item.getKey().type().field("id")); System.out.println("CITY="+item.getValue().field("name")+ " of id="+item.getValue().field("id")); } } public static SchemaType GetSchema(IgniteCache cache) { SchemaType sch=new SchemaType(); Cache.Entry item = cache.iterator().next(); sch.KeyType=item.getKey().type().typeName(); sch.KeyFields=item.getKey().type().fieldNames(); sch.ValueType=item.getValue().type().typeName(); sch.ValueFields=item.getValue().type().fieldNames(); return sch; } public static void Get(Ignite ignite, IgniteCache cache, Long CityId) { BinaryObjectBuilder keyBuilder = ignite.binary().builder(schema.KeyType) .setField("id", CityId); BinaryObject value = cache.get(keyBuilder.build()); if(value!=null) System.out.println("CITY="+value.field("name")); } public static void Put(Ignite ignite, IgniteCache cache,Long CityId,String CityName) { BinaryObjectBuilder keyBuilder = ignite.binary().builder(schema.KeyType) .setField("id", CityId); BinaryObjectBuilder valueBuilder = ignite.binary().builder(schema.ValueType) .setField("name", CityName); cache.put(keyBuilder.build(),valueBuilder.build()); } public static void Query(IgniteCache cache, Long CityId) { QueryCursor > query = cache.query(new SqlFieldsQuery("select * from City where id="+CityId)); System.out.println(query.getAll()); } } -- Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Re: query on BinaryObject index and table
Hi Denis, This is my code: CacheConfigurationcacheCfg = new CacheConfiguration<>(ORG_CACHE); cacheCfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); cacheCfg.setBackups(1); cacheCfg .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cacheCfg.setIndexedTypes(Long.class, BinaryObject.class); IgniteCache cache = ignite.getOrCreateCache(cacheCfg); if ( UPDATE ) { System.out.println("Populating the cache..."); try (IgniteDataStreamer streamer = ignite.dataStreamer(ORG_CACHE)) { streamer.allowOverwrite(true); IgniteBinary binary = ignite.binary(); BinaryObjectBuilder objBuilder = binary.builder(ORG_CACHE); ; for ( long i = 0; i < 100; i++ ) { streamer.addData(i, objBuilder.setField("id", i) .setField("name", "organization-" + i).build()); if ( i > 0 && i % 100 == 0 ) System.out.println("Done: " + i); } } } IgniteCache binaryCache = ignite.cache(ORG_CACHE).withKeepBinary(); BinaryObject binaryPerson = binaryCache.get(54l); System.out.println("name " + binaryPerson.field("name")); Not sure, If I am missing some context here , if I have to use sqlquery , what table name should I specify - I did not create table explicitly, do I need to that? How would I create the index? Thanks, Rajesh On Sun, Jan 21, 2018 at 12:25 PM, Denis Magda wrote: > > > > On Jan 20, 2018, at 7:20 PM, Rajesh Kishore > wrote: > > > > Hi, > > > > I have requirement that my schema is not fixed , so I have to use the > BinaryObject approach instead of fixed POJO > > > > I am relying on OOTB file system persistence mechanism > > > > My questions are: > > - How can I specify the indexes on BinaryObject? > > https://apacheignite-sql.readme.io/docs/create-index > https://apacheignite-sql.readme.io/docs/schema-and-indexes > > > - If I have to use sql query for retrieving objects , what table name > should I specify, the one which is used for cache name does not work > > > > Was the table and its queryable fields/indexes created with CREATE TABLE > or Java annotations/QueryEntity? > > If the latter approach was taken then the table name corresponds to the > Java type name as shown in this doc: > https://apacheignite-sql.readme.io/docs/schema-and-indexes > > — > Denis > > > -Rajesh > >