Package one.nio.mem

Class SharedMemoryMap<K,​V>

    • Constructor Detail

      • SharedMemoryMap

        protected SharedMemoryMap​(int capacity,
                                  java.lang.String fileName,
                                  long fileSize)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • SharedMemoryMap

        protected SharedMemoryMap​(int capacity,
                                  java.lang.String fileName,
                                  long fileSize,
                                  long expirationTime)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • init

        private void init​(long expirationTime)
      • needCleanup

        protected boolean needCleanup​(long expirationTime)
      • relocate

        protected void relocate​(long delta)
      • getHeader

        protected long getHeader​(long offset)
      • setHeader

        protected void setHeader​(long offset,
                                 long value)
      • getCustomData

        protected byte[] getCustomData()
      • setCustomData

        protected void setCustomData​(byte[] data)
      • allocateEntry

        protected long allocateEntry​(K key,
                                     long hashCode,
                                     int size)
        Specified by:
        allocateEntry in class OffheapMap<K,​V>
      • sizeOf

        protected int sizeOf​(long entry)
        Specified by:
        sizeOf in class OffheapMap<K,​V>
      • setValueAt

        protected void setValueAt​(long entry,
                                  V value)
        Specified by:
        setValueAt in class OffheapMap<K,​V>
      • sizeOf

        protected int sizeOf​(V value)
        Specified by:
        sizeOf in class OffheapMap<K,​V>
      • headerSize

        protected int headerSize​(long entry)
      • createAllocator

        protected void createAllocator​(long startAddress,
                                       long totalMemory)
      • setSerializer

        public void setSerializer​(java.lang.Class<V> valueType)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • setSerializer

        public void setSerializer​(Serializer<V> serializer)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • loadSchema

        protected void loadSchema()
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • storeSchema

        protected void storeSchema()