org.apache.ignite.internal.processors.cache

## Class IgniteCacheOffheapManagerImpl.CacheDataStoreImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.IgniteCacheOffheapManagerImpl.CacheDataStoreImpl

All Implemented Interfaces:
  IgniteCacheOffheapManager.CacheDataStore

Enclosing class:
  IgniteCacheOffheapManagerImpl

    protected class IgniteCacheOffheapManagerImpl.CacheDataStoreImpl
    extends Object
    implements IgniteCacheOffheapManager.CacheDataStore

### Field Summary

Fields
`protected AtomicLong` `cntr` Update counter.
`protected Long` `initCntr` Initialized update counter.

### Constructor Summary

Constructors
Constructor and Description
`IgniteCacheOffheapManagerImpl.CacheDataStoreImpl(int partId, String name, IgniteCacheOffheapManagerImpl.CacheDataRowStore rowStore, IgniteCacheOffheapManagerImpl.CacheDataTree dataTree)`

### Method Summary

Methods
`int` `cacheSize(int cacheId)`
`Map<Integer,Long>` `cacheSizes()`
`void` `clear(int cacheId)` Clears all the records associated with logical cache with given ID.
`CacheDataRow` `createRow(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, CacheDataRow oldRow)`
`GridCursor<? extends CacheDataRow>` `cursor()`
`GridCursor<? extends CacheDataRow>` `cursor(int cacheId)`
`GridCursor<? extends CacheDataRow>` `cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper)`
`GridCursor<? extends CacheDataRow>` `cursor(int cacheId, KeyCacheObject lower, KeyCacheObject upper, Object x)`
`void` `destroy()` Destroys the tree associated with the store.
`CacheDataRow` `find(GridCacheContext cctx, KeyCacheObject key)`
`int` `fullSize()`
`void` `init(long size, long updCntr, Map<Integer,Long> cacheSizes)`
`Long` `initialUpdateCounter()`
`void` `invoke(GridCacheContext cctx, KeyCacheObject key, IgniteCacheOffheapManager.OffheapInvokeClosure c)`
`String` `name()`
`long` `nextUpdateCounter()`
`int` `partId()`
`void` `remove(GridCacheContext cctx, KeyCacheObject key, int partId)`
`RowStore` `rowStore()`
`void` `update(GridCacheContext cctx, KeyCacheObject key, CacheObject val, GridCacheVersion ver, long expireTime, CacheDataRow oldRow)`
`long` `updateCounter()`
`void` `updateCounter(long val)`
`void` `updateIndexes(GridCacheContext cctx, KeyCacheObject key)`
`void` `updateInitialCounter(long cntr)`

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

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

### Field Detail

#### cntr

    protected final AtomicLong cntr

Update counter.

#### initCntr

    protected Long initCntr

Initialized update counter.

### Constructor Detail

#### IgniteCacheOffheapManagerImpl.CacheDataStoreImpl

    public IgniteCacheOffheapManagerImpl.CacheDataStoreImpl(int partId,
                                                    String name,
                                                    IgniteCacheOffheapManagerImpl.CacheDataRowStore rowStore,
                                                    IgniteCacheOffheapManagerImpl.CacheDataTree dataTree)

Parameters:
  `partId` - Partition number.
  `name` - Name.
  `rowStore` - Row store.
  `dataTree` - Data tree.

### Method Detail

#### partId

    public int partId()

Specified by:
  `partId` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Partition ID.

#### cacheSize

    public int cacheSize(int cacheId)

