private MapProjector(int[] fields) { this.fields = fields; try { this.outTuple = Tuple.getTupleClass(fields.length).newInstance(); } catch (Exception e) { // this should never happen throw new RuntimeException(e); } }
public static Tuple createTuple(int size) { try { return Tuple.getTupleClass(size).newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } } }
@SuppressWarnings("unchecked") @PublicEvolving public TupleTypeInfo(TypeInformation<?>... types) { this((Class<T>) Tuple.getTupleClass(types.length), types); }
@Override @SuppressWarnings("unchecked") public R result() { try { Class tupleClass = Tuple.getTupleClass(columnAggregators.length); R tuple = (R) tupleClass.newInstance(); for (int i = 0; i < columnAggregators.length; i++) { tuple.setField(columnAggregators[i].result(), i); } return tuple; } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("Unexpected error instantiating Tuple class for aggregation results", e); } } }
private MapProjector(int[] fields) { this.fields = fields; try { this.outTuple = Tuple.getTupleClass(fields.length).newInstance(); } catch (Exception e) { // this should never happen throw new RuntimeException(e); } }
ArrayKeySelector(int[] fields, TupleTypeInfo<Tuple> returnType) { this.fields = requireNonNull(fields); this.returnType = requireNonNull(returnType); this.tupleClass = Tuple.getTupleClass(fields.length); }
private MapProjector(int[] fields) { this.fields = fields; try { this.outTuple = Tuple.getTupleClass(fields.length).newInstance(); } catch (Exception e) { // this should never happen throw new RuntimeException(e); } }
public static Tuple createTuple(int size) { try { return Tuple.getTupleClass(size).newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } }
@SuppressWarnings("unchecked") @PublicEvolving public TupleTypeInfo(TypeInformation<?>... types) { this((Class<T>) Tuple.getTupleClass(types.length), types); }
@SuppressWarnings("unchecked") @PublicEvolving public TupleTypeInfo(TypeInformation<?>... types) { this((Class<T>) Tuple.getTupleClass(types.length), types); }
@Override public Tuple getKey(IN value) throws Exception { Tuple key = Tuple.getTupleClass(keyLength).newInstance(); comparator.extractKeys(value, keyArray, 0); for (int i = 0; i < keyLength; i++) { key.setField(keyArray[i], i); } return key; }
@Override @SuppressWarnings("unchecked") public R result() { try { Class tupleClass = Tuple.getTupleClass(columnAggregators.length); R tuple = (R) tupleClass.newInstance(); for (int i = 0; i < columnAggregators.length; i++) { tuple.setField(columnAggregators[i].result(), i); } return tuple; } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("Unexpected error instantiating Tuple class for aggregation results", e); } } }
@Override @SuppressWarnings("unchecked") public R result() { try { Class tupleClass = Tuple.getTupleClass(columnAggregators.length); R tuple = (R) tupleClass.newInstance(); for (int i = 0; i < columnAggregators.length; i++) { tuple.setField(columnAggregators[i].result(), i); } return tuple; } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("Unexpected error instantiating Tuple class for aggregation results", e); } } }
try { this.outputTuple.put(outputStream.getKey(), org.apache.flink.api.java.tuple.Tuple.getTupleClass(numAtt) .newInstance()); } catch (final InstantiationException e) {
t = Tuple.getTupleClass(numberOfAttributes + 1).newInstance(); } catch (final InstantiationException e) { throw new RuntimeException(e);
keySerializer = new TupleSerializer<Tuple>((Class<Tuple>) Tuple.getTupleClass(numKeyFields+1), tupleSers); keyComparator = new TupleComparator<Tuple>(keyPos, keyComps, keySers);
keySerializer = new TupleSerializer<Tuple>((Class<Tuple>) Tuple.getTupleClass(numKeyFields+1), tupleSers); keyComparator = new TupleComparator<Tuple>(keyPos, keyComps, keySers);
keySerializer = new TupleSerializer<Tuple>((Class<Tuple>) Tuple.getTupleClass(numKeyFields+1), tupleSers); keyComparator = new TupleComparator<Tuple>(keyPos, keyComps, keySers);
keySerializer = new TupleSerializer<Tuple>((Class<Tuple>) Tuple.getTupleClass(numKeyFields+1), tupleSers); keyComparator = new TupleComparator<Tuple>(keyPos, keyComps, keySers);