flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-2457) Integrate Tuple0
Date Thu, 06 Aug 2015 13:02:04 GMT

    [ https://issues.apache.org/jira/browse/FLINK-2457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14659970#comment-14659970
] 

ASF GitHub Bot commented on FLINK-2457:
---------------------------------------

Github user mjsax commented on a diff in the pull request:

    https://github.com/apache/flink/pull/983#discussion_r36410627
  
    --- Diff: flink-staging/flink-language-binding/flink-language-binding-generic/src/main/java/org/apache/flink/languagebinding/api/java/common/streaming/Receiver.java
---
    @@ -346,61 +349,12 @@ public Tuple deserialize() {
     	}
     
     	public static Tuple createTuple(int size) {
    -		switch (size) {
    -			case 0:
    -				return new Tuple0();
    -			case 1:
    -				return new Tuple1();
    -			case 2:
    -				return new Tuple2();
    -			case 3:
    -				return new Tuple3();
    -			case 4:
    -				return new Tuple4();
    -			case 5:
    -				return new Tuple5();
    -			case 6:
    -				return new Tuple6();
    -			case 7:
    -				return new Tuple7();
    -			case 8:
    -				return new Tuple8();
    -			case 9:
    -				return new Tuple9();
    -			case 10:
    -				return new Tuple10();
    -			case 11:
    -				return new Tuple11();
    -			case 12:
    -				return new Tuple12();
    -			case 13:
    -				return new Tuple13();
    -			case 14:
    -				return new Tuple14();
    -			case 15:
    -				return new Tuple15();
    -			case 16:
    -				return new Tuple16();
    -			case 17:
    -				return new Tuple17();
    -			case 18:
    -				return new Tuple18();
    -			case 19:
    -				return new Tuple19();
    -			case 20:
    -				return new Tuple20();
    -			case 21:
    -				return new Tuple21();
    -			case 22:
    -				return new Tuple22();
    -			case 23:
    -				return new Tuple23();
    -			case 24:
    -				return new Tuple24();
    -			case 25:
    -				return new Tuple25();
    -			default:
    -				throw new IllegalArgumentException("Tuple size not supported: " + size);
    +		try {
    +			return Tuple.getTupleClass(size).newInstance();
    --- End diff --
    
    No need for this. `.getTupleClass()` does the check already.


> Integrate Tuple0
> ----------------
>
>                 Key: FLINK-2457
>                 URL: https://issues.apache.org/jira/browse/FLINK-2457
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Matthias J. Sax
>            Assignee: Matthias J. Sax
>            Priority: Minor
>
> Tuple0 is not cleanly integrated:
>   - missing serialization/deserialization support in runtime
>  - Tuple.getTupleClass(int arity) cannot handle arity zero, ie, cannot create an instance
of Tuple0
> Tuple0 is currently only used in Python API, but will be integrated into Storm compatibility,
too.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message