ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wychoi <wyc...@bistel.co.kr>
Subject Re: remove cache on high-speed
Date Wed, 25 Nov 2015 09:03:41 GMT
I have applied cache.remove() only

confirm  cache.size(CachePeekMode.ALL);   ==> 0

but a few cache revive

I use ContinuousQuery for getting cache 
Is there relationship because using the Continuous Query?


ContinuousQuery<AffinityKey, XObject> query = new ContinuousQuery<>();
query.setLocal(true);
query.setTimeInterval(300);
query.setPageSize(512);

SqlQuery sqlQuery = new SqlQuery<AffinityKey, XObject>(XObject.class,
"sequence > 1");
sqlQuery.setLocal(true);
sqlQuery.setPageSize(512);

query.setInitialQuery(sqlQuery);

query.setLocalListener(new CacheEntryUpdatedListener<AffinityKey, XObject>()
{
	@Override
	public void onUpdated(Iterable<CacheEntryEvent&lt;? extends AffinityKey, ?
extends XObject>> events) {
		
		for (CacheEntryEvent<? extends AffinityKey, ? extends XObject> entry :
events) {
				
			Long key = (Long)entry.getKey().key();
			int part =  (int)entry.getKey().affinityKey();
			XObject wrap = entry.getValue();
			// put data for other source
		}
	}
}

QueryCursor<Cache.Entry&lt;AffinityKey, XObject>> cur = cache.query(query);
for (Cache.Entry<AffinityKey, XObject> entry : cur) {

	Long key = (Long) entry.getKey().key();
	int part =  (int)entry.getKey().affinityKey();
	XObject wrap = entry.getValue();
	// put data for other source
	
}



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/remove-cache-on-high-speed-tp2039p2055.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message