flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbalassi <...@git.apache.org>
Subject [GitHub] flink pull request: [FLINK-1687] [streaming] Syncing streaming sou...
Date Mon, 18 May 2015 16:20:55 GMT
Github user mbalassi commented on a diff in the pull request:

    https://github.com/apache/flink/pull/521#discussion_r30523005
  
    --- Diff: flink-staging/flink-streaming/flink-streaming-core/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java
---
    @@ -378,31 +390,271 @@ public void registerType(Class<?> type) {
     	// --------------------------------------------------------------------------------------------
     
     	/**
    -	 * Creates a DataStream that represents the Strings produced by reading the
    -	 * given file line wise. The file will be read with the system's default
    -	 * character set.
    -	 * 
    +	 * Creates a new data stream that contains a sequence of numbers. The data stream will
be created with parallelism
    +	 * one, so the order of the elements is guaranteed.
    +	 *
    +	 * @param from
    +	 * 		The number to start at (inclusive)
    +	 * @param to
    +	 * 		The number to stop at (inclusive)
    +	 * @return A data stream, containing all number in the [from, to] interval
    +	 */
    +	public DataStreamSource<Long> generateSequence(long from, long to) {
    +		if (from > to) {
    +			throw new IllegalArgumentException("Start of sequence must not be greater than the
end");
    +		}
    +		return addSource(new GenSequenceFunction(from, to), "Sequence Source");
    +	}
    --- End diff --
    
    The `GenSequenceFunction` is a `ParallelSource` itself, this would give the same behaviour
as the `generateParallelSource()`.


---
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