org.apache.ignite.internal.visor.cache

## Class VisorCache

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

All Implemented Interfaces:
  Externalizable, Serializable

    public class VisorCache
    extends VisorDataTransferObject

Data transfer object for `IgniteCache`.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.ignite.internal.visor.VisorDataTransferObject

`V1, V2, V3, V4`

### Constructor Summary

Constructors
Constructor and Description
`VisorCache()` Create data transfer object for given cache.
`VisorCache(IgniteEx ignite, GridCacheAdapter ca, boolean collectMetrics)` Create data transfer object for given cache.

### Method Summary

All Methods Instance Methods Concrete Methods
`long` `getBackupSize()`
`IgniteUuid` `getDynamicDeploymentId()`
`long` `getIndexesSize()`
`long` `getMemorySize()`
`VisorCacheMetrics` `getMetrics()`
`CacheMode` `getMode()`
`String` `getName()`
`int` `getNearSize()`
`int` `getPartitions()`
`long` `getPrimarySize()`
`byte` `getProtocolVersion()`
`long` `getSize()`
`long` `heapEntriesCount()`
`boolean` `isNear()`
`boolean` `isStatisticsEnabled()`
`boolean` `isSystem()`
`long` `offHeapAllocatedSize()`
`long` `offHeapBackupEntriesCount()`
`long` `offHeapEntriesCount()`
`long` `offHeapPrimaryEntriesCount()`
`protected void` `readExternalData(byte protoVer, ObjectInput in)` Load object's specific data content.
`void` `setMetrics(VisorCacheMetrics metrics)`
`void` `setName(String name)` Sets new value for cache name.
`long` `size()`
`String` `toString()`
`protected void` `writeExternalData(ObjectOutput out)` Save object's specific data content.

### Methods inherited from class org.apache.ignite.internal.visor.VisorDataTransferObject

`readExternal, toList, toSet, writeExternal`

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

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

### Constructor Detail

#### VisorCache

    public VisorCache()

Create data transfer object for given cache.

#### VisorCache

    public VisorCache(IgniteEx ignite,
                      GridCacheAdapter ca,
                      boolean collectMetrics)
               throws IgniteCheckedException

Create data transfer object for given cache.

Parameters:
  `ca` - Internal cache.
  `collectMetrics` - Collect cache metrics flag.
Throws:
  `IgniteCheckedException` - If failed to create data transfer object.

### Method Detail

#### getName

    public String getName()

Returns:
  Cache name.

#### setName

    public void setName(String name)

Sets new value for cache name.

Parameters:
  `name` - New cache name.

#### getDynamicDeploymentId

    public IgniteUuid getDynamicDeploymentId()

Returns:
  Dynamic deployment ID.

#### getMode

    public CacheMode getMode()

Returns:
  Cache mode.

#### getMemorySize

    public long getMemorySize()

Returns:
  Cache size in bytes.

#### getIndexesSize

    public long getIndexesSize()

Returns:
  Indexes size in bytes.

#### getSize

    public long getSize()

Returns:
  Number of all entries in cache.

#### getNearSize

    public int getNearSize()

Returns:
  Number of all entries in near cache.

#### getBackupSize

    public long getBackupSize()

Returns:
  Number of backup entries in cache.

#### getPrimarySize

    public long getPrimarySize()

Returns:
  Number of primary entries in cache.

#### getPartitions

    public int getPartitions()

Returns:
  Number of partitions.

#### getMetrics

    public VisorCacheMetrics getMetrics()

Returns:
  Cache metrics.

#### setMetrics

    public void setMetrics(VisorCacheMetrics metrics)

Parameters:
  `metrics` - Cache metrics.

#### isNear

    public boolean isNear()

Returns:
  `true` if cache has near cache.

#### isSystem

    public boolean isSystem()

Returns:
  System cache flag.

#### size

    public long size()

Returns:
  Number of entries in cache in heap and off-heap.

#### offHeapAllocatedSize

    public long offHeapAllocatedSize()

Returns:
  Memory size allocated in off-heap.

#### heapEntriesCount

    public long heapEntriesCount()

Returns:
  Number of entries in heap memory.

#### offHeapPrimaryEntriesCount

    public long offHeapPrimaryEntriesCount()

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

#### offHeapBackupEntriesCount

    public long offHeapBackupEntriesCount()

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

#### offHeapEntriesCount

    public long offHeapEntriesCount()

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

#### isStatisticsEnabled

    public boolean isStatisticsEnabled()

Returns:
  Checks whether statistics collection is enabled in this cache.

#### getProtocolVersion

    public byte getProtocolVersion()

Overrides:
  `getProtocolVersion` in class `VisorDataTransferObject`
Returns:
  Transfer object version.

#### writeExternalData

    protected void writeExternalData(ObjectOutput out)
                              throws IOException

Save object's specific data content.

Specified by:
  `writeExternalData` in class `VisorDataTransferObject`
Parameters:
  `out` - Output object to write data content.
Throws:
  `IOException` - If I/O errors occur.

#### readExternalData

    protected void readExternalData(byte protoVer,
                                    ObjectInput in)
                             throws IOException,
                                    ClassNotFoundException

Load object's specific data content.

Specified by:
  `readExternalData` in class `VisorDataTransferObject`
Parameters:
  `protoVer` - Input object version.
  `in` - Input object to load data content.
Throws:
  `IOException` - If I/O errors occur.
  `ClassNotFoundException` - If the class for an object being restored cannot be found.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021