org.apache.ignite.internal.processors.cache.persistence

## Class CacheDataRowAdapter

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.persistence.CacheDataRowAdapter

All Implemented Interfaces:
  CacheDataRow, CacheSearchRow, Storable

Direct Known Subclasses:
  DataRow

    public class CacheDataRowAdapter
    extends Object
    implements CacheDataRow

Cache data row adapter.

### Nested Class Summary

Nested Classes
`static class` `CacheDataRowAdapter.RowData`

### Field Summary

Fields
`protected int` `cacheId`
`protected long` `expireTime`
`protected KeyCacheObject` `key`
`protected long` `link`
`protected CacheObject` `val`
`protected GridCacheVersion` `ver`

### Constructor Summary

Constructors
Constructor and Description
`CacheDataRowAdapter(KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime)`
`CacheDataRowAdapter(long link)`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `cacheId()`
`long` `expireTime()`
`int` `hash()`
`void` `initFromLink(CacheGroupContext grp, CacheDataRowAdapter.RowData rowData)` Read row from data pages.
`void` `initFromLink(CacheGroupContext grp, GridCacheSharedContext<?,?> sharedCtx, PageMemory pageMem, CacheDataRowAdapter.RowData rowData)` Read row from data pages.
`boolean` `isReady()`
`KeyCacheObject` `key()`
`void` `key(KeyCacheObject key)`
`long` `link()`
`void` `link(long link)`
`int` `partition()`
`String` `toString()`
`CacheObject` `value()`
`GridCacheVersion` `version()`

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

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

### Field Detail

#### link

    @GridToStringExclude
    protected long link

#### key

    @GridToStringInclude
    protected KeyCacheObject key

#### val

    @GridToStringInclude
    protected CacheObject val

#### expireTime

    protected long expireTime

#### ver

    @GridToStringInclude
    protected GridCacheVersion ver

#### cacheId

    @GridToStringInclude
    protected int cacheId

### Constructor Detail

#### CacheDataRowAdapter

    public CacheDataRowAdapter(long link)

Parameters:
  `link` - Link.

#### CacheDataRowAdapter

    public CacheDataRowAdapter(KeyCacheObject key,
                               CacheObject val,
                               GridCacheVersion ver,
                               long expireTime)

Parameters:
  `key` - Key.
  `val` - Value.
  `expireTime` - Expire time.
  `ver` - Version.

### Method Detail

#### initFromLink

    public final void initFromLink(CacheGroupContext grp,
                                   CacheDataRowAdapter.RowData rowData)
                            throws IgniteCheckedException

Read row from data pages.

Parameters:
  `grp` - Cache group.
  `rowData` - Required row data.
Throws:
  `IgniteCheckedException` - If failed.

#### initFromLink

    public final void initFromLink(@Nullable
                                   CacheGroupContext grp,
                                   GridCacheSharedContext<?,?> sharedCtx,
                                   PageMemory pageMem,
                                   CacheDataRowAdapter.RowData rowData)
                            throws IgniteCheckedException

Read row from data pages. Can be called with cctx == null, if cache instance is unknown, but its ID is stored in the data row.

Parameters:
  `grp` - Cache group.
  `sharedCtx` - Shared context.
  `pageMem` - Page memory.
  `rowData` - Row data.
Throws:
  `IgniteCheckedException` - If failed.

#### isReady

    public boolean isReady()

Returns:
  `True` if entry is ready.

#### key

    public KeyCacheObject key()

Specified by:
  `key` in interface `CacheSearchRow`
Returns:
  Cache key.

#### key

    public void key(KeyCacheObject key)

Specified by:
  `key` in interface `CacheDataRow`
Parameters:
  `key` - Key.

#### cacheId

    public int cacheId()

Specified by:
  `cacheId` in interface `CacheSearchRow`
Returns:
  Cache ID or `0` if cache ID is not defined.

#### value

    public CacheObject value()

Specified by:
  `value` in interface `CacheDataRow`
Returns:
  Cache value.

#### version

    public GridCacheVersion version()

Specified by:
  `version` in interface `CacheDataRow`
Returns:
  Cache entry version.

#### expireTime

    public long expireTime()

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

#### partition

    public int partition()

Specified by:
  `partition` in interface `CacheDataRow`
Specified by:
  `partition` in interface `Storable`
Returns:
  Partition for this key.

#### link

    public long link()

Specified by:
  `link` in interface `CacheSearchRow`
Specified by:
  `link` in interface `Storable`
Returns:
  Link for this row.

#### link

    public void link(long link)

Specified by:
  `link` in interface `CacheDataRow`
Specified by:
  `link` in interface `Storable`
Parameters:
  `link` - Link for this row.

#### hash

    public int hash()

Specified by:
  `hash` in interface `CacheSearchRow`
Returns:
  Key hash code.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018