org.apache.flink.util.SplittableIterator Java Examples

The following examples show how to use org.apache.flink.util.SplittableIterator. 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 File: DistributedTPCH.java    From flink-perf with Apache License 2.0 4 votes vote down vote up
public <T> DataSet<T> getGenerator(Class<? extends Iterable<T>> generatorClass, Class<T> type) {
	SplittableIterator<T> si = new TPCHGeneratorSplittableIterator(scale, env.getParallelism(), generatorClass);
	return env.fromParallelCollection(si, type).name("Generator: "+generatorClass);
}
 
Example #2
Source File: ExecutionEnvironment.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type, String callLocationName) {
	return new DataSource<>(this, new ParallelIteratorInputFormat<>(iterator), type, callLocationName);
}
 
Example #3
Source File: ParallelIteratorInputFormat.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public ParallelIteratorInputFormat(SplittableIterator<T> iterator) {
	this.source = iterator;
}
 
Example #4
Source File: FromSplittableIteratorFunction.java    From flink with Apache License 2.0 4 votes vote down vote up
public FromSplittableIteratorFunction(SplittableIterator<T> iterator) {
	this.fullIterator = iterator;
}
 
Example #5
Source File: StreamExecutionEnvironment.java    From flink with Apache License 2.0 4 votes vote down vote up
private <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
		typeInfo, String operatorName) {
	return addSource(new FromSplittableIteratorFunction<>(iterator), operatorName, typeInfo);
}
 
Example #6
Source File: StreamExecutionEnvironment.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
private <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
		typeInfo, String operatorName) {
	return addSource(new FromSplittableIteratorFunction<>(iterator), operatorName, typeInfo);
}
 
Example #7
Source File: FromSplittableIteratorFunction.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public FromSplittableIteratorFunction(SplittableIterator<T> iterator) {
	this.fullIterator = iterator;
}
 
Example #8
Source File: FromSplittableIteratorFunction.java    From flink with Apache License 2.0 4 votes vote down vote up
public FromSplittableIteratorFunction(SplittableIterator<T> iterator) {
	this.fullIterator = iterator;
}
 
Example #9
Source File: ExecutionEnvironment.java    From flink with Apache License 2.0 4 votes vote down vote up
private <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type, String callLocationName) {
	return new DataSource<>(this, new ParallelIteratorInputFormat<>(iterator), type, callLocationName);
}
 
Example #10
Source File: ParallelIteratorInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
public ParallelIteratorInputFormat(SplittableIterator<T> iterator) {
	this.source = iterator;
}
 
Example #11
Source File: ParallelIteratorInputFormat.java    From flink with Apache License 2.0 4 votes vote down vote up
public ParallelIteratorInputFormat(SplittableIterator<T> iterator) {
	this.source = iterator;
}
 
Example #12
Source File: ExecutionEnvironment.java    From flink with Apache License 2.0 4 votes vote down vote up
private <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type, String callLocationName) {
	return new DataSource<>(this, new ParallelIteratorInputFormat<>(iterator), type, callLocationName);
}
 
Example #13
Source File: StreamExecutionEnvironment.java    From flink with Apache License 2.0 4 votes vote down vote up
private <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
		typeInfo, String operatorName) {
	return addSource(new FromSplittableIteratorFunction<>(iterator), operatorName, typeInfo);
}
 
