本文整理汇总了Java中backtype.storm.serialization.KryoValuesDeserializer类的典型用法代码示例。如果您正苦于以下问题:Java KryoValuesDeserializer类的具体用法?Java KryoValuesDeserializer怎么用?Java KryoValuesDeserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KryoValuesDeserializer类属于backtype.storm.serialization包,在下文中一共展示了KryoValuesDeserializer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSerialization
import backtype.storm.serialization.KryoValuesDeserializer; //导入依赖的package包/类
@Test
public void testSerialization() throws IOException {
Map conf = Utils.readDefaultConfig();
Config.registerSerialization(conf, Metadata.class);
KryoValuesSerializer kvs = new KryoValuesSerializer(conf);
Metadata md = new Metadata();
byte[] content = kvs.serializeObject(md);
KryoValuesDeserializer kvd = new KryoValuesDeserializer(conf);
Metadata md2 = (Metadata) kvd.deserializeObject(content);
// TODO compare md1 and md2
}
示例2: KryoGeneralTupleSerializer
import backtype.storm.serialization.KryoValuesDeserializer; //导入依赖的package包/类
/**
* Creates the kryo serializer for the general tuple.
* @param conf the Storm configuration file
*/
@SuppressWarnings("rawtypes")
public KryoGeneralTupleSerializer(final Map conf) {
this.valuesSer = new KryoValuesSerializer(conf);
this.valuesDeser = new KryoValuesDeserializer(conf);
this.kryoIn = new Input(1);
this.kryoOut = new Output(2000, 2000000000);
}
示例3: KryoSwitchTupleSerializer
import backtype.storm.serialization.KryoValuesDeserializer; //导入依赖的package包/类
/**
* Creates the kryo serializer for the switch tuple.
* @param conf the storm config
*/
@SuppressWarnings("rawtypes")
public KryoSwitchTupleSerializer(final Map conf) {
this.valuesSer = new KryoValuesSerializer(conf);
this.valuesDeser = new KryoValuesDeserializer(conf);
this.kryoIn = new Input(1);
this.kryoOut = new Output(2000, 2000000000);
}
示例4: BinDecoder
import backtype.storm.serialization.KryoValuesDeserializer; //导入依赖的package包/类
public BinDecoder(IRunContext context) {
_deser = new KryoValuesDeserializer(context.getStormConf());
}