/** {@inheritDoc} */ @Override public String toString() { return S.toString(DiscoCache.class, this, "allNodesWithDaemons", U.toShortString(allNodes)); } }
/** * Log task mapped. * * @param log Logger. * @param clazz Task class. * @param nodes Mapped nodes. */ public static void logMapped(@Nullable GridLogger log, Class<?> clazz, Collection<GridNode> nodes) { log0(log, U.currentTimeMillis(), String.format("[%s]: MAPPED: %s", clazz.getSimpleName(), U.toShortString(nodes))); }
throw new GridException("Failed to map key to node (is cache with given name started?) [gridName=" + ctx.gridName() + ", key=" + key + ", cacheName=" + cacheName + ", nodes=" + U.toShortString(nodes) + ']'); ", nodes=" + U.toShortString(nodes) + ", node=" + U.toShortString(node) + ']');
U.toShortString(nearNode) + ", req=" + req + ']', e);
if (log.isDebugEnabled()) log.debug("Primary node mismatch for unlock [entry=" + cached + ", expected=" + ctx.nodeId() + ", actual=" + U.toShortString(primary) + ']'); log.debug("Mapping entry to DHT nodes [nodes=" + U.toShortString(dhtNodes) + ", entry=" + cached + ']'); log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) + ", entry=" + cached + ']');
log.debug("Sending cache message [msg=" + msg + ", nodes=" + U.toShortString(nodes) + ']'); if (log.isDebugEnabled()) log.debug("Message will not be sent because all nodes left topology [msg=" + msg + ", nodes=" + U.toShortString(nodes) + ']'); if (log.isDebugEnabled()) log.debug("Message will not be sent because all nodes left topology [msg=" + msg + ", nodes=" + U.toShortString(nodes) + ']'); log.debug("Message send will be retried [msg=" + msg + ", nodes=" + U.toShortString(nodes) + ", leftIds=" + leftIds + ']'); log.debug("Sent cache message [msg=" + msg + ", nodes=" + U.toShortString(nodes) + ']');
onDone(new GridTopologyException("Failed to remap key to a new node after " + MAX_REMAP_CNT + " attempts (key got remapped to the same node) [key=" + key + ", node=" + U.toShortString(node) + ", mappings=" + mapped + ']'));
if (log.isDebugEnabled()) log.debug("Failed to get affinity from node (will retry) [cache=" + cacheName + ", node=" + U.toShortString(n) + ", msg=" + e.getMessage() + ']');
log.debug("Sending cache message [msg=" + msg + ", node=" + U.toShortString(node) + ']'); log.debug("Sent cache message [msg=" + msg + ", node=" + U.toShortString(node) + ']');
", part=" + locPart + ", owners=" + owners + ", allOwners=" + U.toShortString(top.owners(part)) + ']');
onDone(new GridTopologyException("Failed to remap key to a new node after " + MAX_REMAP_CNT + " attempts (key got remapped to the same node) [key=" + key + ", node=" + U.toShortString(primary) + ", mappings=" + mapped + ']'));
U.toShortString(nearNode) + ", req=" + req + ']', e);
log.debug("Mapping entry to DHT nodes [nodes=" + U.toShortString(dhtNodes) + ", entry=" + entry + ']'); log.debug("Mapping entry to near nodes [nodes=" + U.toShortString(nearNodes) + ", entry=" + entry + ']');
/** * @param entry Transaction entry. * @param topVer Topology version. * @param cur Current mapping. * @throws GridException If transaction is group-lock and local node is not primary for key. * @return Mapping. */ private GridDistributedTxMapping<K, V> map(GridCacheTxEntry<K, V> entry, long topVer, GridDistributedTxMapping<K, V> cur) throws GridException { List<GridNode> nodes = cctx.affinity().nodes(entry.key(), topVer); txMapping.addMapping(nodes); GridNode primary = F.first(nodes); assert primary != null; if (log.isDebugEnabled()) log.debug("Mapped key to primary node [key=" + entry.key() + ", part=" + cctx.affinity().partition(entry.key()) + ", primary=" + U.toShortString(primary) + ", topVer=" + topVer + ']'); if (tx.groupLock() && !primary.isLocal()) throw new GridException("Failed to prepare group lock transaction (local node is not primary for " + " key) [key=" + entry.key() + ", primaryNodeId=" + primary.id() + ']'); // Must re-initialize cached entry while holding topology lock. entry.cached(cctx.colocated().entryExx(entry.key(), topVer, true), entry.keyBytes()); if (cur == null || !cur.node().id().equals(primary.id())) cur = new GridDistributedTxMapping<>(primary); cur.add(entry); entry.nodeId(primary.id()); return cur; }
Exception err = errs != null ? U.exceptionWithSuppressed("Failed to send message to next node [msg=" + msg + ", next=" + U.toShortString(next) + ']', errs) : null;
log.debug("Mapped key to primary node [key=" + entry.key() + ", part=" + cctx.affinity().partition(entry.key()) + ", primary=" + U.toShortString(primary) + ", topVer=" + topVer + ']');