org.apache.ignite.internal.visor.cache

## Class VisorCache

- java.lang.Object
- - org.apache.ignite.internal.visor.cache.VisorCache

All Implemented Interfaces:
  Serializable

    public class VisorCache
    extends Object
    implements Serializable

Data transfer object for `IgniteCache`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`VisorCache()`

### Method Summary

Methods
`Collection<IgnitePair<Integer>>` `backupPartitions()`
`int` `dhtSize()`
`IgniteUuid` `dynamicDeploymentId()`
`protected void` `estimateMemorySize(IgniteEx ignite, GridCacheAdapter ca, int sample)` Estimate memory size used by cache.
`VisorCache` `from(IgniteEx ignite, String cacheName, int sample)`
`VisorCache` `history()`
`long` `indexesSize()`
`long` `memorySize()`
`VisorCacheMetrics` `metrics()`
`CacheMode` `mode()`
`String` `name()`
`int` `nearSize()`
`long` `offHeapAllocatedSize()`
`long` `offHeapEntriesCount()`
`GridDhtPartitionMap` `partitionMap()`
`int` `partitions()`
`Collection<IgnitePair<Integer>>` `primaryPartitions()`
`int` `primarySize()`
`int` `size()`
`long` `swapKeys()`
`long` `swapSize()`
`String` `toString()`

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

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

### Constructor Detail

#### VisorCache

    public VisorCache()

### Method Detail

#### from

    public VisorCache from(IgniteEx ignite,
                  String cacheName,
                  int sample)
                    throws IgniteCheckedException

Parameters:
  `ignite` - Grid.
  `cacheName` - Cache name.
  `sample` - Sample size.
Returns:
  Data transfer object for given cache.
Throws:
  `IgniteCheckedException` - If failed to create data transfer object.

#### estimateMemorySize

    protected void estimateMemorySize(IgniteEx ignite,
                          GridCacheAdapter ca,
                          int sample)
                               throws IgniteCheckedException

Estimate memory size used by cache.

Parameters:
  `ignite` - Ignite.
  `ca` - Cache adapter.
  `sample` - Sample size.
Throws:
  `IgniteCheckedException` - If estimation failed.

#### history

    public VisorCache history()

Returns:
  New instance suitable to store in history.

#### name

    public String name()

Returns:
  Cache name.

#### dynamicDeploymentId

    public IgniteUuid dynamicDeploymentId()

Returns:
  Dynamic deployment ID.

#### mode

    public CacheMode mode()

Returns:
  Cache mode.

#### memorySize

    public long memorySize()

Returns:
  Cache size in bytes.

#### indexesSize

    public long indexesSize()

Returns:
  Indexes size in bytes.

#### size

    public int size()

Returns:
  Number of all entries in cache.

#### nearSize

    public int nearSize()

Returns:
  Number of all entries in near cache.

#### dhtSize

    public int dhtSize()

Returns:
  Number of all entries in DHT cache.

#### primarySize

    public int primarySize()

Returns:
  Number of primary entries in cache.

#### offHeapAllocatedSize

    public long offHeapAllocatedSize()

Returns:
  Memory size allocated in off-heap.

#### offHeapEntriesCount

    public long offHeapEntriesCount()

Returns:
  Number of cache entries stored in off-heap memory.

#### swapSize

    public long swapSize()

Returns:
  Size in bytes for swap space.

#### swapKeys

    public long swapKeys()

Returns:
  Number of cache entries stored in swap space.

#### partitions

    public int partitions()

Returns:
  Number of partitions.

#### primaryPartitions

    public Collection<IgnitePair<Integer>> primaryPartitions()

Returns:
  Primary partitions IDs with sizes.

#### backupPartitions

    public Collection<IgnitePair<Integer>> backupPartitions()

Returns:
  Backup partitions IDs with sizes.

#### metrics

    public VisorCacheMetrics metrics()

Returns:
  Cache metrics.

#### partitionMap

    @Nullable
    public GridDhtPartitionMap partitionMap()

Returns:
  Cache partitions states.

#### 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