接口 RedisMapper<T>
-
- 类型参数:
T- The type of the element handled by thisRedisMapper
- 所有超级接口:
org.apache.flink.api.common.functions.Function,Serializable
- 所有已知实现类:
SetRedisMapper
public interface RedisMapper<T> extends org.apache.flink.api.common.functions.Function, Serializable
Function that creates the description how the input data should be mapped to redis type.Example:
private static class RedisTestMapper implements RedisMapper<Tuple2<String, String>> { public RedisDataTypeDescription getCommandDescription() { return new RedisDataTypeDescription(RedisCommand.PUBLISH); } public String getKeyFromData(Tuple2<String, String> data) { return data.f0; } public String getValueFromData(Tuple2<String, String> data) { return data.f1; } }
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 RedisCommandDescriptiongetCommandDescription()Returns descriptor which defines data type.StringgetKeyFromData(T data)Extracts key from data.StringgetValueFromData(T data)Extracts value from data.
-
-
-
方法详细资料
-
getCommandDescription
RedisCommandDescription getCommandDescription()
Returns descriptor which defines data type.- 返回:
- data type descriptor
-
getKeyFromData
String getKeyFromData(T data)
Extracts key from data.- 参数:
data- source data- 返回:
- key
-
-