&& parser.nextToken() == JsonToken.START_OBJECT) { if (posTimestampField != -1) { rowBuilder.set(posTimestampField, timeValue); sink.send(rowBuilder.build()); rowBuilder.reset(); rowBuilder.set(posTimestampField, timeValue); sink.send(rowBuilder.build()); rowBuilder.reset(); && parser.nextToken() == JsonToken.START_OBJECT) { parseFields(fieldNames, fieldTypes, posTimestampField, rowBuilder, parser); sink.send(rowBuilder.build()); rowBuilder.reset(); page.totalRowCount += 1; && parser.nextToken() == JsonToken.START_OBJECT) { if (posTimestampField != -1) { rowBuilder.set(posTimestampField, timeValue); sink.send(rowBuilder.build()); rowBuilder.reset(); Row row = rowBuilder.build(); sink.send(row); rowBuilder.reset(); page.totalRowCount += 1;
&& parser.nextToken() == JsonToken.START_OBJECT) { if (posTimestampField != -1) { rowBuilder.set(posTimestampField, timeValue); sink.send(rowBuilder.build()); rowBuilder.reset(); rowBuilder.set(posTimestampField, timeValue); sink.send(rowBuilder.build()); rowBuilder.reset(); && parser.nextToken() == JsonToken.START_OBJECT) { parseFields(fieldNames, fieldTypes, posTimestampField, rowBuilder, parser); sink.send(rowBuilder.build()); rowBuilder.reset(); page.totalRowCount += 1; && parser.nextToken() == JsonToken.START_OBJECT) { if (posTimestampField != -1) { rowBuilder.set(posTimestampField, timeValue); sink.send(rowBuilder.build()); rowBuilder.reset(); Row row = rowBuilder.build(); sink.send(row); rowBuilder.reset(); page.totalRowCount += 1;
final int fieldPos = posTimestampField != -1 ? posTimestampField : i; if (token == JsonToken.VALUE_NUMBER_INT) { rowBuilder.set(posTimestampField, parser.getLongValue()); return; } else { .set(fieldPos, UTC_TIMESTAMP_FORMAT.parse(parser.getText()).getTime()); } catch (ParseException e) { .set(fieldPos, TIMESTAMP_FORMAT.parse(parser.getText()).getTime()); } catch (ParseException e2) { rowBuilder.set(i, parser.getByteValue()); break; case SHORT: rowBuilder.set(i, parser.getShortValue()); break; case INTEGER: rowBuilder.set(i, parser.getIntValue()); break; case LONG: rowBuilder.set(i, parser.getLongValue()); break; case DOUBLE: rowBuilder.set(i, parser.getDoubleValue()); break; rowBuilder.set(i, true); break;
rowBuilder.set(posTimestampField, timeInMillis); rowBuilder.set(i, parser.getByteValue()); break; case SHORT: rowBuilder.set(i, parser.getShortValue()); break; case INTEGER: rowBuilder.set(i, parser.getIntValue()); break; case LONG: rowBuilder.set(i, parser.getLongValue()); break; case DOUBLE: rowBuilder.set(i, parser.getDoubleValue()); break; rowBuilder.set(i, true); break; case VALUE_FALSE: rowBuilder.set(i, false); break; case VALUE_NULL: rowBuilder.set(i, Long.valueOf(s)); break; case FLOAT: switch (s) {
public void end(Sink sink) throws InterruptedException { for (Map.Entry<Row, AccumulatorList> e : accumulators.entrySet()) { final Row key = e.getKey(); final AccumulatorList list = e.getValue(); RowBuilder rb = Row.newBuilder(outputRowLength); int index = 0; for (Integer groupPos : unionGroups) { if (grouping.get(groupPos)) { rb.set(index, key.getObject(index)); if (rel.indicator) { rb.set(unionGroups.cardinality() + index, true); } } // need to set false when not part of grouping set. index++; } list.end(rb); sink.send(rb.build()); } } }
public void send(Row row) { // TODO: fix the size of this row. RowBuilder builder = Row.newBuilder(grouping.cardinality()); int j = 0; for (Integer i : grouping) { builder.set(j++, row.getObject(i)); } Row key = builder.build(); if (!accumulators.containsKey(key)) { AccumulatorList list = new AccumulatorList(); for (AccumulatorFactory factory : accumulatorFactories) { list.add(factory.get()); } accumulators.put(key, list); } accumulators.get(key).send(row); }
public void send(Row row) { // TODO: fix the size of this row. RowBuilder builder = Row.newBuilder(grouping.cardinality()); int j = 0; for (Integer i : grouping) { builder.set(j++, row.getObject(i)); } Row key = builder.build(); if (!accumulators.containsKey(key)) { AccumulatorList list = new AccumulatorList(); for (AccumulatorFactory factory : accumulatorFactories) { list.add(factory.get()); } accumulators.put(key, list); } accumulators.get(key).send(row); }
public void end(Sink sink) throws InterruptedException { for (Map.Entry<Row, AccumulatorList> e : accumulators.entrySet()) { final Row key = e.getKey(); final AccumulatorList list = e.getValue(); RowBuilder rb = Row.newBuilder(outputRowLength); int index = 0; for (Integer groupPos : unionGroups) { if (grouping.get(groupPos)) { rb.set(index, key.getObject(index)); if (rel.indicator) { rb.set(unionGroups.cardinality() + index, true); } } // need to set false when not part of grouping set. index++; } list.end(rb); sink.send(rb.build()); } } }
/** * Create a RowBuilder object that eases creation of a new row. * * @param size Number of columns in output data. * @return New RowBuilder object. */ public static RowBuilder newBuilder(int size) { return new RowBuilder(size); }
/** * Create a RowBuilder object that eases creation of a new row. * * @param size Number of columns in output data. * @return New RowBuilder object. */ public static RowBuilder newBuilder(int size) { return new RowBuilder(size); }