Class KryoPool


public abstract class KryoPool extends ResourcePool<SerDeState>
Simple ResourcePool to save on Kryo instances, which are expensive to allocate
  • Constructor Details

    • KryoPool

      protected KryoPool(int poolSize)
  • Method Details

    • release

      public void release(SerDeState st)
      Overrides:
      release in class ResourcePool<SerDeState>
    • withBuffer

      public static KryoPool withBuffer(int poolSize, KryoInstantiator ki, int outBufferMin, int outBufferMax)
      Output is created with new Output(outBufferMin, outBufferMax);
    • withByteArrayOutputStream

      public static KryoPool withByteArrayOutputStream(int poolSize, KryoInstantiator ki)
      Output is created with new Output(new ByteArrayOutputStream()) This will automatically resize internally
    • deepCopy

      public <T> T deepCopy(T obj)
    • fromBytes

      public Object fromBytes(byte[] ary)
    • fromBytes

      public <T> T fromBytes(byte[] ary, Class<T> cls)
    • toBytesWithClass

      public byte[] toBytesWithClass(Object obj)
    • toBytesWithoutClass

      public byte[] toBytesWithoutClass(Object obj)
    • hasRegistration

      public boolean hasRegistration(Class obj)