[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14729884#comment-14729884 ] Raúl Kripalani commented on IGNITE-1370: There are two options off the top of my head: # API-breaking one => modifying StreamTupleExtractor to add a second method returning a Map and a method {{boolean supportsMultiple()}} for users to implement, so that Streamers can query the extractor to know which method to invoke. # A new class {{StreamMultipleTupleExtractor}} that Streamers supporting this functionality can use. It would require streamers to hold two fields: singleTupleExtractor or multipleTupleExtractor (for example), for users to be able to set either. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14730030#comment-14730030 ] ASF GitHub Bot commented on IGNITE-1370: GitHub user raulk opened a pull request: https://github.com/apache/ignite/pull/67 IGNITE-1370 Streamers: Implement multiple tuple extractor. Added also a unit test in SocketStreamerSelfTest. You can merge this pull request into a Git repository by running: $ git pull https://github.com/raulk/incubator-ignite ignite-1.4 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/67.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #67 commit 36467a027fa95ba6587ada721155e1d0479e1808 Author: Raul Kripalani Date: 2015-09-03T22:31:08Z IGNITE-1370 Streamers: Implement multiple tuple extractor. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14731640#comment-14731640 ] Valentin Kulichenko commented on IGNITE-1370: - Raul, I looked at your changes. They look good, but I think we should throw an exception if both single and multiple extractors are set, because only multiple will be used. Also it looks like multiple extractor supports all cases, so single can be deprecated. What do you think? > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1473#comment-1473 ] ASF GitHub Bot commented on IGNITE-1370: Github user asfgit closed the pull request at: https://github.com/apache/ignite/pull/67 > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14736683#comment-14736683 ] Raúl Kripalani commented on IGNITE-1370: Hey Valentin, Sorry for the delay. Yes, we can definitely do that. Currently I validate that both are not null, but we can definitely add the extra validation if both are set. The reason why I wouldn't deprecate single altogether is that multiple forces the user to create a Map. If you know your message will only ever return 1 tuple, creating a Map is extra overhead and leads to unnecessary GC. However, I think we should rename StreamTupleExtractor to Stream*Single*TupleExtractor. To do this without breaking the API I suggest we perform the rename and then create StreamTupleExtractor again extending the new StreamSingleTupleExtractor and marking it as @Deprecated. What do you think? > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14737997#comment-14737997 ] Valentin Kulichenko commented on IGNITE-1370: - Hey Raul. Agree, but I'm not sure I like two interfaces extending each other. I would simply duplicate them and deprecate the old one. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14738440#comment-14738440 ] Raúl Kripalani commented on IGNITE-1370: If you duplicate them, the user won't be able to use both interfaces interchangeably. Hence, I think extension is more comfortable for the user at this point. We also want to rename the field in {{extractor}} field in {{StreamAdapter}} to {{singleTupleExtractor}}, creating new getters and setters but keeping the old ones {{getExtractor}} and {{setExtractor}} and marking them as {{@Deprecated}}. Raúl. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14742272#comment-14742272 ] ASF GitHub Bot commented on IGNITE-1370: GitHub user raulk opened a pull request: https://github.com/apache/ignite/pull/85 IGNITE-1370 Streamers: Implement multiple tuple extractor. With adjustments discussed in ticket. You can merge this pull request into a Git repository by running: $ git pull https://github.com/raulk/incubator-ignite feature/ignite-1370 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/85.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #85 commit 4d9734a0842f0a46310c1f6261fdf42371db8705 Author: Raul Kripalani Date: 2015-09-03T22:31:08Z IGNITE-1370 Streamers: Implement multiple tuple extractor. commit 8b5e078cf60c7176e5b3f2aefc558ba819dcad0a Author: Raul Kripalani Date: 2015-09-13T00:18:34Z IGNITE-1370 Deprecate StreamTupleExtractor in favor of new *Single*StreamTupleExtractor. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14900833#comment-14900833 ] ASF GitHub Bot commented on IGNITE-1370: Github user asfgit closed the pull request at: https://github.com/apache/ignite/pull/85 > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > Fix For: ignite-1.5 > > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14997848#comment-14997848 ] Roman Shtykh commented on IGNITE-1370: -- Your first design idea (modifying StreamTupleExtractor to add a second method returning a Map) is better for real use cases. In some cases if you want to initialize a user-specified extractor you have no knowledge of. For instance, from a configuration file you have to do the following {code} Class clazz = (Class)Class.forName(tupleExtractorCls); then create new instance {code} What should be Some_Extractor? Single or multiple? > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > Fix For: 1.5 > > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14999038#comment-14999038 ] Raúl Kripalani commented on IGNITE-1370: Yes, but in compliance with [SemVer 2.0|http://semver.org/], we are not allowed to break APIs in minor versions. We could consider this for Ignite 2.0. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > Fix For: 1.5 > > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (IGNITE-1370) StreamTupleExtractor should allow extracting multiple tuples from a single event
[ https://issues.apache.org/jira/browse/IGNITE-1370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14999040#comment-14999040 ] Raúl Kripalani commented on IGNITE-1370: You can use the instanceof operator or Class.isAssignableFrom() to determine the type. > StreamTupleExtractor should allow extracting multiple tuples from a single > event > > > Key: IGNITE-1370 > URL: https://issues.apache.org/jira/browse/IGNITE-1370 > Project: Ignite > Issue Type: Improvement > Components: streaming >Affects Versions: ignite-1.4 >Reporter: Raúl Kripalani >Assignee: Raúl Kripalani > Fix For: 1.5 > > > Currently the {{StreamTupleExtractor}} interface contains a single method: > {code} > public Map.Entry extract(T msg); > {code} > Which only allows extracting a single Entry from an incoming event. > In real life, it could be that an event contains multiple entries. -- This message was sent by Atlassian JIRA (v6.3.4#6332)