Example #14
Source File: ExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
 * framework to create a parallel data source that returns the elements in the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type of data
 * returned by the iterator must be given explicitly in the form of the type information.
 * This method is useful for cases where the type is generic. In that case, the type class
 * (as given in {@link #fromParallelCollection(SplittableIterator, Class)} does not supply all type information.
 *
 * @param iterator The iterator that produces the elements of the data set.
 * @param type The TypeInformation for the produced data set.
 * @return A DataSet representing the elements in the iterator.
 *
 * @see #fromParallelCollection(SplittableIterator, Class)
 */
public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type) {
	return fromParallelCollection(iterator, type, Utils.getCallLocationName());
}
 
Example #15
Source File: StreamExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data stream that contains elements in the iterator. The iterator is splittable,
 * allowing the framework to create a parallel data stream source that returns the elements in
 * the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type
 * of data returned by the iterator must be given explicitly in the form of the type class
 * (this is due to the fact that the Java compiler erases the generic type information).
 *
 * @param iterator
 * 		The iterator that produces the elements of the data stream
 * @param type
 * 		The class of the data produced by the iterator. Must not be a generic class.
 * @param <OUT>
 * 		The type of the returned data stream
 * @return A data stream representing the elements in the iterator
 */
public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, Class<OUT> type) {
	return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
}
 
Example #16
Source File: StreamExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data stream that contains elements in the iterator. The iterator is splittable,
 * allowing the framework to create a parallel data stream source that returns the elements in
 * the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type
 * of data returned by the iterator must be given explicitly in the form of the type class
 * (this is due to the fact that the Java compiler erases the generic type information).
 *
 * @param iterator
 * 		The iterator that produces the elements of the data stream
 * @param type
 * 		The class of the data produced by the iterator. Must not be a generic class.
 * @param <OUT>
 * 		The type of the returned data stream
 * @return A data stream representing the elements in the iterator
 */
public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, Class<OUT> type) {
	return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
}
 
Example #17
Source File: StreamExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data stream that contains elements in the iterator. The iterator is splittable,
 * allowing the framework to create a parallel data stream source that returns the elements in
 * the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type
 * of data returned by the iterator must be given explicitly in the form of the type
 * information. This method is useful for cases where the type is generic. In that case, the
 * type class (as given in
 * {@link #fromParallelCollection(org.apache.flink.util.SplittableIterator, Class)} does not
 * supply all type information.
 *
 * @param iterator
 * 		The iterator that produces the elements of the data stream
 * @param typeInfo
 * 		The TypeInformation for the produced data stream.
 * @param <OUT>
 * 		The type of the returned data stream
 * @return A data stream representing the elements in the iterator
 */
public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
		typeInfo) {
	return fromParallelCollection(iterator, typeInfo, "Parallel Collection Source");
}
 
Example #18
Source File: ExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
 * framework to create a parallel data source that returns the elements in the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type of data
 * returned by the iterator must be given explicitly in the form of the type class (this is due to the
 * fact that the Java compiler erases the generic type information).
 *
 * @param iterator The iterator that produces the elements of the data set.
 * @param type The class of the data produced by the iterator. Must not be a generic class.
 * @return A DataSet representing the elements in the iterator.
 *
 * @see #fromParallelCollection(SplittableIterator, TypeInformation)
 */
public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, Class<X> type) {
	return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
}
 
Example #19
Source File: StreamExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data stream that contains elements in the iterator. The iterator is splittable,
 * allowing the framework to create a parallel data stream source that returns the elements in
 * the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type
 * of data returned by the iterator must be given explicitly in the form of the type
 * information. This method is useful for cases where the type is generic. In that case, the
 * type class (as given in
 * {@link #fromParallelCollection(org.apache.flink.util.SplittableIterator, Class)} does not
 * supply all type information.
 *
 * @param iterator
 * 		The iterator that produces the elements of the data stream
 * @param typeInfo
 * 		The TypeInformation for the produced data stream.
 * @param <OUT>
 * 		The type of the returned data stream
 * @return A data stream representing the elements in the iterator
 */
public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
		typeInfo) {
	return fromParallelCollection(iterator, typeInfo, "Parallel Collection Source");
}
 
Example #20
Source File: ExecutionEnvironment.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
 * framework to create a parallel data source that returns the elements in the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type of data
 * returned by the iterator must be given explicitly in the form of the type class (this is due to the
 * fact that the Java compiler erases the generic type information).
 *
 * @param iterator The iterator that produces the elements of the data set.
 * @param type The class of the data produced by the iterator. Must not be a generic class.
 * @return A DataSet representing the elements in the iterator.
 *
 * @see #fromParallelCollection(SplittableIterator, TypeInformation)
 */
public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, Class<X> type) {
	return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
}
 
