Java Code Examples for org.apache.flink.api.java.tuple.Tuple10

The following examples show how to use org.apache.flink.api.java.tuple.Tuple10. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Flink-CEPplus   Source File: Tuple10Builder.java    License: Apache License 2.0 4 votes vote down vote up
public Tuple10Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9){
	tuples.add(new Tuple10<>(value0, value1, value2, value3, value4, value5, value6, value7, value8, value9));
	return this;
}
 
Example 2
Source Project: Flink-CEPplus   Source File: Tuple10Builder.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>[] build(){
	return tuples.toArray(new Tuple10[tuples.size()]);
}
 
Example 3
Source Project: flink   Source File: Tuple10Builder.java    License: Apache License 2.0 4 votes vote down vote up
public Tuple10Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9){
	tuples.add(new Tuple10<>(value0, value1, value2, value3, value4, value5, value6, value7, value8, value9));
	return this;
}
 
Example 4
Source Project: flink   Source File: Tuple10Builder.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>[] build(){
	return tuples.toArray(new Tuple10[tuples.size()]);
}
 
Example 5
Source Project: flink-siddhi   Source File: SiddhiTupleFactory.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Convert object array to type of Tuple{N} where N is between 0 to 25.
 *
 * @throws IllegalArgumentException if rows's length > 25
 */
public static <T extends Tuple> T newTuple(Object[] row) {
    Preconditions.checkNotNull(row, "Tuple row is null");
    switch (row.length) {
        case 0:
            return setTupleValue(new Tuple0(), row);
        case 1:
            return setTupleValue(new Tuple1(), row);
        case 2:
            return setTupleValue(new Tuple2(), row);
        case 3:
            return setTupleValue(new Tuple3(), row);
        case 4:
            return setTupleValue(new Tuple4(), row);
        case 5:
            return setTupleValue(new Tuple5(), row);
        case 6:
            return setTupleValue(new Tuple6(), row);
        case 7:
            return setTupleValue(new Tuple7(), row);
        case 8:
            return setTupleValue(new Tuple8(), row);
        case 9:
            return setTupleValue(new Tuple9(), row);
        case 10:
            return setTupleValue(new Tuple10(), row);
        case 11:
            return setTupleValue(new Tuple11(), row);
        case 12:
            return setTupleValue(new Tuple12(), row);
        case 13:
            return setTupleValue(new Tuple13(), row);
        case 14:
            return setTupleValue(new Tuple14(), row);
        case 15:
            return setTupleValue(new Tuple15(), row);
        case 16:
            return setTupleValue(new Tuple16(), row);
        case 17:
            return setTupleValue(new Tuple17(), row);
        case 18:
            return setTupleValue(new Tuple18(), row);
        case 19:
            return setTupleValue(new Tuple19(), row);
        case 20:
            return setTupleValue(new Tuple20(), row);
        case 21:
            return setTupleValue(new Tuple21(), row);
        case 22:
            return setTupleValue(new Tuple22(), row);
        case 23:
            return setTupleValue(new Tuple23(), row);
        case 24:
            return setTupleValue(new Tuple24(), row);
        case 25:
            return setTupleValue(new Tuple25(), row);
        default:
            throw new IllegalArgumentException("Too long row: " + row.length + ", unable to convert to Tuple");
    }
}
 
Example 6
Source Project: bahir-flink   Source File: SiddhiTupleFactory.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Convert object array to type of Tuple{N} where N is between 0 to 25.
 *
 * @throws IllegalArgumentException if rows's length > 25
 */
public static <T extends Tuple> T newTuple(Object[] row) {
    Preconditions.checkNotNull(row, "Tuple row is null");
    switch (row.length) {
        case 0:
            return setTupleValue(new Tuple0(), row);
        case 1:
            return setTupleValue(new Tuple1<>(), row);
        case 2:
            return setTupleValue(new Tuple2<>(), row);
        case 3:
            return setTupleValue(new Tuple3<>(), row);
        case 4:
            return setTupleValue(new Tuple4<>(), row);
        case 5:
            return setTupleValue(new Tuple5<>(), row);
        case 6:
            return setTupleValue(new Tuple6<>(), row);
        case 7:
            return setTupleValue(new Tuple7<>(), row);
        case 8:
            return setTupleValue(new Tuple8<>(), row);
        case 9:
            return setTupleValue(new Tuple9<>(), row);
        case 10:
            return setTupleValue(new Tuple10<>(), row);
        case 11:
            return setTupleValue(new Tuple11<>(), row);
        case 12:
            return setTupleValue(new Tuple12<>(), row);
        case 13:
            return setTupleValue(new Tuple13<>(), row);
        case 14:
            return setTupleValue(new Tuple14<>(), row);
        case 15:
            return setTupleValue(new Tuple15<>(), row);
        case 16:
            return setTupleValue(new Tuple16<>(), row);
        case 17:
            return setTupleValue(new Tuple17<>(), row);
        case 18:
            return setTupleValue(new Tuple18<>(), row);
        case 19:
            return setTupleValue(new Tuple19<>(), row);
        case 20:
            return setTupleValue(new Tuple20<>(), row);
        case 21:
            return setTupleValue(new Tuple21<>(), row);
        case 22:
            return setTupleValue(new Tuple22<>(), row);
        case 23:
            return setTupleValue(new Tuple23<>(), row);
        case 24:
            return setTupleValue(new Tuple24<>(), row);
        case 25:
            return setTupleValue(new Tuple25<>(), row);
        default:
            throw new IllegalArgumentException("Too long row: " + row.length + ", unable to convert to Tuple");
    }
}
 
