本文整理汇总了Java中org.apache.samza.serializers.SerdeFactory类的典型用法代码示例。如果您正苦于以下问题:Java SerdeFactory类的具体用法?Java SerdeFactory怎么用?Java SerdeFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SerdeFactory类属于org.apache.samza.serializers包,在下文中一共展示了SerdeFactory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setSerde
import org.apache.samza.serializers.SerdeFactory; //导入依赖的package包/类
/**
* set the serde for this appender. It looks for the stream serde first, then system serde.
* If still can not get the serde, throws exceptions.
*
* @param log4jSystemConfig log4jSystemConfig for this appender
* @param systemName name of the system
* @param streamName name of the stream
*/
private void setSerde(Log4jSystemConfig log4jSystemConfig, String systemName, String streamName) {
String serdeClass = LoggingEventJsonSerdeFactory.class.getCanonicalName();
String serdeName = log4jSystemConfig.getStreamSerdeName(systemName, streamName);
if (serdeName != null) {
serdeClass = log4jSystemConfig.getSerdeClass(serdeName);
}
if (serdeClass != null) {
SerdeFactory<LoggingEvent> serdeFactory = Util.<SerdeFactory<LoggingEvent>>getObj(serdeClass);
serde = serdeFactory.getSerde(systemName, config);
} else {
String serdeKey = String.format(SerializerConfig.SERDE_FACTORY_CLASS(), serdeName);
throw new SamzaException("Can not find serializers class for key '" + serdeName + "'. Please specify " +
serdeKey + " property");
}
}
开发者ID:apache,项目名称:samza,代码行数:26,代码来源:StreamAppender.java
示例2: addSerde
import org.apache.samza.serializers.SerdeFactory; //导入依赖的package包/类
public SamzaJobConfigBuilder addSerde(String name, Class<? extends SerdeFactory> serdeClass) {
isNullOrEmpty(name, "Serde name");
isNull(serdeClass, "Serde class");
put(format(SERIALIZER_SERDE_CLASS, name), serdeClass.getName());
return this;
}
开发者ID:FreshetDMS,项目名称:Freshet-Deprecated,代码行数:9,代码来源:SamzaJobConfigBuilder.java
示例3: getSerdeFromName
import org.apache.samza.serializers.SerdeFactory; //导入依赖的package包/类
/**
* A helper method to get the Serde from the serdeName
*
* @param name serde name
* @param serializerConfig serializer config
* @return a Serde of this serde name
*/
private Serde<Object> getSerdeFromName(String name, JavaSerializerConfig serializerConfig) {
String serdeClassName = serializerConfig.getSerdeClass(name);
if (serdeClassName == null) {
serdeClassName = Util.defaultSerdeFactoryFromSerdeName(name);
}
return Util.<SerdeFactory<Object>> getObj(serdeClassName).getSerde(name, serializerConfig);
}
开发者ID:apache,项目名称:samza,代码行数:15,代码来源:RocksDbKeyValueReader.java
注:本文中的org.apache.samza.serializers.SerdeFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论