Specified by:
  `cacheSize` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cacheId` - Cache ID.
Returns:
  Size.

#### cacheSizes

    public Map<Integer,Long> cacheSizes()

Specified by:
  `cacheSizes` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Cache sizes if store belongs to group containing multiple caches.

#### fullSize

    public int fullSize()

Specified by:
  `fullSize` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Total size.

#### updateCounter

    public long updateCounter()

Specified by:
  `updateCounter` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Update counter.

#### updateCounter

    public void updateCounter(long val)

Specified by:
  `updateCounter` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `val` - Update index value.

#### name

    public String name()

Specified by:
  `name` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Store name.

#### invoke

    public void invoke(GridCacheContext cctx,
              KeyCacheObject key,
              IgniteCacheOffheapManager.OffheapInvokeClosure c)
                throws IgniteCheckedException

Specified by:
  `invoke` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `c` - Closure.
Throws:
  `IgniteCheckedException` - If failed.

#### createRow

    public CacheDataRow createRow(GridCacheContext cctx,
                         KeyCacheObject key,
                         CacheObject val,
                         GridCacheVersion ver,
                         long expireTime,
                         @Nullable
                         CacheDataRow oldRow)
                           throws IgniteCheckedException

Specified by:
  `createRow` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `val` - Value.
  `ver` - Version.
  `expireTime` - Expire time.
  `oldRow` - Old row.
Returns:
  New row.
Throws:
  `IgniteCheckedException` - If failed.

#### update

    public void update(GridCacheContext cctx,
              KeyCacheObject key,
              CacheObject val,
              GridCacheVersion ver,
              long expireTime,
              @Nullable
              CacheDataRow oldRow)
                throws IgniteCheckedException

Specified by:
  `update` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `val` - Value.
  `ver` - Version.
  `expireTime` - Expire time.
  `oldRow` - Old row if available.
Throws:
  `IgniteCheckedException` - If failed.

#### updateIndexes

    public void updateIndexes(GridCacheContext cctx,
                     KeyCacheObject key)
                       throws IgniteCheckedException

Specified by:
  `updateIndexes` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
Throws:
  `IgniteCheckedException` - If failed.

#### remove

    public void remove(GridCacheContext cctx,
              KeyCacheObject key,
              int partId)
                throws IgniteCheckedException

Specified by:
  `remove` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
  `partId` - Partition number.
Throws:
  `IgniteCheckedException` - If failed.

#### find

    public CacheDataRow find(GridCacheContext cctx,
                    KeyCacheObject key)
                      throws IgniteCheckedException

Specified by:
  `find` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cctx` - Cache context.
  `key` - Key.
Returns:
  Data row.
Throws:
  `IgniteCheckedException` - If failed.

#### cursor

    public GridCursor<? extends CacheDataRow> cursor()
                                              throws IgniteCheckedException

Specified by:
  `cursor` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Data cursor.
Throws:
  `IgniteCheckedException` - If failed.

#### cursor

    public GridCursor<? extends CacheDataRow> cursor(int cacheId)
                                              throws IgniteCheckedException

Specified by:
  `cursor` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cacheId` -
Returns:
  Data cursor.
Throws:
  `IgniteCheckedException` - If failed.

#### cursor

    public GridCursor<? extends CacheDataRow> cursor(int cacheId,
                                            KeyCacheObject lower,
                                            KeyCacheObject upper)
                                              throws IgniteCheckedException

Specified by:
  `cursor` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cacheId` - Cache ID.
  `lower` - Lower bound.
  `upper` - Upper bound.
Returns:
  Data cursor.
Throws:
  `IgniteCheckedException` - If failed.

#### cursor

    public GridCursor<? extends CacheDataRow> cursor(int cacheId,
                                            KeyCacheObject lower,
                                            KeyCacheObject upper,
                                            Object x)
                                              throws IgniteCheckedException

Specified by:
  `cursor` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cacheId` - Cache ID.
  `lower` - Lower bound.
  `upper` - Upper bound.
  `x` - Implementation specific argument, `null` always means that we need to return full detached data row.
Returns:
  Data cursor.
Throws:
  `IgniteCheckedException` - If failed.

#### destroy

    public void destroy()
                 throws IgniteCheckedException

Destroys the tree associated with the store.

Specified by:
  `destroy` in interface `IgniteCacheOffheapManager.CacheDataStore`
Throws:
  `IgniteCheckedException` - If failed.

#### clear

    public void clear(int cacheId)
               throws IgniteCheckedException

Clears all the records associated with logical cache with given ID.

Specified by:
  `clear` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cacheId` - Cache ID.
Throws:
  `IgniteCheckedException` - If failed.

#### rowStore

    public RowStore rowStore()

Specified by:
  `rowStore` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Row store.

#### nextUpdateCounter

    public long nextUpdateCounter()

Specified by:
  `nextUpdateCounter` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Next update index.

#### initialUpdateCounter

    public Long initialUpdateCounter()

Specified by:
  `initialUpdateCounter` in interface `IgniteCacheOffheapManager.CacheDataStore`
Returns:
  Initial update counter.

#### updateInitialCounter

    public void updateInitialCounter(long cntr)

Specified by:
  `updateInitialCounter` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `cntr` - Counter.

#### init

    public void init(long size,
            long updCntr,
            @Nullable
            Map<Integer,Long> cacheSizes)

Specified by:
  `init` in interface `IgniteCacheOffheapManager.CacheDataStore`
Parameters:
  `size` - Size to init.
  `updCntr` - Update counter to init.
  `cacheSizes` - Cache sizes if store belongs to group containing multiple caches.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.1.0
Release Date | : July 20 2017