Interface GridOffHeapPartitionedMap

    • Method Detail

      • loadFactor

        float loadFactor()
        Gets load factor of this map.
        Returns:
        Load factor.
      • concurrency

        int concurrency()
        Gets concurrency level for this map.
        Returns:
        Concurrency level.
      • partitions

        int partitions()
        Gets number of partitions.
        Returns:
        Number of partitions.
      • contains

        boolean contains​(int p,
                         int hash,
                         byte[] keyBytes)
        Checks if given key is contained in the map.
        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        Returns:
        True if key is contained in the map.
      • get

        @Nullable
        @org.jetbrains.annotations.Nullable byte[] get​(int p,
                                                       int hash,
                                                       byte[] keyBytes)
        Gets value bytes for given key.
        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        Returns:
        Value bytes.
      • enableEviction

        void enableEviction​(int p,
                            int hash,
                            byte[] keyBytes)
        Enables eviction for entry.
        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
      • remove

        @Nullable
        @org.jetbrains.annotations.Nullable byte[] remove​(int p,
                                                          int hash,
                                                          byte[] keyBytes)
        Removes value from off-heap map.
        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        Returns:
        Removed value bytes.
      • removex

        boolean removex​(int p,
                        int hash,
                        byte[] keyBytes)
        Removes value from off-heap map without returning it.
        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        Returns:
        True if value was removed.
      • removex

        boolean removex​(int part,
                        int hash,
                        byte[] keyBytes,
                        IgniteBiPredicate<Long,​Integer> p)
        Removes value from off-heap map without returning it.
        Parameters:
        part - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        p - Value predicate (arguments are value address and value length).
        Returns:
        True if value was removed.
      • put

        boolean put​(int p,
                    int hash,
                    byte[] keyBytes,
                    byte[] valBytes)
        Puts key and value bytes into the map potentially replacing existing entry.
        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        valBytes - Value bytes.
        Returns:
        True if new entry was created, false if existing value was updated.
      • insert

        void insert​(int p,
                    int hash,
                    byte[] keyBytes,
                    byte[] valBytes)
        Inserts new entry into the map without comparing if there is a mapping for given key already stored in map.

        Use with caution whenever certain that inserting a new value without current mapping.

        Parameters:
        p - Partition.
        hash - Hash.
        keyBytes - Key bytes.
        valBytes - Value bytes.
      • size

        long size()
        Gets number of elements in the map.
        Returns:
        Number of elements in the map.
      • size

        long size​(Set<Integer> parts)
        Gets number of elements in the map.
        Parameters:
        parts - Partitions.
        Returns:
        Number of elements in the map.
      • memorySize

        long memorySize()
        Gets total available memory size.
        Returns:
        Memory size.
      • allocatedSize

        long allocatedSize()
        Gets size of a memory allocated for map entries so far.
        Returns:
        Allocated memory size.
      • systemAllocatedSize

        long systemAllocatedSize()
        Gets memory allocated for map internal structure so far.
        Returns:
        Allocated memory.
      • freeSize

        long freeSize()
        Gets available memory.
        Returns:
        Available memory.
      • destruct

        void destruct()
        Destructs this map and deallocates all memory.
      • iterator

        GridCloseableIterator<IgniteBiTuple<byte[],​byte[]>> iterator​(int p)
        Gets iterator over certain partition.
        Parameters:
        p - Partition.
        Returns:
        Iterator over certain partition.
      • evictListener

        boolean evictListener​(GridOffHeapEvictListener lsnr)
        Sets callback for when entries are evicted due to memory constraints. The parameter into closure is key bytes.
        Parameters:
        lsnr - Evict listener.
        Returns:
        True if evict listener was added, false if another listener already exists or LRU is disabled.
      • eventListener

        boolean eventListener​(GridOffHeapEventListener lsnr)
        Adds off-heap event listener.
        Parameters:
        lsnr - Listener.
        Returns:
        True if event listener was added, false if another listener already exists.