public KryoObjectInput(InputStream inputStream) { input = new Input(inputStream); this.kryo = KryoUtils.get(); }
public KryoObjectInput(InputStream inputStream) { input = new Input(inputStream); this.kryo = KryoUtils.get(); }
@Override public T deserialize(byte[] b) { Input input = new Input(b); return (T) kryo.get().readClassAndObject(input); }
public KryoValuesDeserializer(Map<String, Object> conf) { _kryo = SerializationFactory.getKryo(conf); _kryoInput = new Input(1); }
@Override public T deserialize(byte[] b) { Input input = new Input(b); return (T) kryo.readClassAndObject(input); } }
public T execute(Kryo kryo) { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes); Input input = new Input(byteArrayInputStream); return (T) kryo.readClassAndObject(input); } });
public KryoValuesDeserializer(Map conf) { _kryo = SerializationFactory.getKryo(conf); _kryoInput = new Input(1); }
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Input in = new Input(request.getInputStream()); List<Object> metrics = des.get().deserializeFrom(in); handle((TaskInfo)metrics.get(0), (Collection<DataPoint>)metrics.get(1), (String)metrics.get(2)); response.setStatus(HttpServletResponse.SC_OK); } }
@Override public Object readFrom(final Class<Object> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, String> httpHeaders, final InputStream entityStream) throws IOException, WebApplicationException { final Input input = new Input(entityStream); return kryoPool.run(new KryoCallback() { public Object execute(Kryo kryo) { return kryo.readObject(input, type); } }); }
private Object getKryoDeserializedObject (final byte[] ser) { final Kryo kryo = new Kryo(); final Input input = new Input(new ByteArrayInputStream(ser)); kryo.setInstantiatorStrategy(new StdInstantiatorStrategy()); return kryo.readClassAndObject(input); }
public static <T> T readFromByteArray(byte[] byteArray) { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray); Input input = new Input(byteArrayInputStream); Kryo kryo = getInstance(); return (T) kryo.readClassAndObject(input); }
public static <T> T readFromByteArray(byte[] byteArray) { ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray); Input input = new Input(byteArrayInputStream); Kryo kryo = getInstance(); return (T) kryo.readClassAndObject(input); }
/** * just get target taskId */ public static int deserializeTaskId(byte[] ser) { Input _kryoInput = new Input(1); _kryoInput.setBuffer(ser); return _kryoInput.readInt(); } }
public static <T> T deserialize(byte[] buffer, Class<T> clazz) { Kryo kryo = SerializationUtilities.borrowKryo(); kryo.setClassLoader(Thread.currentThread().getContextClassLoader()); T result = null; try { result = kryo.readObject(new Input(new ByteArrayInputStream(buffer)), clazz); } finally { SerializationUtilities.releaseKryo(kryo); } return result; }
public KryoSerializer() { kryo = new Kryo(); kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy())); output = new Output(200, 2000000000); input = new Input(1); }
public KryoTupleDeserializer(final Map conf, final GeneralTopologyContext context, final StormTopology topology) { _kryo = new KryoValuesDeserializer(conf); _context = context; _ids = new SerializationFactory.IdDictionary(topology); _kryoInput = new Input(1); _ackerNum = JStormUtils.parseInt(conf.get(Config.TOPOLOGY_ACKER_EXECUTORS), 0); _isTransactionTuple = JStormUtils.parseBoolean(conf.get(ConfigExtension.TRANSACTION_TOPOLOGY), false); }
public KryoTupleDeserializer(final Map<String, Object> conf, final GeneralTopologyContext context) { _kryo = new KryoValuesDeserializer(conf); _context = context; _ids = new SerializationFactory.IdDictionary(context.getRawTopology()); _kryoInput = new Input(1); }
private static <T extends Serializable> T deserializeObjectFromKryo(byte[] bytes, Class<T> clazz) { Input inp = new Input(new ByteArrayInputStream(bytes)); Kryo kryo = borrowKryo(); T func = null; try { func = kryo.readObject(inp, clazz); } finally { releaseKryo(kryo); } inp.close(); return func; }
@Override public Object decode(ByteBuf buf, State state) throws IOException { Kryo kryo = null; try { kryo = kryoPool.get(); return kryo.readClassAndObject(new Input(new ByteBufInputStream(buf))); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RedissonKryoCodecException(e); } finally { if (kryo != null) { kryoPool.yield(kryo); } } } };
@Override public Object decode(ByteBuf buf, State state) throws IOException { Kryo kryo = null; try { kryo = kryoPool.get(); return kryo.readClassAndObject(new Input(new ByteBufInputStream(buf))); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RedissonKryoCodecException(e); } finally { if (kryo != null) { kryoPool.yield(kryo); } } } };