I am trying to Store a Person Object in Ignite Cache in PARTITIONED Mode with backup as 1. There are 3 server nodes to cache Data
public class PersonImpl{
private String name;
private HashMap<Integer,String> attr = new HashMap<>();
private HashMap<Integer,String> attr1 = new HashMap<>();
private ArrayList<Integer> a;
private ArrayList<Integer> b;
}
Including HashMap and ArrayList in the the Object gives duplicates using different Query features in Ignite while removing HashMap and ArrayList does not give duplicates. Is this issue related with Collections Object? Also changing the backup from 1 to 0 do not give inconsistent results. Did Anyone faced similar issue and how to resolve it
Below is the code that I am using to query :
sqlQuery(PersonImpl.class,"true");
public List<V> sqlQuery(Class<V> persistentClass, String t){
SqlQuery<K,V> sqlQuery = new SqlQuery<>(persistentClass,t);
List<V> values = new ArrayList<V>();
QueryCursor<Entry<K,V>> queryCursor= getCache.query(sqlQuery);
for(Entry<K,V> entry : queryCursor){
values.add(entry.getValue());
}
return values;
}
To store the Object in Cache
store(T obj){
put(obj.getAffinityKey(), obj);
}