@Override final public Handle start(String module, String sqlKey, String rawSql) { final List<Handle> handles = Lists.newArrayListWithCapacity(sqlTimers.size()); for (SqlTimer sqlTimer : sqlTimers) { handles.add(sqlTimer.start(module, sqlKey, rawSql)); } return () -> { for (Handle handle : handles) { handle.stop(); } }; } }
/** * @see AgnosticIterator for caveats on use. * Note this expects to be called by visitAndClose()! If not, the timer will never get * initialized and close() will throw an exception. */ @Override public Iterator<AgnosticLightResultRow> iterator() { this.timerKey = sqlTimerFactory.start(timingModule, sqlString.getKey(), sqlString.getQuery()); return new AgnosticIterator(); }
List<BlobHandler> cleanups = Lists.newArrayList(); PreparedStatement ps = null; SqlTimer.Handle timerKey = getSqlTimer().start("updateMany(" + vs.length + ")", sql.getKey(), sql.getQuery()); //$NON-NLS-1$ //$NON-NLS-2$ try { ps = c.prepareStatement(sql.getQuery());
PreparedStatement ps = null; SqlTimer.Handle timerKey = getSqlTimer().start("insertMany(" + vs.length + ")", sql.getKey(), sql.getQuery()); //$NON-NLS-1$ //$NON-NLS-2$ List<BlobHandler> cleanups = Lists.newArrayList(); try {
private <T> T wrapPreparedStatement(final Connection c, final FinalSQLString query, final Object[] vs, PreparedStatementVisitor<T> visitor, String description, AutoClose autoClose) throws PalantirSqlException, PalantirInterruptedException { SqlTimer.Handle timerKey = getSqlTimer().start(description, query.getKey(), query.getQuery()); PreparedStatement ps = null; try { ps = BasicSQLUtils.runUninterruptably( executeStatementExecutor, () -> createPreparedStatement(c, query.getQuery(), vs), "SQL createPreparedStatement", c); return visitor.visit(ps); } catch (PalantirSqlException sqle) { throw wrapSQLExceptionWithVerboseLogging(sqle, query.getQuery(), vs); } finally { closeSilently(ps, autoClose); timerKey.stop(); } }
@Override final public Handle start(String module, String sqlKey, String rawSql) { final List<Handle> handles = Lists.newArrayListWithCapacity(sqlTimers.size()); for (SqlTimer sqlTimer : sqlTimers) { handles.add(sqlTimer.start(module, sqlKey, rawSql)); } return () -> { for (Handle handle : handles) { handle.stop(); } }; } }
/** * @see AgnosticIterator for caveats on use. * Note this expects to be called by visitAndClose()! If not, the timer will never get * initialized and close() will throw an exception. */ @Override public Iterator<AgnosticLightResultRow> iterator() { this.timerKey = sqlTimerFactory.start(timingModule, sqlString.getKey(), sqlString.getQuery()); return new AgnosticIterator(); }
List<BlobHandler> cleanups = Lists.newArrayList(); PreparedStatement ps = null; SqlTimer.Handle timerKey = getSqlTimer().start("updateMany(" + vs.length + ")", sql.getKey(), sql.getQuery()); //$NON-NLS-1$ //$NON-NLS-2$ try { ps = c.prepareStatement(sql.getQuery());
PreparedStatement ps = null; SqlTimer.Handle timerKey = getSqlTimer().start("insertMany(" + vs.length + ")", sql.getKey(), sql.getQuery()); //$NON-NLS-1$ //$NON-NLS-2$ List<BlobHandler> cleanups = Lists.newArrayList(); try {
private <T> T wrapPreparedStatement(final Connection c, final FinalSQLString query, final Object[] vs, PreparedStatementVisitor<T> visitor, String description, AutoClose autoClose) throws PalantirSqlException, PalantirInterruptedException { SqlTimer.Handle timerKey = getSqlTimer().start(description, query.getKey(), query.getQuery()); PreparedStatement ps = null; try { ps = BasicSQLUtils.runUninterruptably( executeStatementExecutor, () -> createPreparedStatement(c, query.getQuery(), vs), "SQL createPreparedStatement", c); return visitor.visit(ps); } catch (PalantirSqlException sqle) { throw wrapSQLExceptionWithVerboseLogging(sqle, query.getQuery(), vs); } finally { closeSilently(ps, autoClose); timerKey.stop(); } }