SimpleProductFieldAccessor(int pos, TypeInformation<T> typeInfo, ExecutionConfig config) { checkNotNull(typeInfo, "typeInfo must not be null."); int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; }
@Override public void reduce(Iterable<T> records, Collector<T> out) { final AggregationFunction<Object>[] aggFunctions = this.aggFunctions; final int[] fieldPositions = this.fieldPositions; // aggregators are initialized from before T current = null; for (T record : records) { current = record; for (int i = 0; i < fieldPositions.length; i++) { Object val = current.productElement(fieldPositions[i]); aggFunctions[i].aggregate(val); } } Object[] fields = new Object[serializer.getArity()]; int length = serializer.getArity(); // First copy all tuple fields, then overwrite the aggregated ones for (int i = 0; i < length; i++) { fields[i] = current.productElement(i); } for (int i = 0; i < fieldPositions.length; i++) { Object aggVal = aggFunctions[i].getAggregate(); fields[fieldPositions[i]] = aggVal; aggFunctions[i].initializeAggregate(); } T result = serializer.createInstance(fields); out.collect(result); }
RecursiveProductFieldAccessor(int pos, TypeInformation<T> typeInfo, FieldAccessor<R, F> innerAccessor, ExecutionConfig config) { int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } checkNotNull(typeInfo, "typeInfo must not be null."); checkNotNull(innerAccessor, "innerAccessor must not be null."); this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; this.innerAccessor = innerAccessor; }
SimpleProductFieldAccessor(int pos, TypeInformation<T> typeInfo, ExecutionConfig config) { checkNotNull(typeInfo, "typeInfo must not be null."); int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; }
SimpleProductFieldAccessor(int pos, TypeInformation<T> typeInfo, ExecutionConfig config) { checkNotNull(typeInfo, "typeInfo must not be null."); int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; }
@Override public void reduce(Iterable<T> records, Collector<T> out) { final AggregationFunction<Object>[] aggFunctions = this.aggFunctions; final int[] fieldPositions = this.fieldPositions; // aggregators are initialized from before T current = null; for (T record : records) { current = record; for (int i = 0; i < fieldPositions.length; i++) { Object val = current.productElement(fieldPositions[i]); aggFunctions[i].aggregate(val); } } Object[] fields = new Object[serializer.getArity()]; int length = serializer.getArity(); // First copy all tuple fields, then overwrite the aggregated ones for (int i = 0; i < length; i++) { fields[i] = current.productElement(i); } for (int i = 0; i < fieldPositions.length; i++) { Object aggVal = aggFunctions[i].getAggregate(); fields[fieldPositions[i]] = aggVal; aggFunctions[i].initializeAggregate(); } T result = serializer.createInstance(fields); out.collect(result); }
SimpleProductFieldAccessor(int pos, TypeInformation<T> typeInfo, ExecutionConfig config) { checkNotNull(typeInfo, "typeInfo must not be null."); int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; }
@Override public void reduce(Iterable<T> records, Collector<T> out) { final AggregationFunction<Object>[] aggFunctions = this.aggFunctions; final int[] fieldPositions = this.fieldPositions; // aggregators are initialized from before T current = null; for (T record : records) { current = record; for (int i = 0; i < fieldPositions.length; i++) { Object val = current.productElement(fieldPositions[i]); aggFunctions[i].aggregate(val); } } Object[] fields = new Object[serializer.getArity()]; int length = serializer.getArity(); // First copy all tuple fields, then overwrite the aggregated ones for (int i = 0; i < length; i++) { fields[i] = current.productElement(i); } for (int i = 0; i < fieldPositions.length; i++) { Object aggVal = aggFunctions[i].getAggregate(); fields[fieldPositions[i]] = aggVal; aggFunctions[i].initializeAggregate(); } T result = serializer.createInstance(fields); out.collect(result); }
@Override public void reduce(Iterable<T> records, Collector<T> out) { final AggregationFunction<Object>[] aggFunctions = this.aggFunctions; final int[] fieldPositions = this.fieldPositions; // aggregators are initialized from before T current = null; for (T record : records) { current = record; for (int i = 0; i < fieldPositions.length; i++) { Object val = current.productElement(fieldPositions[i]); aggFunctions[i].aggregate(val); } } Object[] fields = new Object[serializer.getArity()]; int length = serializer.getArity(); // First copy all tuple fields, then overwrite the aggregated ones for (int i = 0; i < length; i++) { fields[i] = current.productElement(i); } for (int i = 0; i < fieldPositions.length; i++) { Object aggVal = aggFunctions[i].getAggregate(); fields[fieldPositions[i]] = aggVal; aggFunctions[i].initializeAggregate(); } T result = serializer.createInstance(fields); out.collect(result); }
@Override public void reduce(Iterable<T> records, Collector<T> out) { final AggregationFunction<Object>[] aggFunctions = this.aggFunctions; final int[] fieldPositions = this.fieldPositions; // aggregators are initialized from before T current = null; for (T record : records) { current = record; for (int i = 0; i < fieldPositions.length; i++) { Object val = current.productElement(fieldPositions[i]); aggFunctions[i].aggregate(val); } } Object[] fields = new Object[serializer.getArity()]; int length = serializer.getArity(); // First copy all tuple fields, then overwrite the aggregated ones for (int i = 0; i < length; i++) { fields[i] = current.productElement(i); } for (int i = 0; i < fieldPositions.length; i++) { Object aggVal = aggFunctions[i].getAggregate(); fields[fieldPositions[i]] = aggVal; aggFunctions[i].initializeAggregate(); } T result = serializer.createInstance(fields); out.collect(result); }
RecursiveProductFieldAccessor(int pos, TypeInformation<T> typeInfo, FieldAccessor<R, F> innerAccessor, ExecutionConfig config) { int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } checkNotNull(typeInfo, "typeInfo must not be null."); checkNotNull(innerAccessor, "innerAccessor must not be null."); this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; this.innerAccessor = innerAccessor; }
RecursiveProductFieldAccessor(int pos, TypeInformation<T> typeInfo, FieldAccessor<R, F> innerAccessor, ExecutionConfig config) { int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } checkNotNull(typeInfo, "typeInfo must not be null."); checkNotNull(innerAccessor, "innerAccessor must not be null."); this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; this.innerAccessor = innerAccessor; }
RecursiveProductFieldAccessor(int pos, TypeInformation<T> typeInfo, FieldAccessor<R, F> innerAccessor, ExecutionConfig config) { int arity = ((TupleTypeInfoBase) typeInfo).getArity(); if (pos < 0 || pos >= arity) { throw new CompositeType.InvalidFieldReferenceException( "Tried to select " + ((Integer) pos).toString() + ". field on \"" + typeInfo.toString() + "\", which is an invalid index."); } checkNotNull(typeInfo, "typeInfo must not be null."); checkNotNull(innerAccessor, "innerAccessor must not be null."); this.pos = pos; this.fieldType = ((TupleTypeInfoBase<T>) typeInfo).getTypeAt(pos); this.serializer = (TupleSerializerBase<T>) typeInfo.createSerializer(config); this.length = this.serializer.getArity(); this.fields = new Object[this.length]; this.innerAccessor = innerAccessor; }