在 Apache Ignite 中插入自定义序列化程序
我试图在 Binary Configuration bean 中添加 Kyro Serializer,但在运行时它给了我一个类类型转换错误。
我的代码是
<property name="binaryConfiguration">
<bean class="org.apache.ignite.configuration.BinaryConfiguration">
<property name="typeConfigurations">
<list>
<bean class="org.apache.ignite.binary.BinaryTypeConfiguration">
<property name="typeName" value="testPojo" />
<property name="serializer">
<bean class="com.esotericsoftware.kryo.serializers.DefaultSerializers" />
</property>
</bean>
</list>
</property>
</bean>
</property>
错误日志是
Caused by: java.lang.IllegalStateException: Cannot convert value of type [com.esotericsoftware.kryo.serializers.DefaultSerializers] to required type [org.apache.ignite.binary.BinarySerializer] for property 'serializer': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:302)
at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:576)
... 104 more
在挖掘 Apache Ignite 提供的 BinarySerializer 时,得出的结论是,必须为序列化器编写自定义实现作为其他插件序列化器来实现它。
Optimized Marshaller 有什么好处?