Source:
<code>public Entry<Key,Value> getNext() { long waitTime = INITIAL_WAIT_TIME; long firstSeen = -1; mloop: while (true) { if (!iterator.hasNext()) return null; Entry<Key,Value> entry = iterator.next(); byte[] cf = entry.getKey().getColumnFamilyData().toArray(); byte[] cq = entry.getKey().getColumnQualifierData().toArray(); long colType = entry.getKey().getTimestamp() & ColumnUtil.PREFIX_MASK; if (colType == ColumnUtil.LOCK_PREFIX) { boolean resolvedLock = false; if (firstSeen == -1) { firstSeen = System.currentTimeMillis(); resolvedLock = resolveLock(entry, false); } if (!resolvedLock) { UtilWaitThread.sleep(waitTime); stats.incrementLockWaitTime(waitTime); waitTime = Math.min(MAX_WAIT_TIME, waitTime * 2); LockValue lv = new LockValue(entry.getValue().get()); if (!cache.checkExists(lv.getTransactor())) { <START> stats.incrementDeadRollbacks(); <END> resolveLock(entry, true); } else if ((System.currentTimeMillis() - firstSeen) > aconfig.getRollbackTime()) { stats.incrementTimeoutRollbacks(); resolveLock(entry, true); } } Key k = entry.getKey(); Key start = new Key(k.getRowData().toArray(), cf, cq, k.getColumnVisibilityData().toArray(), Long.MAX_VALUE); try { config = (ScannerConfiguration) config.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } config.setRange(new Range(start, true, config.getRange().getEndKey(), config.getRange().isEndKeyInclusive())); setUpIterator(); continue mloop; } else if (colType == ColumnUtil.DATA_PREFIX) { waitTime = INITIAL_WAIT_TIME; firstSeen = -1; stats.incrementEntriesReturned(1); return entry; } else if (colType == ColumnUtil.WRITE_PREFIX) { if (WriteValue.isTruncated(entry.getValue().get())) { throw new StaleScanException(); } else { throw new IllegalArgumentException(); } } else { throw new IllegalArgumentException(); } } }</code><technical_language>name is misleading. Resolving lock roll roll back. call incrementDeadLocks() incrementTimedOutLocks()</technical_language>

Target:
public Entry<Key,Value> getNext() { long waitTime = INITIAL_WAIT_TIME; long firstSeen = -1; mloop: while (true) { if (!iterator.hasNext()) return null; Entry<Key,Value> entry = iterator.next(); byte[] cf = entry.getKey().getColumnFamilyData().toArray(); byte[] cq = entry.getKey().getColumnQualifierData().toArray(); long colType = entry.getKey().getTimestamp() & ColumnUtil.PREFIX_MASK; if (colType == ColumnUtil.LOCK_PREFIX) { if (firstSeen == -1) { firstSeen = System.currentTimeMillis(); } LockValue lv = new LockValue(entry.getValue().get()); boolean resolvedLock = false; if (!cache.checkExists(lv.getTransactor())) { stats.incrementDeadLocks(); resolvedLock = resolveLock(entry, true); } else if ((System.currentTimeMillis() - firstSeen) > aconfig.getRollbackTime()) { stats.incrementTimedOutLocks(); resolvedLock = resolveLock(entry, true); } if (!resolvedLock) { UtilWaitThread.sleep(waitTime); stats.incrementLockWaitTime(waitTime); waitTime = Math.min(MAX_WAIT_TIME, waitTime * 2); } Key k = entry.getKey(); Key start = new Key(k.getRowData().toArray(), cf, cq, k.getColumnVisibilityData().toArray(), Long.MAX_VALUE); try { config = (ScannerConfiguration) config.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } config.setRange(new Range(start, true, config.getRange().getEndKey(), config.getRange().isEndKeyInclusive())); setUpIterator(); continue mloop; } else if (colType == ColumnUtil.DATA_PREFIX) { waitTime = INITIAL_WAIT_TIME; firstSeen = -1; stats.incrementEntriesReturned(1); return entry; } else if (colType == ColumnUtil.WRITE_PREFIX) { if (WriteValue.isTruncated(entry.getValue().get())) { throw new StaleScanException(); } else { throw new IllegalArgumentException(); } } else { throw new IllegalArgumentException(); } } }