• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java PublicEvolving类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.apache.flink.annotation.PublicEvolving的典型用法代码示例。如果您正苦于以下问题:Java PublicEvolving类的具体用法?Java PublicEvolving怎么用?Java PublicEvolving使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

PublicEvolving类属于org.apache.flink.annotation包,在下文中一共展示了PublicEvolving类的39个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: aggregate

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Applies the given {@code AggregateFunction} to each window. The AggregateFunction
 * aggregates all elements of a window into a single result element. The stream of these
 * result elements (one per window) is interpreted as a regular non-windowed stream.
 *
 * @param function The aggregation function.
 * @return The data stream that is the result of applying the fold function to the window.
 *
 * @param <ACC> The type of the AggregateFunction's accumulator
 * @param <R> The type of the elements in the resulting stream, equal to the
 *            AggregateFunction's result type
 */
@PublicEvolving
public <ACC, R> SingleOutputStreamOperator<R> aggregate(AggregateFunction<T, ACC, R> function) {
	checkNotNull(function, "function");

	if (function instanceof RichFunction) {
		throw new UnsupportedOperationException("This aggregation function cannot be a RichFunction.");
	}

	TypeInformation<ACC> accumulatorType = TypeExtractor.getAggregateFunctionAccumulatorType(
			function, input.getType(), null, false);

	TypeInformation<R> resultType = TypeExtractor.getAggregateFunctionReturnType(
			function, input.getType(), null, false);

	return aggregate(function, accumulatorType, resultType);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:29,
代码来源:AllWindowedStream.java

示例2: asQueryableState

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Publishes the keyed stream as a queryable ValueState instance.
 *
 * @param queryableStateName Name under which to the publish the queryable state instance
 * @param stateDescriptor State descriptor to create state instance from
 * @return Queryable state instance
 */
@PublicEvolving
public QueryableStateStream<KEY, T> asQueryableState(
		String queryableStateName,
		ValueStateDescriptor<T> stateDescriptor) {

	transform("Queryable state: " + queryableStateName,
			getType(),
			new QueryableValueStateOperator<>(queryableStateName, stateDescriptor));

	stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig());

	return new QueryableStateStream<>(
			queryableStateName,
			stateDescriptor,
			getKeyType().createSerializer(getExecutionConfig()));
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:24,
代码来源:KeyedStream.java

示例3: startNewSession

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public void startNewSession() throws Exception {
	if (executor != null) {
		// we need to end the previous session
		executor.stop();
		// create also a new JobID
		jobID = JobID.generate();
	}

	// create a new local executor
	executor = PlanExecutor.createLocalExecutor(configuration);
	executor.setPrintStatusDuringExecution(getConfig().isSysoutLoggingEnabled());

	// if we have a session, start the mini cluster eagerly to have it available across sessions
	if (getSessionTimeout() > 0) {
		executor.start();

		// also install the reaper that will shut it down eventually
		executorReaper = new ExecutorReaper(executor);
	}
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:23,
代码来源:LocalEnvironment.java

示例4: process

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Applies the given {@link ProcessFunction} on the input stream, thereby
 * creating a transformed output stream.
 *
 * <p>The function will be called for every element in the input streams and can produce zero
 * or more output elements.
 *
 * @param processFunction The {@link ProcessFunction} that is called for each element
 *                      in the stream.
 *
 * @param <R> The type of elements emitted by the {@code ProcessFunction}.
 *
 * @return The transformed {@link DataStream}.
 */
@PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessFunction<T, R> processFunction) {

	TypeInformation<R> outType = TypeExtractor.getUnaryOperatorReturnType(
		processFunction,
		ProcessFunction.class,
		0,
		1,
		TypeExtractor.NO_INDEX,
		TypeExtractor.NO_INDEX,
		getType(),
		Utils.getCallLocationName(),
		true);

	return process(processFunction, outType);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:31,
代码来源:DataStream.java

示例5: WithWindow

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
protected WithWindow(DataStream<T1> input1,
		DataStream<T2> input2,
		KeySelector<T1, KEY> keySelector1,
		KeySelector<T2, KEY> keySelector2,
		TypeInformation<KEY> keyType,
		WindowAssigner<? super TaggedUnion<T1, T2>, W> windowAssigner,
		Trigger<? super TaggedUnion<T1, T2>, ? super W> trigger,
		Evictor<? super TaggedUnion<T1, T2>, ? super W> evictor) {

	this.input1 = requireNonNull(input1);
	this.input2 = requireNonNull(input2);

	this.keySelector1 = requireNonNull(keySelector1);
	this.keySelector2 = requireNonNull(keySelector2);
	this.keyType = requireNonNull(keyType);

	this.windowAssigner = requireNonNull(windowAssigner);

	this.trigger = trigger;
	this.evictor = evictor;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:23,
代码来源:JoinedStreams.java

示例6: process

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Applies the given {@link ProcessFunction} on the input stream, thereby
 * creating a transformed output stream.
 *
 * <p>The function will be called for every element in the input streams and can produce zero
 * or more output elements. Contrary to the {@link DataStream#flatMap(FlatMapFunction)}
 * function, this function can also query the time and set timers. When reacting to the firing
 * of set timers the function can directly emit elements and/or register yet more timers.
 *
 * @param processFunction The {@link ProcessFunction} that is called for each element
 *                      in the stream.
 *
 * @param <R> The type of elements emitted by the {@code ProcessFunction}.
 *
 * @return The transformed {@link DataStream}.
 */
@Override
@PublicEvolving
public <R> SingleOutputStreamOperator<R> process(ProcessFunction<T, R> processFunction) {

	TypeInformation<R> outType = TypeExtractor.getUnaryOperatorReturnType(
		processFunction,
		ProcessFunction.class,
		0,
		1,
		TypeExtractor.NO_INDEX,
		TypeExtractor.NO_INDEX,
		getType(),
		Utils.getCallLocationName(),
		true);

	return process(processFunction, outType);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:34,
代码来源:KeyedStream.java

示例7: getAggregateFunctionAccumulatorType

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public static <IN, ACC> TypeInformation<ACC> getAggregateFunctionAccumulatorType(
		AggregateFunction<IN, ACC, ?> function,
		TypeInformation<IN> inType,
		String functionName,
		boolean allowMissing)
{
	return getUnaryOperatorReturnType(
		function,
		AggregateFunction.class,
		0,
		1,
		new int[]{0},
		NO_INDEX,
		inType,
		functionName,
		allowMissing);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:19,
代码来源:TypeExtractor.java

示例8: transform

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Method for passing user defined operators along with the type
 * information that will transform the DataStream.
 *
 * @param operatorName
 *            name of the operator, for logging purposes
 * @param outTypeInfo
 *            the output type of the operator
 * @param operator
 *            the object containing the transformation logic
 * @param <R>
 *            type of the return stream
 * @return the data stream constructed
 */
@PublicEvolving
public <R> SingleOutputStreamOperator<R> transform(String operatorName, TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {

	// read the output type of the input Transform to coax out errors about MissingTypeInfo
	transformation.getOutputType();

	OneInputTransformation<T, R> resultTransform = new OneInputTransformation<>(
			this.transformation,
			operatorName,
			operator,
			outTypeInfo,
			environment.getParallelism());

	@SuppressWarnings({ "unchecked", "rawtypes" })
	SingleOutputStreamOperator<R> returnStream = new SingleOutputStreamOperator(environment, resultTransform);

	getExecutionEnvironment().addOperator(resultTransform);

	return returnStream;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:35,
代码来源:DataStream.java

示例9: getJoinReturnTypes

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public static <IN1, IN2, OUT> TypeInformation<OUT> getJoinReturnTypes(JoinFunction<IN1, IN2, OUT> joinInterface,
		TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
{
	return getBinaryOperatorReturnType(
		(Function) joinInterface,
		JoinFunction.class,
		0,
		1,
		2,
		new int[]{0},
		new int[]{1},
		NO_INDEX,
		in1Type,
		in2Type,
		functionName,
		allowMissing);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:19,
代码来源:TypeExtractor.java

示例10: getCoGroupReturnTypes

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public static <IN1, IN2, OUT> TypeInformation<OUT> getCoGroupReturnTypes(CoGroupFunction<IN1, IN2, OUT> coGroupInterface,
		TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
{
	return getBinaryOperatorReturnType(
		(Function) coGroupInterface,
		CoGroupFunction.class,
		0,
		1,
		2,
		new int[]{0, 0},
		new int[]{1, 0},
		new int[]{2, 0},
		in1Type,
		in2Type,
		functionName,
		allowMissing);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:19,
代码来源:TypeExtractor.java

示例11: getAllDeclaredFields

点赞 3

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Recursively determine all declared fields
 * This is required because class.getFields() is not returning fields defined
 * in parent classes.
 *
 * @param clazz class to be analyzed
 * @param ignoreDuplicates if true, in case of duplicate field names only the lowest one
 *                            in a hierarchy will be returned; throws an exception otherwise
 * @return list of fields
 */
@PublicEvolving
public static List<Field> getAllDeclaredFields(Class<?> clazz, boolean ignoreDuplicates) {
	List<Field> result = new ArrayList<Field>();
	while (clazz != null) {
		Field[] fields = clazz.getDeclaredFields();
		for (Field field : fields) {
			if(Modifier.isTransient(field.getModifiers()) || Modifier.isStatic(field.getModifiers())) {
				continue; // we have no use for transient or static fields
			}
			if(hasFieldWithSameName(field.getName(), result)) {
				if (ignoreDuplicates) {
					continue;
				} else {
					throw new InvalidTypesException("The field "+field+" is already contained in the hierarchy of the "+clazz+"."
						+ "Please use unique field names through your classes hierarchy");
				}
			}
			result.add(field);
		}
		clazz = clazz.getSuperclass();
	}
	return result;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:34,
代码来源:TypeExtractor.java

示例12: forceNonParallel

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Sets the parallelism and maximum parallelism of this operator to one.
 * And mark this operator cannot set a non-1 degree of parallelism.
 *
 * @return The operator with only one parallelism.
 */
@PublicEvolving
public SingleOutputStreamOperator<T> forceNonParallel() {
	transformation.setParallelism(1);
	transformation.setMaxParallelism(1);
	nonParallel = true;
	return this;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:14,
代码来源:SingleOutputStreamOperator.java

示例13: getIntCounterResult

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Gets the accumulator with the given name as an integer.
 *
 * @param accumulatorName Name of the counter
 * @return Result of the counter, or null if the counter does not exist
 * @throws java.lang.ClassCastException Thrown, if the accumulator was not aggregating a {@link java.lang.Integer}
 * @deprecated Will be removed in future versions. Use {@link #getAccumulatorResult} instead.
 */
@Deprecated
@PublicEvolving
public Integer getIntCounterResult(String accumulatorName) {
	Object result = this.accumulatorResults.get(accumulatorName);
	if (result == null) {
		return null;
	}
	if (!(result instanceof Integer)) {
		throw new ClassCastException("Requested result of the accumulator '" + accumulatorName
						+ "' should be Integer but has type " + result.getClass());
	}
	return (Integer) result;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:22,
代码来源:JobExecutionResult.java

示例14: createSerializer

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@PublicEvolving
public TypeSerializer<T> createSerializer(ExecutionConfig executionConfig) {
	return (TypeSerializer<T>) new GenericArraySerializer<C>(
		componentInfo.getTypeClass(),
		componentInfo.createSerializer(executionConfig));
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:9,
代码来源:ObjectArrayTypeInfo.java

示例15: getInfoFor

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public static <T, C> ObjectArrayTypeInfo<T, C> getInfoFor(Class<T> arrayClass, TypeInformation<C> componentInfo) {
	checkNotNull(arrayClass);
	checkNotNull(componentInfo);
	checkArgument(arrayClass.isArray(), "Class " + arrayClass + " must be an array.");

	return new ObjectArrayTypeInfo<T, C>(arrayClass, componentInfo);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:9,
代码来源:ObjectArrayTypeInfo.java

示例16: AllWindowedStream

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public AllWindowedStream(DataStream<T> input,
		WindowAssigner<? super T, W> windowAssigner) {
	this.input = input.keyBy(new NullByteKeySelector<T>());
	this.windowAssigner = windowAssigner;
	this.trigger = windowAssigner.getDefaultTrigger(input.getExecutionEnvironment());
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:8,
代码来源:AllWindowedStream.java

示例17: allowedLateness

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Sets the time by which elements are allowed to be late. Elements that
 * arrive behind the watermark by more than the specified time will be dropped.
 * By default, the allowed lateness is {@code 0L}.
 *
 * <p>Setting an allowed lateness is only valid for event-time windows.
 */
@PublicEvolving
public WindowedStream<T, K, W> allowedLateness(Time lateness) {
	final long millis = lateness.toMilliseconds();
	checkArgument(millis >= 0, "The allowed lateness cannot be negative.");

	this.allowedLateness = millis;
	return this;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:16,
代码来源:WindowedStream.java

示例18: WritableTypeInfo

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public WritableTypeInfo(Class<T> typeClass) {
	this.typeClass = checkNotNull(typeClass);

	checkArgument(
		Writable.class.isAssignableFrom(typeClass) && !typeClass.equals(Writable.class),
		"WritableTypeInfo can only be used for subclasses of %s", Writable.class.getName());
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:9,
代码来源:WritableTypeInfo.java

示例19: sortLocalOutput

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Sorts each local partition of a {@link org.apache.flink.api.java.tuple.Tuple} data set
 * on the specified field in the specified {@link Order} before it is emitted by the output format.
 *
 * <p><b>Note: Only tuple data sets can be sorted using integer field indices.</b>
 *
 * <p>The tuple data set can be sorted on multiple fields in different orders
 * by chaining {@link #sortLocalOutput(int, Order)} calls.
 *
 * @param field The Tuple field on which the data set is locally sorted.
 * @param order The Order in which the specified Tuple field is locally sorted.
 * @return This data sink operator with specified output order.
 *
 * @see org.apache.flink.api.java.tuple.Tuple
 * @see Order
 *
 * @deprecated Use {@link DataSet#sortPartition(int, Order)} instead
 */
@Deprecated
@PublicEvolving
public DataSink<T> sortLocalOutput(int field, Order order) {

	// get flat keys
	Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(field, this.type);
	int[] flatKeys = ek.computeLogicalKeyPositions();

	if (!Keys.ExpressionKeys.isSortKey(field, this.type)) {
		throw new InvalidProgramException("Selected sort key is not a sortable type");
	}

	if (this.sortKeyPositions == null) {
		// set sorting info
		this.sortKeyPositions = flatKeys;
		this.sortOrders = new Order[flatKeys.length];
		Arrays.fill(this.sortOrders, order);
	} else {
		// append sorting info to exising info
		int oldLength = this.sortKeyPositions.length;
		int newLength = oldLength + flatKeys.length;
		this.sortKeyPositions = Arrays.copyOf(this.sortKeyPositions, newLength);
		this.sortOrders = Arrays.copyOf(this.sortOrders, newLength);

		for (int i = 0; i < flatKeys.length; i++) {
			this.sortKeyPositions[oldLength + i] = flatKeys[i];
			this.sortOrders[oldLength + i] = order;
		}
	}

	return this;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:51,
代码来源:DataSink.java

示例20: createSerializer

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public TypeSerializer<T> createSerializer(ExecutionConfig config) {
	if (config.hasGenericTypesDisabled()) {
		throw new UnsupportedOperationException(
			"Generic types have been disabled in the ExecutionConfig and type " + this.typeClass.getName() +
			" is treated as a generic type.");
	}

	return new KryoSerializer<T>(this.typeClass, config);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:12,
代码来源:GenericTypeInfo.java

示例21: WindowedStream

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public WindowedStream(KeyedStream<T, K> input,
		WindowAssigner<? super T, W> windowAssigner) {
	this.input = input;
	this.windowAssigner = windowAssigner;
	this.trigger = windowAssigner.getDefaultTrigger(input.getExecutionEnvironment());
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:8,
代码来源:WindowedStream.java

示例22: getMapReturnTypes

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public static <IN, OUT> TypeInformation<OUT> getMapReturnTypes(MapFunction<IN, OUT> mapInterface, TypeInformation<IN> inType,
		String functionName, boolean allowMissing)
{
	return getUnaryOperatorReturnType(
		(Function) mapInterface,
		MapFunction.class,
		0,
		1,
		new int[]{0},
		NO_INDEX,
		inType,
		functionName,
		allowMissing);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:16,
代码来源:TypeExtractor.java

示例23: getFlatMapReturnTypes

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public static <IN, OUT> TypeInformation<OUT> getFlatMapReturnTypes(FlatMapFunction<IN, OUT> flatMapInterface, TypeInformation<IN> inType,
		String functionName, boolean allowMissing)
{
	return getUnaryOperatorReturnType(
		(Function) flatMapInterface,
		FlatMapFunction.class,
		0,
		1,
		new int[]{0},
		new int[]{1, 0},
		inType,
		functionName,
		allowMissing);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:16,
代码来源:TypeExtractor.java

示例24: getFoldReturnTypes

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * @deprecated will be removed in a future version
 */
@PublicEvolving
@Deprecated
public static <IN, OUT> TypeInformation<OUT> getFoldReturnTypes(FoldFunction<IN, OUT> foldInterface, TypeInformation<IN> inType)
{
	return getFoldReturnTypes(foldInterface, inType, null, false);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:10,
代码来源:TypeExtractor.java

示例25: createLocalEnvironmentWithWebUI

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Creates a {@link LocalStreamEnvironment} for local program execution that also starts the
 * web monitoring UI.
 *
 * <p>The local execution environment will run the program in a multi-threaded fashion in
 * the same JVM as the environment was created in. It will use the parallelism specified in the
 * parameter.
 *
 * <p>If the configuration key 'jobmanager.web.port' was set in the configuration, that particular
 * port will be used for the web UI. Otherwise, the default port (8081) will be used.
 */
@PublicEvolving
public static StreamExecutionEnvironment createLocalEnvironmentWithWebUI(Configuration conf) {
	checkNotNull(conf, "conf");

	conf.setBoolean(ConfigConstants.LOCAL_START_WEBSERVER, true);

	LocalStreamEnvironment localEnv = new LocalStreamEnvironment(conf);
	localEnv.setParallelism(defaultLocalParallelism);

	return localEnv;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:23,
代码来源:StreamExecutionEnvironment.java

示例26: createComparator

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if(Comparable.class.isAssignableFrom(typeClass)) {
		return new WritableComparator(sortOrderAscending, typeClass);
	}
	else {
		throw new UnsupportedOperationException("Cannot create Comparator for "+typeClass.getCanonicalName()+". " +
												"Class does not implement Comparable interface.");
	}
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:13,
代码来源:WritableTypeInfo.java

示例27: getCurrentState

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
@Override
public Tuple2<Long, Long> getCurrentState() throws IOException {
	if (this.blockBasedInput == null) {
		throw new RuntimeException("You must have forgotten to call open() on your input format.");
	}

	return  new Tuple2<>(
		this.blockBasedInput.getCurrBlockPos(), 		// the last read index in the block
		this.readRecords								// the number of records read
	);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:13,
代码来源:BinaryInputFormat.java

示例28: getInfoFor

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@PublicEvolving
public static <X, C> BasicArrayTypeInfo<X, C> getInfoFor(Class<X> type) {
	if (!type.isArray()) {
		throw new InvalidTypesException("The given class is no array.");
	}

	// basic type arrays
	return (BasicArrayTypeInfo<X, C>) TYPES.get(type);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:11,
代码来源:BasicArrayTypeInfo.java

示例29: getInputFormatTypes

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@PublicEvolving
public static <IN> TypeInformation<IN> getInputFormatTypes(InputFormat<IN, ?> inputFormatInterface) {
	if (inputFormatInterface instanceof ResultTypeQueryable) {
		return ((ResultTypeQueryable<IN>) inputFormatInterface).getProducedType();
	}
	return new TypeExtractor().privateCreateTypeInfo(InputFormat.class, inputFormatInterface.getClass(), 0, null, null);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:9,
代码来源:TypeExtractor.java

示例30: getKvState

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
/**
 * Returns a future holding the request result.
 * @param jobId                     JobID of the job the queryable state belongs to.
 * @param queryableStateName        Name under which the state is queryable.
 * @param key			            The key we are interested in.
 * @param keyTypeInfo				The {@link TypeInformation} of the key.
 * @param stateDescriptor			The {@link StateDescriptor} of the state we want to query.
 * @return Future holding the immutable {@link State} object containing the result.
 */
@PublicEvolving
public <K, S extends State, V> CompletableFuture<S> getKvState(
		final JobID jobId,
		final String queryableStateName,
		final K key,
		final TypeInformation<K> keyTypeInfo,
		final StateDescriptor<S, V> stateDescriptor) {

	return getKvState(jobId, queryableStateName, key, VoidNamespace.INSTANCE,
			keyTypeInfo, VoidNamespaceTypeInfo.INSTANCE, stateDescriptor);
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:21,
代码来源:QueryableStateClient.java

示例31: TupleTypeInfo

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@PublicEvolving
public TupleTypeInfo(Class<T> tupleType, TypeInformation<?>... types) {
	super(tupleType, types);

	checkArgument(
		types.length <= Tuple.MAX_ARITY,
		"The tuple type exceeds the maximum supported arity.");

	this.fieldNames = new String[types.length];

	for (int i = 0; i < types.length; i++) {
		fieldNames[i] = "f" + i;
	}
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:15,
代码来源:TupleTypeInfo.java

示例32: getFieldIndex

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public int getFieldIndex(String fieldName) {
	for (int i = 0; i < fieldNames.length; i++) {
		if (fieldNames[i].equals(fieldName)) {
			return i;
		}
	}
	return -1;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:11,
代码来源:TupleTypeInfo.java

示例33: createComparator

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (comparatorClass != null) {
		return instantiateComparator(comparatorClass, sortOrderAscending);
	} else {
		throw new InvalidTypesException("The type " + clazz.getSimpleName() + " cannot be used as a key.");
	}
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:10,
代码来源:BasicTypeInfo.java

示例34: isBasicType

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public boolean isBasicType() {
	return false;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:6,
代码来源:EitherTypeInfo.java

示例35: getTotalFields

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public int getTotalFields() {
	return 0;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:6,
代码来源:VoidNamespaceTypeInfo.java

示例36: isKeyType

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public boolean isKeyType() {
	return true;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:6,
代码来源:PrimitiveArrayTypeInfo.java

示例37: getState

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public <T> ValueState<T> getState(ValueStateDescriptor<T> stateProperties) {
	throw new UnsupportedOperationException(
			"This state is only accessible by functions executed on a KeyedStream");
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:7,
代码来源:AbstractRuntimeUDFContext.java

示例38: getTypeAt

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
@PublicEvolving
public <X> TypeInformation<X> getTypeAt(String fieldExpression) {

	Matcher matcher = PATTERN_NESTED_FIELDS.matcher(fieldExpression);
	if(!matcher.matches()) {
		if (fieldExpression.startsWith(ExpressionKeys.SELECT_ALL_CHAR) || fieldExpression.startsWith(ExpressionKeys.SELECT_ALL_CHAR_SCALA)) {
			throw new InvalidFieldReferenceException("Wildcard expressions are not allowed here.");
		} else {
			throw new InvalidFieldReferenceException("Invalid format of POJO field expression \""+fieldExpression+"\".");
		}
	}

	String field = matcher.group(1);
	// get field
	int fieldPos = -1;
	TypeInformation<?> fieldType = null;
	for (int i = 0; i < fields.length; i++) {
		if (fields[i].getField().getName().equals(field)) {
			fieldPos = i;
			fieldType = fields[i].getTypeInformation();
			break;
		}
	}
	if (fieldPos == -1) {
		throw new InvalidFieldReferenceException("Unable to find field \""+field+"\" in type "+this+".");
	}

	String tail = matcher.group(3);
	if(tail == null) {
		// we found the type
		return (TypeInformation<X>) fieldType;
	} else {
		if(fieldType instanceof CompositeType<?>) {
			return ((CompositeType<?>) fieldType).getTypeAt(tail);
		} else {
			throw new InvalidFieldReferenceException("Nested field expression \""+tail+"\" not possible on atomic type "+fieldType+".");
		}
	}
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:42,
代码来源:PojoTypeInfo.java

示例39: isTupleType

点赞 2

import org.apache.flink.annotation.PublicEvolving; //导入依赖的package包/类
@Override
@PublicEvolving
public boolean isTupleType() {
	return false;
}
 

开发者ID:axbaretto,
项目名称:flink,
代码行数:6,
代码来源:WritableTypeInfo.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)