org.apache.ignite.internal.processors.cache

## Class GridCacheClearAllRunnable<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.GridCacheClearAllRunnable<K,V>

All Implemented Interfaces:
  Runnable

Direct Known Subclasses:
  GridNearCacheClearAllRunnable

    public class GridCacheClearAllRunnable<K,V>
    extends Object
    implements Runnable

Base runnable for `GridCacheAdapter.clearLocally()` routine.

### Field Summary

Fields
`protected GridCacheAdapter<K,V>` `cache` Cache to be cleared.
`protected GridCacheContext<K,V>` `ctx` Cache context.
`protected int` `id` Mod for the given runnable.
`protected IgniteLogger` `log` Logger.
`protected GridCacheVersion` `obsoleteVer` Obsolete version.
`protected int` `totalCnt` Mods count across all spawned clearLocally runnables.

### Constructor Summary

Constructors
Constructor and Description
`GridCacheClearAllRunnable(GridCacheAdapter<K,V> cache, GridCacheVersion obsoleteVer, int id, int totalCnt)` Constructor.

### Method Summary

Methods
`protected void` `clearEntry(GridCacheEntryEx e)` Clear entry from cache.
`int` `id()`
`protected boolean` `owns(KeyCacheObject key)` Check whether this worker owns particular key.
`void` `run()`
`String` `toString()`
`int` `totalCount()`

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

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

### Field Detail

#### cache

    protected final GridCacheAdapter<K,V> cache

Cache to be cleared.

#### obsoleteVer

    protected final GridCacheVersion obsoleteVer

Obsolete version.

#### id

    protected final int id

Mod for the given runnable.

#### totalCnt

    protected final int totalCnt

Mods count across all spawned clearLocally runnables.

#### ctx

    protected final GridCacheContext<K,V> ctx

Cache context.

#### log

    protected final IgniteLogger log

Logger.

### Constructor Detail

#### GridCacheClearAllRunnable

    public GridCacheClearAllRunnable(GridCacheAdapter<K,V> cache,
                             GridCacheVersion obsoleteVer,
                             int id,
                             int totalCnt)

Constructor.

Parameters:
  `cache` - Cache to be cleared.
  `obsoleteVer` - Obsolete version.
  `id` - Mod for the given runnable.
  `totalCnt` - Mods count across all spawned clearLocally runnables.

### Method Detail

#### run

    public void run()

Specified by:
  `run` in interface `Runnable`

#### clearEntry

    protected void clearEntry(GridCacheEntryEx e)

Clear entry from cache.

Parameters:
  `e` - Entry.

#### owns

    protected boolean owns(KeyCacheObject key)

Check whether this worker owns particular key.

Parameters:
  `key` - Key.
Returns:
  `True` in case this worker should process this key.

#### id

    public int id()

Returns:
  ID for the given runnable.

#### totalCount

    public int totalCount()

Returns:
  Total count across all spawned clearLocally runnables.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015