TxLocksResponse res = new TxLocksResponse(); IgniteTxKey txKey = txEntry.txKey(); if (res.txLocks(txKey) == null) { GridCacheMapEntry e = (GridCacheMapEntry)txEntry.cached(); loc.owner() ? TxLock.OWNERSHIP_OWNER : TxLock.OWNERSHIP_CANDIDATE); res.addTxLock(txKey, txLock); TxLock.OWNERSHIP_REQUESTED); res.addTxLock(txKey, txLock); res.addKey(txKey);
res.futureId(req.futureId()); res.prepareMarshal(cctx); TxLocksResponse res = (TxLocksResponse)msg; long futId = res.futureId();
/** * @param res Response. */ public void onResult(UUID nodeId, TxLocksResponse res) { boolean set = compareAndSet(nodeId, null); if (res != null && set) { if (res.classError() != null) { IgniteLogger log = cctx.kernalContext().log(this.getClass()); U.warn(log, "Failed to finish deadlock detection due to an error: " + nodeId); onDone(); } else detect(res); } else onDone(); }
/** * @param res Response. */ private void detect(TxLocksResponse res) { assert res != null; merge(res); updateWaitForGraph(res.txLocks()); List<GridCacheVersion> cycle = findCycle(wfg, txId); if (cycle != null) onDone(new TxDeadlock(cycle, txs, txLockedKeys, txRequestedKeys)); else map(res.keys(), res.txLocks()); }
TxLocksRequest req = (TxLocksRequest)msg; TxLocksResponse res = new TxLocksResponse(); res.futureId(req.futureId()); TxLocksResponse res = (TxLocksResponse)msg; TxDeadlockFuture fut = future(res.futureId());
TxLocksResponse msg = new TxLocksResponse(); msg.addKey(cctx.txKey(key)); msg.prepareMarshal(cctx.shared());
/** {@inheritDoc} */ @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { writer.setBuffer(buf); if (!super.writeTo(buf, writer)) return false; if (!writer.isHeaderWritten()) { if (!writer.writeHeader(directType(), fieldsCount())) return false; writer.onHeaderWritten(); } switch (writer.state()) { case 3: if (!writer.writeLong("futId", futId)) return false; writer.incrementState(); case 4: if (!writer.writeObjectArray("locksArr", locksArr, MessageCollectionItemType.MSG)) return false; writer.incrementState(); case 5: if (!writer.writeObjectArray("nearTxKeysArr", nearTxKeysArr, MessageCollectionItemType.MSG)) return false; writer.incrementState(); case 6: if (!writer.writeObjectArray("txKeysArr", txKeysArr, MessageCollectionItemType.MSG)) return false; writer.incrementState(); } return true; }
msg = new TxLocksResponse();
@Override public void onMessage(UUID nodeId, Object msg, byte plc) { if (msg instanceof TxLocksResponse) { try { ((TxLocksResponse)msg).finishUnmarshal(clientCtx, clientCtx.deploy().globalLoader()); res.set(true); } catch (Exception e) { log.error("Message unmarshal failed", e); } finally { latch.countDown(); } } } });
TxLocksRequest req = (TxLocksRequest)msg; TxLocksResponse res = new TxLocksResponse(); res.futureId(req.futureId()); TxLocksResponse res = (TxLocksResponse)msg; TxDeadlockFuture fut = future(res.futureId());
/** * @param res Response. */ private void detect(TxLocksResponse res) { assert res != null; merge(res); updateWaitForGraph(res.txLocks()); List<GridCacheVersion> cycle = findCycle(wfg, txId); if (cycle != null) onDone(new TxDeadlock(cycle, txs, txLockedKeys, txRequestedKeys)); else map(res.keys(), res.txLocks()); }
/** {@inheritDoc} */ @Override public boolean writeTo(ByteBuffer buf, MessageWriter writer) { writer.setBuffer(buf); if (!super.writeTo(buf, writer)) return false; if (!writer.isHeaderWritten()) { if (!writer.writeHeader(directType(), fieldsCount())) return false; writer.onHeaderWritten(); } switch (writer.state()) { case 2: if (!writer.writeLong("futId", futId)) return false; writer.incrementState(); case 3: if (!writer.writeObjectArray("locksArr", locksArr, MessageCollectionItemType.MSG)) return false; writer.incrementState(); case 4: if (!writer.writeObjectArray("nearTxKeysArr", nearTxKeysArr, MessageCollectionItemType.MSG)) return false; writer.incrementState(); case 5: if (!writer.writeObjectArray("txKeysArr", txKeysArr, MessageCollectionItemType.MSG)) return false; writer.incrementState(); } return true; }
msg = new TxLocksResponse();
TxLocksResponse res = new TxLocksResponse(); IgniteTxKey txKey = txEntry.txKey(); if (res.txLocks(txKey) == null) { GridCacheMapEntry e = (GridCacheMapEntry)txEntry.cached(); loc.owner() ? TxLock.OWNERSHIP_OWNER : TxLock.OWNERSHIP_CANDIDATE); res.addTxLock(txKey, txLock); TxLock.OWNERSHIP_REQUESTED); res.addTxLock(txKey, txLock); res.addKey(txKey);
res.futureId(req.futureId()); res.prepareMarshal(cctx); TxLocksResponse res = (TxLocksResponse)msg; long futId = res.futureId();
/** * @param res Response. */ public void onResult(UUID nodeId, TxLocksResponse res) { boolean set = compareAndSet(nodeId, null); if (res != null && set) { if (res.classError() != null) { IgniteLogger log = cctx.kernalContext().log(this.getClass()); U.warn(log, "Failed to finish deadlock detection due to an error: " + nodeId); onDone(); } else detect(res); } else onDone(); }