Source:
<code>private boolean exceedsCappedLimit() throws NoConnectionsException, IOException, ProcCallException { boolean ret = false; VoltTable partitions = client.callProcedure("@GetPartitionKeys", "INTEGER").getResults()[0]; long count = TxnId2Utils.doAdHoc(client,"SELECT COUNT(*) FROM capr;").getResults()[0].fetchRow(0).getLong(0); if (count > 10) { try { Thread.sleep(1000); } catch (Exception e2) count = TxnId2Utils.doAdHoc(client,"SELECT COUNT(*) FROM capr;").getResults()[0].fetchRow(0).getLong(0); <START> log.warn("Replicated table CAPR has more rows ("+count+") than the limit set by capped collections (10) retrying in 1 sec"); <END> if ( count > 10 ) { log.error("Replicated table CAPR has more rows ("+count+") than the limit set by capped collections (10)"); ret = true; } } while (partitions.advanceRow()) { long id = partitions.getLong(0); long key = partitions.getLong(1); boolean retry = true; while ( true ) { count = client.callProcedure("CAPPCountPartitionRows",key).getResults()[0].fetchRow(0).getLong(0); if (count > 10 && retry ) { retry = false; log.warn("Replicated table CAPP has more rows ("+count+") than the limit set by capped collections (10) on partition "+id+" , retrying in 1 sec"); try { Thread.sleep(1000); } catch (Exception e2) } else if (count > 10) { log.error("Replicated table CAPP has more rows ("+count+") than the limit set by capped collections (10) on partition "+id); ret = true; break; } else { break; } } } return ret; }</code><technical_language>move log.warn sleep</technical_language>

Target:
private boolean exceedsCappedLimit() throws NoConnectionsException, IOException, ProcCallException { VoltTable partitions = client.callProcedure("@GetPartitionKeys", "INTEGER").getResults()[0]; long count = TxnId2Utils.doAdHoc(client,"SELECT COUNT(*) FROM capr;").getResults()[0].fetchRow(0).getLong(0); if (count > 10) { log.warn("CappedTableLoader Replicated table CAPR has more rows ("+count+") than the limit set by capped collections (10) retrying in 1 sec"); try { Thread.sleep(1000); } catch (Exception e2) count = TxnId2Utils.doAdHoc(client,"SELECT COUNT(*) FROM capr;").getResults()[0].fetchRow(0).getLong(0); if ( count > 10 ) { log.error("CappedTableLoader Replicated table CAPR has more rows ("+count+") than the limit set by capped collections (10)"); return(true); } else { log.info("CappedTableLoader Replicated table CAPR has been limited to "+count+" rows"); } } while (partitions.advanceRow()) { long id = partitions.getLong(0); long key = partitions.getLong(1); count = client.callProcedure("CAPPCountPartitionRows",key).getResults()[0].fetchRow(0).getLong(0); if (count > 10) { log.warn("CappedTableLoader Partitioned table CAPP has more rows ("+count+") than the limit set by capped collections (10) on partition "+id+" , retrying in 1 sec"); try { Thread.sleep(1000); } catch (Exception e2) count = client.callProcedure("CAPPCountPartitionRows",key).getResults()[0].fetchRow(0).getLong(0); if (count > 10) { log.error("CappedTableLoader Partitioned table CAPP has more rows ("+count+") than the limit set by capped collections (10) on partition "+id); return(true); } else { log.info("CappedTableLoader Partitioned table CAPP partition "+id+" has been limited to "+count+" rows"); } } } return(false); }