Example 7
Source Project: flink   Source File: Tuple10Builder.java    License: Apache License 2.0 4 votes vote down vote up
public Tuple10Builder<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> add(T0 value0, T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8, T9 value9){
	tuples.add(new Tuple10<>(value0, value1, value2, value3, value4, value5, value6, value7, value8, value9));
	return this;
}
 
Example 8
Source Project: flink   Source File: Tuple10Builder.java    License: Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
public Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>[] build(){
	return tuples.toArray(new Tuple10[tuples.size()]);
}
 
Example 9
Source Project: Flink-CEPplus   Source File: JoinOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a pair of joined elements to a {@link Tuple} with the previously selected fields.
 * Requires the classes of the fields of the resulting tuples.
 *
 * @return The projected data set.
 *
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectJoin<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes);
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectJoin<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds1, this.ds2, this.keys1, this.keys2, this.hint, this.fieldIndexes, this.isFieldInFirst, tType, this);
}
 
Example 10
Source Project: Flink-CEPplus   Source File: ProjectOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a {@link Tuple} {@link DataSet} to the previously selected fields.
 *
 * @return The projected DataSet.
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectOperator<T, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, ds.getType());
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectOperator<T, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds, this.fieldIndexes, tType);
}
 
Example 11
Source Project: Flink-CEPplus   Source File: CrossOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a pair of crossed elements to a {@link Tuple} with the previously selected fields.
 *
 * @return The projected data set.
 *
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectCross<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes);
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectCross<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds1, this.ds2, this.fieldIndexes, this.isFieldInFirst, tType, this, hint);
}
 
Example 12
Source Project: Flink-CEPplus   Source File: StreamProjection.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a {@link Tuple} {@link DataStream} to the previously selected fields.
 *
 * @return The projected DataStream.
 * @see Tuple
 * @see DataStream
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> SingleOutputStreamOperator<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, dataStream.getType());
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return dataStream.transform("Projection", tType, new StreamProject<IN, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fieldIndexes, tType.createSerializer(dataStream.getExecutionConfig())));
}
 
Example 13
Source Project: flink   Source File: JoinOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a pair of joined elements to a {@link Tuple} with the previously selected fields.
 * Requires the classes of the fields of the resulting tuples.
 *
 * @return The projected data set.
 *
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectJoin<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes);
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectJoin<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds1, this.ds2, this.keys1, this.keys2, this.hint, this.fieldIndexes, this.isFieldInFirst, tType, this);
}
 
Example 14
Source Project: flink   Source File: ProjectOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a {@link Tuple} {@link DataSet} to the previously selected fields.
 *
 * @return The projected DataSet.
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectOperator<T, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, ds.getType());
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectOperator<T, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds, this.fieldIndexes, tType);
}
 
Example 15
Source Project: flink   Source File: CrossOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a pair of crossed elements to a {@link Tuple} with the previously selected fields.
 *
 * @return The projected data set.
 *
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectCross<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes);
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectCross<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds1, this.ds2, this.fieldIndexes, this.isFieldInFirst, tType, this, hint);
}
 
Example 16
Source Project: flink   Source File: StreamProjection.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a {@link Tuple} {@link DataStream} to the previously selected fields.
 *
 * @return The projected DataStream.
 * @see Tuple
 * @see DataStream
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> SingleOutputStreamOperator<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, dataStream.getType());
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return dataStream.transform("Projection", tType, new StreamProject<IN, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fieldIndexes, tType.createSerializer(dataStream.getExecutionConfig())));
}
 
Example 17
Source Project: flink   Source File: JoinOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a pair of joined elements to a {@link Tuple} with the previously selected fields.
 * Requires the classes of the fields of the resulting tuples.
 *
 * @return The projected data set.
 *
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectJoin<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes);
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectJoin<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds1, this.ds2, this.keys1, this.keys2, this.hint, this.fieldIndexes, this.isFieldInFirst, tType, this);
}
 
Example 18
Source Project: flink   Source File: ProjectOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a {@link Tuple} {@link DataSet} to the previously selected fields.
 *
 * @return The projected DataSet.
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectOperator<T, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, ds.getType());
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectOperator<T, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds, this.fieldIndexes, tType);
}
 
Example 19
Source Project: flink   Source File: CrossOperator.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a pair of crossed elements to a {@link Tuple} with the previously selected fields.
 *
 * @return The projected data set.
 *
 * @see Tuple
 * @see DataSet
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> ProjectCross<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes);
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return new ProjectCross<I1, I2, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(this.ds1, this.ds2, this.fieldIndexes, this.isFieldInFirst, tType, this, hint);
}
 
Example 20
Source Project: flink   Source File: StreamProjection.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Projects a {@link Tuple} {@link DataStream} to the previously selected fields.
 *
 * @return The projected DataStream.
 * @see Tuple
 * @see DataStream
 */
public <T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> SingleOutputStreamOperator<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> projectTuple10() {
	TypeInformation<?>[] fTypes = extractFieldTypes(fieldIndexes, dataStream.getType());
	TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>> tType = new TupleTypeInfo<Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fTypes);

	return dataStream.transform("Projection", tType, new StreamProject<IN, Tuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>>(fieldIndexes, tType.createSerializer(dataStream.getExecutionConfig())));
}