(final ArrayList<DataPoints[]> query_results)
| 255 | */ |
| 256 | class QueriesCB implements Callback<Object, ArrayList<DataPoints[]>> { |
| 257 | public Object call(final ArrayList<DataPoints[]> query_results) |
| 258 | throws Exception { |
| 259 | |
| 260 | for (int i = 0; i < query_results.size(); i++) { |
| 261 | final TSSubQuery sub = ts_query.getQueries().get(i); |
| 262 | |
| 263 | Iterator<Entry<String, TSSubQuery>> it = sub_queries.entrySet().iterator(); |
| 264 | while (it.hasNext()) { |
| 265 | final Entry<String, TSSubQuery> entry = it.next(); |
| 266 | if (entry.getValue().equals(sub)) { |
| 267 | sub_query_results.put(entry.getKey(), query_results.get(i)); |
| 268 | if (expressions != null) { |
| 269 | for (final ExpressionIterator ei : expressions.values()) { |
| 270 | if (ei.getVariableNames().contains(entry.getKey())) { |
| 271 | final TimeSyncedIterator tsi = new TimeSyncedIterator( |
| 272 | entry.getKey(), sub.getFilterTagKs(), |
| 273 | query_results.get(i)); |
| 274 | final NumericFillPolicy fill = fills.get(entry.getKey()); |
| 275 | if (fill != null) { |
| 276 | tsi.setFillPolicy(fill); |
| 277 | } |
| 278 | ei.addResults(entry.getKey(), tsi); |
| 279 | if (LOG.isDebugEnabled()) { |
| 280 | LOG.debug("Added results for " + entry.getKey() + |
| 281 | " to " + ei.getId()); |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | // handle nested expressions |
| 291 | final DirectedAcyclicGraph<String, DefaultEdge> graph = |
| 292 | new DirectedAcyclicGraph<String, DefaultEdge>(DefaultEdge.class); |
| 293 | |
| 294 | if (expressions != null) { |
| 295 | for (final Entry<String, ExpressionIterator> eii : expressions.entrySet()) { |
| 296 | if (LOG.isDebugEnabled()) { |
| 297 | LOG.debug(String.format("Expression entry key is %s, value is %s", |
| 298 | eii.getKey(), eii.getValue().toString())); |
| 299 | LOG.debug(String.format("Time to loop through the variable names " |
| 300 | + "for %s", eii.getKey())); |
| 301 | } |
| 302 | |
| 303 | if (!graph.containsVertex(eii.getKey())) { |
| 304 | if (LOG.isDebugEnabled()) { |
| 305 | LOG.debug("Adding vertex " + eii.getKey()); |
| 306 | } |
| 307 | graph.addVertex(eii.getKey()); |
| 308 | } |
| 309 | |
| 310 | for (final String var : eii.getValue().getVariableNames()) { |
| 311 | if (LOG.isDebugEnabled()) { |
| 312 | LOG.debug(String.format("var is %s", var)); |
| 313 | } |
| 314 |
nothing calls this directly
no test coverage detected