use of org.apache.ignite.internal.util.GridSerializableMap in project ignite by apache.
the class GridCacheAdapter method warnIfUnordered.
/**
* Checks that given map is sorted or otherwise constant order, or processed inside deadlock-detecting transaction.
*
* Issues developer warning otherwise.
*
* @param m Map to examine.
*/
protected void warnIfUnordered(Map<?, ?> m, BulkOperation op) {
if (ctx.atomic())
return;
if (m == null || m.size() <= 1)
return;
if (m instanceof SortedMap || m instanceof GridSerializableMap)
return;
Transaction tx = ctx.kernalContext().cache().transactions().tx();
if (tx != null && !op.canBlockTx(tx.concurrency(), tx.isolation()))
return;
LT.warn(log, "Unordered map " + m.getClass().getName() + " is used for " + op.title() + " operation on cache " + name() + ". " + "This can lead to a distributed deadlock. Switch to a sorted map like TreeMap instead.");
}
Aggregations