Class CachedData


  • public final class CachedData
    extends java.lang.Object
    Cached data with its attributes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int capacity  
      protected long cas  
      protected byte[] data  
      java.lang.Object decodedObject  
      protected int flag  
      static int MAX_SIZE
      Maximum data size allowed by memcached.
      long p1  
      long p2  
      long p3  
      long p4  
      int p5  
      protected int size  
    • Constructor Summary

      Constructors 
      Constructor Description
      CachedData()  
      CachedData​(int f, byte[] d)
      Get a CachedData instance for the given flags and byte array.
      CachedData​(int f, byte[] d, int capacity, long casId)
      Get a CachedData instance for the given flags and byte array.
    • Field Detail

      • MAX_SIZE

        public static final int MAX_SIZE
        Maximum data size allowed by memcached.
      • flag

        protected int flag
      • cas

        protected long cas
      • capacity

        private int capacity
      • size

        protected int size
      • decodedObject

        public volatile java.lang.Object decodedObject
      • p1

        public long p1
      • p2

        public long p2
      • p3

        public long p3
      • p4

        public long p4
      • p5

        public int p5
      • data

        protected byte[] data
    • Constructor Detail

      • CachedData

        public CachedData()
      • CachedData

        public CachedData​(int f,
                          byte[] d,
                          int capacity,
                          long casId)
        Get a CachedData instance for the given flags and byte array.
        Parameters:
        f - the flags
        d - the data
        capacity - the maximum allowable size.
      • CachedData

        public CachedData​(int f,
                          byte[] d)
        Get a CachedData instance for the given flags and byte array.
        Parameters:
        f - the flags
        d - the data
    • Method Detail

      • getSize

        public final int getSize()
      • fillData

        public final void fillData​(java.nio.ByteBuffer buffer,
                                   int offset,
                                   int length)
      • fillData

        public final void fillData​(java.nio.ByteBuffer buffer,
                                   int length)
      • getCapacity

        public final int getCapacity()
      • setSize

        public final void setSize​(int size)
      • setCapacity

        public final void setCapacity​(int dataLen)
      • getMAX_SIZE

        public static final int getMAX_SIZE()
      • setFlag

        public final void setFlag​(int flags)
      • setData

        public final void setData​(byte[] data)
      • setCas

        public final void setCas​(long cas)
      • getCas

        public long getCas()
      • getData

        public final byte[] getData()
        Get the stored data.
      • getFlag

        public final int getFlag()
        Get the flags stored along with this value.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • remainingCapacity

        public int remainingCapacity()