flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetzger <...@git.apache.org>
Subject [GitHub] flink pull request #2350: [FLINK-4329] Fix Streaming File Source Timestamps/...
Date Thu, 18 Aug 2016 12:28:22 GMT
Github user rmetzger commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2350#discussion_r75298028
  
    --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamSource.java
---
    @@ -146,16 +146,24 @@ void checkAsyncException() {
     		private final Output<StreamRecord<T>> output;
     		private final StreamRecord<T> reuse;
     
    -		public NonTimestampContext(StreamSource<?, ?> owner, Object lockingObject, Output<StreamRecord<T>>
output) {
    -			this.owner = owner;
    +		public NonTimestampContext(AbstractStreamOperator<T> owner, Object lockingObject,
Output<StreamRecord<T>> output) {
     			this.lockingObject = lockingObject;
     			this.output = output;
     			this.reuse = new StreamRecord<T>(null);
    +
    +			// if it is a source, then we cast and cache it
    +			// here so that we do not have to do it in every collect(),
    +			// collectWithTimestamp() and emitWatermark()
    +
    +			this.owner = (owner instanceof StreamSource) ?
    +				(StreamSource) owner : null;
    --- End diff --
    
    This looks a bit hacky. How about you add an interface `AsyncException` or so, that all
classes the `NonTimestampContext` are using can use.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message