Dennis,

Sorry for my misleading.  The slow thing is register CQ but not connect to
cluster (this might take round 1 min). 

Thanks for your remind and after removed intial query, the whole process
become very quick and there is no more "binary metadata update messages".

So if there do have initial query and remotefilter, does it means those meta
data info need exchange among the whole ignite cluster?

I'm sorry for security reason, I cannot upload the full log here but I tried
to show some code structure here

public abstract class AbstractIgniteListeningService<T>
{
    public void registerCache() throws IgniteException
    {
        try
        {

            final IgniteCache<Object, BinaryObject> cache =
ignite.cache("SQL_PUBLIC_" +
             getTableName()).withKeepBinary();
            final ContinuousQuery<Object, BinaryObject> qry = new
ContinuousQuery<Object, BinaryObject>();
//           qry.setInitialQuery(new ScanQuery<Object, BinaryObject>(new
IgniteBiPredicate<Object, BinaryObject>()
//            {
//                @Override
//                public boolean apply(Object key, BinaryObject val)
//                {
//                    return !(val.field("FROM_RDC")).equals(localRDC);
//                }
//            }));
            // qry.setRemoteFilterFactory(new
Factory<CacheEntryEventFilter&lt;Object, BinaryObject>>()
            // {
            // @Override
            // public CacheEntryEventFilter<Object, BinaryObject> create()
            // {
            // return new CacheEntryEventFilter<Object, BinaryObject>()
            // {
            // @Override
            // public boolean evaluate(CacheEntryEvent<? extends Object, ?
extends BinaryObject> e)
            // {
            // return !(e.getValue().<String>
field("FROM_RDC")).equals(localRDC);
            // }
            // };
            // }
            // });
            qry.setLocalListener(new CacheEntryUpdatedListener<Object,
BinaryObject>()
            {
                @Override
                public void onUpdated(Iterable<CacheEntryEvent&lt;? extends
Object, ? extends BinaryObject>> evts)
                {
                    List<T> resultList = new ArrayList<T>(0);
                    int length = 0;
                    for (CacheEntryEvent<? extends Object, ? extends
BinaryObject> e : evts)
                    {
                        resultList.add(buildObject(e));
                    }
                    writeObject(assemblyObject(resultList));
                }
            });
            if (REAL_TIME_SYNC.contains(getTableName()))
            {
                qry.setTimeInterval(1000L);
            }
            else
            {
                qry.setTimeInterval(300000L);
                qry.setPageSize(1000);
            }
            cache.query(qry);
}
}

Basically,  1. intial query and remotefilter have same logic and just filter
some record according field value
2. in locallisnter,  writeObject() using mybatis write data to local DB. 
All class shows in "binary metadata update messages" actually in
writeObject() method, so why those stuff need to exchange among cluster?

Thanks,
Jin.



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

Reply via email to