Example #21
Source File: ExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
 * framework to create a parallel data source that returns the elements in the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type of data
 * returned by the iterator must be given explicitly in the form of the type information.
 * This method is useful for cases where the type is generic. In that case, the type class
 * (as given in {@link #fromParallelCollection(SplittableIterator, Class)} does not supply all type information.
 *
 * @param iterator The iterator that produces the elements of the data set.
 * @param type The TypeInformation for the produced data set.
 * @return A DataSet representing the elements in the iterator.
 *
 * @see #fromParallelCollection(SplittableIterator, Class)
 */
public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type) {
	return fromParallelCollection(iterator, type, Utils.getCallLocationName());
}
 
Example #22
Source File: ExecutionEnvironment.java    From flink with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
 * framework to create a parallel data source that returns the elements in the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type of data
 * returned by the iterator must be given explicitly in the form of the type class (this is due to the
 * fact that the Java compiler erases the generic type information).
 *
 * @param iterator The iterator that produces the elements of the data set.
 * @param type The class of the data produced by the iterator. Must not be a generic class.
 * @return A DataSet representing the elements in the iterator.
 *
 * @see #fromParallelCollection(SplittableIterator, TypeInformation)
 */
public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, Class<X> type) {
	return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
}
 
Example #23
Source File: StreamExecutionEnvironment.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data stream that contains elements in the iterator. The iterator is splittable,
 * allowing the framework to create a parallel data stream source that returns the elements in
 * the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type
 * of data returned by the iterator must be given explicitly in the form of the type
 * information. This method is useful for cases where the type is generic. In that case, the
 * type class (as given in
 * {@link #fromParallelCollection(org.apache.flink.util.SplittableIterator, Class)} does not
 * supply all type information.
 *
 * @param iterator
 * 		The iterator that produces the elements of the data stream
 * @param typeInfo
 * 		The TypeInformation for the produced data stream.
 * @param <OUT>
 * 		The type of the returned data stream
 * @return A data stream representing the elements in the iterator
 */
public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, TypeInformation<OUT>
		typeInfo) {
	return fromParallelCollection(iterator, typeInfo, "Parallel Collection Source");
}
 
Example #24
Source File: StreamExecutionEnvironment.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data stream that contains elements in the iterator. The iterator is splittable,
 * allowing the framework to create a parallel data stream source that returns the elements in
 * the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type
 * of data returned by the iterator must be given explicitly in the form of the type class
 * (this is due to the fact that the Java compiler erases the generic type information).
 *
 * @param iterator
 * 		The iterator that produces the elements of the data stream
 * @param type
 * 		The class of the data produced by the iterator. Must not be a generic class.
 * @param <OUT>
 * 		The type of the returned data stream
 * @return A data stream representing the elements in the iterator
 */
public <OUT> DataStreamSource<OUT> fromParallelCollection(SplittableIterator<OUT> iterator, Class<OUT> type) {
	return fromParallelCollection(iterator, TypeExtractor.getForClass(type));
}
 
Example #25
Source File: ExecutionEnvironment.java    From Flink-CEPplus with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
 * framework to create a parallel data source that returns the elements in the iterator.
 *
 * <p>Because the iterator will remain unmodified until the actual execution happens, the type of data
 * returned by the iterator must be given explicitly in the form of the type information.
 * This method is useful for cases where the type is generic. In that case, the type class
 * (as given in {@link #fromParallelCollection(SplittableIterator, Class)} does not supply all type information.
 *
 * @param iterator The iterator that produces the elements of the data set.
 * @param type The TypeInformation for the produced data set.
 * @return A DataSet representing the elements in the iterator.
 *
 * @see #fromParallelCollection(SplittableIterator, Class)
 */
public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type) {
	return fromParallelCollection(iterator, type, Utils.getCallLocationName());
}