public <V> V trace(Action<V> action, CassandraClient client, Set<TableReference> tableRefs) throws TException { ByteBuffer traceId = client.trace_next_query(); Stopwatch stopwatch = Stopwatch.createStarted(); boolean failed = false; try { return action.run(); } catch (TException e) { failed = true; logFailedCall(tableRefs); throw e; } finally { long duration = stopwatch.elapsed(TimeUnit.MILLISECONDS); logTraceResults(duration, tableRefs, traceId, failed); } }
public <V> V trace(Action<V> action, CassandraClient client, Set<TableReference> tableRefs) throws TException { ByteBuffer traceId = client.trace_next_query(); Stopwatch stopwatch = Stopwatch.createStarted(); boolean failed = false; try { return action.run(); } catch (TException e) { failed = true; logFailedCall(tableRefs); throw e; } finally { long duration = stopwatch.elapsed(TimeUnit.MILLISECONDS); logTraceResults(duration, tableRefs, traceId, failed); } }
public <V> V run(CassandraClient client, Set<TableReference> tableRefs, Action<V> action) throws TException { if (shouldTraceQuery(tableRefs)) { return trace(action, client, tableRefs); } else { try { return action.run(); } catch (TException e) { logFailedCall(tableRefs); throw e; } } }
public <V> V run(CassandraClient client, Set<TableReference> tableRefs, Action<V> action) throws TException { if (shouldTraceQuery(tableRefs)) { return trace(action, client, tableRefs); } else { try { return action.run(); } catch (TException e) { logFailedCall(tableRefs); throw e; } } }