I'm trying to selectively initialize pieces of my IgniteCache that is
backed by a postgres database. When I use loadCache() with no arguments,
the entire cache loads fine. However, the table I'm loading is very large,
and I want to use an IgniteBiPredicate to only load the pieces I care
about. Whenever I try this, I get ClassCastExceptions. Here is an example
of what I'm trying to do:
public void initFoo(int key){
IgniteCache<Integer, Foo> myCache = getCache(Foo.class);
if (myCache != null){
myCache.loadCache(new IgniteBiPredicate<Integer, Foo>() {
@Override
public boolean apply(Integer integer, Foo foo){
return integer == key;
}
}, null);
}
}
Whenever I try this, I get ClassCastExceptions on the apply method of this
bipredicate, saying that BinaryObjectImpl cannot be cast to Foo--why is
what's coming out of the cache a BinaryObjectImpl? How am I supposed to
use the IgniteBiPredicate?