Takes the resulting union and builds the #current_values and #meta maps. @param ordered_union The union to build from.
(final ByteMap<ExpressionDataPoint[]>
ordered_union)
| 206 | * @param ordered_union The union to build from. |
| 207 | */ |
| 208 | private void setCurrentAndMeta(final ByteMap<ExpressionDataPoint[]> |
| 209 | ordered_union) { |
| 210 | for (final String id : queries.keySet()) { |
| 211 | current_values.put(id, new ExpressionDataPoint[ordered_union.size()]); |
| 212 | // TODO - blech. Fill with a sentinel value to reflect "no data here!" |
| 213 | final int[] m = new int[ordered_union.size()]; |
| 214 | for (int i = 0; i < m.length; i++) { |
| 215 | m[i] = -1; |
| 216 | } |
| 217 | single_series_matrix.put(id, m); |
| 218 | } |
| 219 | |
| 220 | int i = 0; |
| 221 | for (final Entry<byte[], ExpressionDataPoint[]> entry : ordered_union.entrySet()) { |
| 222 | final ExpressionDataPoint[] idps = entry.getValue(); |
| 223 | for (int x = 0; x < idps.length; x++) { |
| 224 | final ExpressionDataPoint[] current_dps = |
| 225 | current_values.get(index_to_names[x]); |
| 226 | current_dps[i] = idps[x]; |
| 227 | final int[] m = single_series_matrix.get(index_to_names[x]); |
| 228 | if (idps[x] != null) { |
| 229 | m[i] = idps[x].getIndex(); |
| 230 | } |
| 231 | } |
| 232 | ++i; |
| 233 | } |
| 234 | |
| 235 | // set fills on nulls |
| 236 | for (final ExpressionDataPoint[] idps : current_values.values()) { |
| 237 | for (i = 0; i < idps.length; i++) { |
| 238 | if (idps[i] == null) { |
| 239 | idps[i] = fill_dp; |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | series_size = ordered_union.size(); |
| 244 | } |
| 245 | |
| 246 | /** |
| 247 | * Creates a key based on the concatenation of the tag pairs then the agg |