@Test public void testScanWithEmptyRowLeftAfterLockClean() throws Exception { prepareScanData(new ColumnCoordinate[]{}); writeLockAndData(COLUMN_WITH_ANOTHER_ROW, lastTs(prewriteTs)); Mockito.when(mockRegister.isWorkerAlive(TestBase.CLIENT_TEST_ADDRESS)).thenReturn(false); ThemisScan pScan = prepareScan(TRANSACTION_COLUMNS); pScan.setCaching(10); ThemisScanner scanner = transaction.getScanner(TABLENAME, pScan); checkAndCloseScanner(scanner); prepareScanData(new ColumnCoordinate[]{COLUMN, COLUMN_WITH_ANOTHER_FAMILY, COLUMN_WITH_ANOTHER_QUALIFIER}); writeLockAndData(COLUMN_WITH_ANOTHER_ROW, lastTs(prewriteTs)); Mockito.when(mockRegister.isWorkerAlive(TestBase.CLIENT_TEST_ADDRESS)).thenReturn(false); pScan = prepareScan(TRANSACTION_COLUMNS); pScan.setCaching(10); scanner = transaction.getScanner(TABLENAME, pScan); checkResultForROW(scanner.next()); checkAndCloseScanner(scanner); }
public Result next() throws IOException { long beginTs = System.nanoTime(); Result pResult = null; boolean lockClean = false; try { pResult = this.scanner.next(); if (pResult == null) { return null; } if (ThemisCpUtil.isLockResult(pResult)) { lockClean = true; Get rowGet = createGetFromScan(scan, pResult.getRow()); pResult = transaction.tryToCleanLockAndGetAgain(tableName, rowGet, pResult.list()); if (pResult.isEmpty()) { return next(); } else { return pResult; } } return pResult; } finally { ThemisStatistics.updateLatency(ThemisStatistics.getStatistics().nextLatency, beginTs); ThemisStatistics.logSlowOperation("themisNext", beginTs, "row=" + pResult + ", lockClean=" + lockClean); } }
ThemisScanner extends AbstractClientScanner { public Result next() throws IOException { long beginTs = System.nanoTime(); Result pResult = null; boolean lockClean = false; try { pResult = this.scanner.next(); if (pResult == null) { return null; } if (ThemisCpUtil.isLockResult(pResult)) { lockClean = true; Get rowGet = createGetFromScan(scan, pResult.getRow()); pResult = transaction.tryToCleanLockAndGetAgain(tableName, rowGet, pResult.list()); if (pResult.isEmpty()) { return next(); } else { return pResult; } } return pResult; } finally { ThemisStatistics.updateLatency(ThemisStatistics.getStatistics().nextLatency, beginTs); ThemisStatistics.logSlowOperation("themisNext", beginTs, "row=" + pResult + ", lockClean=" + lockClean); } } }
ThemisScanner extends AbstractClientScanner { public Result next() throws IOException { long beginTs = System.nanoTime(); Result pResult = null; boolean lockClean = false; try { pResult = this.scanner.next(); if (pResult == null) { return null; } if (ThemisCpUtil.isLockResult(pResult)) { lockClean = true; Get rowGet = createGetFromScan(scan, pResult.getRow()); pResult = transaction.tryToCleanLockAndGetAgain(tableName, rowGet, pResult.list()); if (pResult.isEmpty()) { return next(); } else { return pResult; } } return pResult; } finally { ThemisStatistics.updateLatency(ThemisStatistics.getStatistics().nextLatency, beginTs); ThemisStatistics.logSlowOperation("themisNext", beginTs, "row=" + pResult + ", lockClean=" + lockClean); } } ThemisScanner(final byte[] tableName, final Scan scan, final Transaction transaction); }
ThemisScanner extends AbstractClientScanner { public Result next() throws IOException { long beginTs = System.nanoTime(); Result pResult = null; boolean lockClean = false; try { pResult = this.scanner.next(); if (pResult == null) { return null; } if (ThemisCpUtil.isLockResult(pResult)) { lockClean = true; Get rowGet = createGetFromScan(scan, pResult.getRow()); pResult = transaction.tryToCleanLockAndGetAgain(tableName, rowGet, pResult.list()); if (pResult.isEmpty()) { return next(); } else { return pResult; } } return pResult; } finally { ThemisStatistics.updateLatency(ThemisStatistics.getStatistics().nextLatency, beginTs); ThemisStatistics.logSlowOperation("themisNext", beginTs, "row=" + pResult + ", lockClean=" + lockClean); } } ThemisScanner(final byte[] tableName, final Scan scan, final Transaction transaction); static Get createGetFromScan(Scan scan, byte[] rowkey); Result next(); void close(); @Override Result[] next(int nbRows); }
ThemisScanner extends AbstractClientScanner { public Result next() throws IOException { long beginTs = System.nanoTime(); Result pResult = null; boolean lockClean = false; try { pResult = this.scanner.next(); if (pResult == null) { return null; } if (ThemisCpUtil.isLockResult(pResult)) { lockClean = true; Get rowGet = createGetFromScan(scan, pResult.getRow()); pResult = transaction.tryToCleanLockAndGetAgain(tableName, rowGet, pResult.list()); if (pResult.isEmpty()) { return next(); } else { return pResult; } } return pResult; } finally { ThemisStatistics.updateLatency(ThemisStatistics.getStatistics().nextLatency, beginTs); ThemisStatistics.logSlowOperation("themisNext", beginTs, "row=" + pResult + ", lockClean=" + lockClean); } } ThemisScanner(final byte[] tableName, final Scan scan, final Transaction transaction); static Get createGetFromScan(Scan scan, byte[] rowkey); Result next(); void close(); @Override Result[] next(int nbRows);  }