@Override public void prepare(Map<String, Object> topoConf, Object registrationArgument, TopologyContext context, IErrorReporter errorReporter) { try { url = new URL((String)registrationArgument); this.errorReporter = errorReporter; serializer = new KryoValuesSerializer(topoConf); topologyId = context.getStormId(); } catch (Exception e) { throw new RuntimeException(e); } }
public KryoTupleSerializer(final Map<String, Object> conf, final GeneralTopologyContext context) { _kryo = new KryoValuesSerializer(conf); _kryoOut = new Output(2000, 2000000000); _ids = new SerializationFactory.IdDictionary(context.getRawTopology()); }
private byte[] serialize(List<Object> vals, Map<String, Object> conf) throws IOException { KryoValuesSerializer serializer = new KryoValuesSerializer(mkConf(conf)); return serializer.serialize(vals); }
@Override protected void initChannel(Channel ch) throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = ch.pipeline(); // Decoder pipeline.addLast("decoder", new MessageDecoder(new KryoValuesDeserializer(topoConf))); // Encoders pipeline.addLast("netty-serializable-encoder", NettySerializableMessageEncoder.INSTANCE); pipeline.addLast("backpressure-encoder", new BackPressureStatusEncoder(new KryoValuesSerializer(topoConf))); boolean isNettyAuth = (Boolean) topoConf .get(Config.STORM_MESSAGING_NETTY_AUTHENTICATION); if (isNettyAuth) { // Authenticate: Removed after authentication completes pipeline.addLast("saslServerHandler", new SaslStormServerHandler( server)); // Authorize pipeline.addLast("authorizeServerHandler", new SaslStormServerAuthorizeHandler()); } // business logic. pipeline.addLast("handler", new StormServerHandler(server)); } }
Server(Map<String, Object> topoConf, int port) { this.topoConf = topoConf; this.port = port; ser = new KryoValuesSerializer(topoConf);
@Override public void prepare(Map stormConf, Object registrationArgument, TopologyContext context, IErrorReporter errorReporter) { try { _url = new URL((String)registrationArgument); _errorReporter = errorReporter; _serializer = new KryoValuesSerializer(stormConf); } catch (Exception e) { throw new RuntimeException(e); } }
public KryoTupleSerializer(final Map conf, final GeneralTopologyContext context) { _kryo = new KryoValuesSerializer(conf); _kryoOut = new Output(2000, 2000000000); _ids = new SerializationFactory.IdDictionary(context.getRawTopology()); }
_ser = new KryoValuesSerializer(conf); _des = new KryoValuesDeserializer(conf); } catch (Exception e) {
this.storm_conf = storm_conf; this.port = port; _ser = new KryoValuesSerializer(storm_conf);
@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 } }