org.apache.ignite.internal.processors.cache

## Class GridCacheOffheapSwapEntry

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheOffheapSwapEntry

All Implemented Interfaces:
  GridCacheSwapEntry

    public class GridCacheOffheapSwapEntry
    extends Object
    implements GridCacheSwapEntry

GridCacheSwapEntry over offheap pointer.

Offheap pointer points to marshalled `GridCacheSwapEntryImpl` instance, marshalled data:

- TTL
- Expire time
- GridCacheVersion or GridCacheVersionEx
- Value is byte array flag
- Value byte array (marshalled with binary or grid marshaller)
- Value classloader UUID
- Key classloader UUID

### Constructor Summary

Constructors
Constructor and Description
`GridCacheOffheapSwapEntry(long ptr, int size)`

### Method Summary

Methods
`long` `expireTime()`
`static long` `expireTime(long ptr)`
`IgniteUuid` `keyClassLoaderId()`
`long` `offheapPointer()`
`static long` `timeToLive(long ptr)`
`String` `toString()`
`long` `ttl()`
`byte` `type()`
`CacheObject` `value()`
`void` `value(CacheObject val)`
`static long` `valueAddress(long ptr, int size)`
`byte[]` `valueBytes()`
`void` `valueBytes(byte[] valBytes)`
`IgniteUuid` `valueClassLoaderId()`
`GridCacheVersion` `version()`
`static GridCacheVersion` `version(long ptr)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridCacheOffheapSwapEntry

    public GridCacheOffheapSwapEntry(long ptr,
                             int size)

Parameters:
  `ptr` - Value pointer.
  `size` - Value size.

### Method Detail

#### valueAddress

    public static long valueAddress(long ptr,
                    int size)

Parameters:
  `ptr` - Marshaled swap entry address.
  `size` - Marshalled data size.
Returns:
  Value data address.

#### timeToLive

    public static long timeToLive(long ptr)

Parameters:
  `ptr` - Marshaled swap entry address.
Returns:
  TTL.

#### expireTime

    public static long expireTime(long ptr)

Parameters:
  `ptr` - Marshaled swap entry address.
Returns:
  Expire time.

#### version

    public static GridCacheVersion version(long ptr)

Parameters:
  `ptr` - Marshaled swap entry address.
Returns:
  Version.

#### valueBytes

    public byte[] valueBytes()

Specified by:
  `valueBytes` in interface `GridCacheSwapEntry`
Returns:
  Value bytes.

#### valueBytes

    public void valueBytes(byte[] valBytes)

Specified by:
  `valueBytes` in interface `GridCacheSwapEntry`
Parameters:
  `valBytes` - Value bytes.

#### value

    public CacheObject value()

Specified by:
  `value` in interface `GridCacheSwapEntry`
Returns:
  Value.

#### value

    public void value(CacheObject val)

Specified by:
  `value` in interface `GridCacheSwapEntry`
Parameters:
  `val` - Value.

#### type

    public byte type()

Specified by:
  `type` in interface `GridCacheSwapEntry`
Returns:
  Object type.

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `GridCacheSwapEntry`
Returns:
  Version.

#### ttl

    public long ttl()

Specified by:
  `ttl` in interface `GridCacheSwapEntry`
Returns:
  Time to live.

#### expireTime

    public long expireTime()

Specified by:
  `expireTime` in interface `GridCacheSwapEntry`
Returns:
  Expire time.

#### keyClassLoaderId

    @Nullable
    public IgniteUuid keyClassLoaderId()

Specified by:
  `keyClassLoaderId` in interface `GridCacheSwapEntry`
Returns:
  Class loader ID for entry key (`null` for local class loader).

#### offheapPointer

    public long offheapPointer()

Specified by:
  `offheapPointer` in interface `GridCacheSwapEntry`
Returns:
  If entry is offheap based returns offheap address, otherwise 0.

#### valueClassLoaderId

    @Nullable
    public IgniteUuid valueClassLoaderId()

Specified by:
  `valueClassLoaderId` in interface `GridCacheSwapEntry`
Returns:
  Class loader ID for entry value (`null` for local class loader).

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.7.0
Release Date | : August 1 2016