* @return The result.
* @throws AnalyzerException If query execution fails.
*/
private <T extends AbstractExecutable> Result<T> execute(T executable) throws AnalyzerException {
List<Map<String, Object>> rows = new ArrayList<>();
QueryResult queryResult = null;
try {
store.beginTransaction();
queryResult = executeQuery(executable.getQuery());
for (QueryResult.Row row : queryResult.getRows()) {
rows.add(row.get());
}
store.commitTransaction();
return new Result<T>(executable, queryResult.getColumns(), rows);
} catch (RuntimeException e) {
store.rollbackTransaction();
throw new AnalyzerException("Cannot execute query: " + executable.getQuery(), e);
} finally {
IOUtils.closeQuietly(queryResult);