1. Peer class loading is applicable only to computational code and not
to the cache key and value types. In your case enabling peer class loading
helped you to auto-deploy your IgniteCallable but it is not supposed to
auto-deploy your Person cache value type.
2. You can avoid manually deploying Person class if you use Ignite
Binary Object API. Your code has to be fixed like this:
IgniteCache<UUID, IgniteBinary> igniteCache =
ignite.getOrCreateCache(CACHE_NAME);
igniteCache.put(key, ignite.binary().toBinary(person));
String fullName = ignite.compute().affinityCall(
CACHE_NAME,
person.getId(),
new IgniteCallable<String>() {
@Override
public String call() {
return igniteCache.invoke(key, (CacheEntryProcessor<UUID,
BinaryObject, String>)(entry, arguments) -> {
if (entry.exists() && entry.getValue() != null) {
BinaryObject personCached = entry.getValue();
return personCached.field("firstName" + " "
+ personCached.field("lastName");
}
return null;
});
}
}
);
System.out.println("fullName = " + fullName);