本文整理汇总了Java中org.apache.flink.api.common.typeinfo.TypeHint.getTypeInfo方法的典型用法代码示例。如果您正苦于以下问题:Java TypeHint.getTypeInfo方法的具体用法?Java TypeHint.getTypeInfo怎么用?Java TypeHint.getTypeInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.flink.api.common.typeinfo.TypeHint
的用法示例。
在下文中一共展示了TypeHint.getTypeInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OutputTag
import org.apache.flink.api.common.typeinfo.TypeHint; //导入方法依赖的package包/类
/**
* Creates a new named {@code OutputTag} with the given id.
*
* @param id The id of the created {@code OutputTag}.
*/
public OutputTag(String id) {
Preconditions.checkNotNull(id, "OutputTag id cannot be null.");
Preconditions.checkArgument(!id.isEmpty(), "OutputTag id must not be empty.");
this.id = id;
try {
TypeHint<T> typeHint = new TypeHint<T>(OutputTag.class, this, 0) {};
this.typeInfo = typeHint.getTypeInfo();
} catch (InvalidTypesException e) {
throw new InvalidTypesException("Could not determine TypeInformation for generic " +
"OutputTag type. Did you forget to make your OutputTag an anonymous inner class?", e);
}
}
示例2: getKvState
import org.apache.flink.api.common.typeinfo.TypeHint; //导入方法依赖的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 keyTypeHint A {@link TypeHint} used to extract the type 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 TypeHint<K> keyTypeHint,
final StateDescriptor<S, V> stateDescriptor) {
Preconditions.checkNotNull(keyTypeHint);
TypeInformation<K> keyTypeInfo = keyTypeHint.getTypeInfo();
return getKvState(jobId, queryableStateName, key, keyTypeInfo, stateDescriptor);
}
示例3: getKvState
import org.apache.flink.api.common.typeinfo.TypeHint; //导入方法依赖的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 keyTypeHint A {@link TypeHint} used to extract the type 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 TypeHint<K> keyTypeHint,
final StateDescriptor<S, V> stateDescriptor) {
Preconditions.checkNotNull(keyTypeHint);
TypeInformation<K> keyTypeInfo = keyTypeHint.getTypeInfo();
return getKvState(jobId, queryableStateName, key, keyTypeInfo, stateDescriptor);
}
示例4: getKvState
import org.apache.flink.api.common.typeinfo.TypeHint; //导入方法依赖的package包/类
/**
* Returns a future holding the request result.
*
* <p>If the server does not serve a KvState instance with the given ID,
* the Future will be failed with a {@link UnknownKvStateID}.
*
* <p>If the KvState instance does not hold any data for the given key
* and namespace, the Future will be failed with a {@link UnknownKeyOrNamespace}.
*
* <p>All other failures are forwarded to the Future.
*
* @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 keyTypeHint A {@link TypeHint} used to extract the type of the key.
* @param stateDescriptor The {@link StateDescriptor} of the state we want to query.
* @return Future holding the result.
*/
@PublicEvolving
public <K, V> Future<V> getKvState(
final JobID jobId,
final String queryableStateName,
final K key,
final TypeHint<K> keyTypeHint,
final StateDescriptor<?, V> stateDescriptor) {
Preconditions.checkNotNull(keyTypeHint);
TypeInformation<K> keyTypeInfo = keyTypeHint.getTypeInfo();
return getKvState(jobId, queryableStateName, key, keyTypeInfo, stateDescriptor);
}