org.apache.ignite.internal.processors.cache

## Class CacheGroupMetricsMXBeanImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.CacheGroupMetricsMXBeanImpl

All Implemented Interfaces:
  CacheGroupMetricsMXBean

    public class CacheGroupMetricsMXBeanImpl
    extends Object
    implements CacheGroupMetricsMXBean

Management bean that provides access to `CacheGroupContext`.

### Nested Class Summary

Nested Classes
`static class` `CacheGroupMetricsMXBeanImpl.GroupAllocationTrucker`

### Constructor Summary

Constructors
Constructor and Description
`CacheGroupMetricsMXBeanImpl(CacheGroupContext ctx)` Creates Group metrics MBean.

### Method Summary

All Methods Instance Methods Concrete Methods
`Map<Integer,List<String>>` `getAffinityPartitionsAssignmentMap()` Gets affinity partitions assignment map.
`int` `getBackups()` Gets count of backups configured for this cache group.
`List<String>` `getCaches()` Gets list of cache names of this cache group.
`int` `getClusterMovingPartitionsCount()` Gets count of partitions with state MOVING for this cache group in the entire cluster.
`int` `getClusterOwningPartitionsCount()` Gets count of partitions with state OWNING for this cache group in the entire cluster.
`int` `getGroupId()` Gets cache group id.
`String` `getGroupName()` Gets cache group name.
`int` `getLocalNodeMovingPartitionsCount()` Gets count of partitions with state MOVING for this cache group located on this node.
`int` `getLocalNodeOwningPartitionsCount()` Gets count of partitions with state OWNING for this cache group located on this node.
`int` `getMaximumNumberOfPartitionCopies()` Calculates maximum number of partitions copies for all partitions of this cache group.
`int` `getMinimumNumberOfPartitionCopies()` Calculates minimum number of partitions copies for all partitions of this cache group.
`Map<Integer,Set<String>>` `getMovingPartitionsAllocationMap()` Gets allocation map of partitions with state MOVING in the cluster.
`Map<Integer,Set<String>>` `getOwningPartitionsAllocationMap()` Gets allocation map of partitions with state OWNING in the cluster.
`List<Integer>` `getPartitionIds()` Local partition ids.
`int` `getPartitions()` Gets count of partitions for this cache group.
`long` `getTotalAllocatedPages()` Cache group total allocated pages.
`long` `getTotalAllocatedSize()` Total size of memory allocated for group, in bytes.
`String` `getType()` Cache group type.

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

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

### Constructor Detail

#### CacheGroupMetricsMXBeanImpl

    public CacheGroupMetricsMXBeanImpl(CacheGroupContext ctx)

Creates Group metrics MBean.

Parameters:
  `ctx` - Cache group context.

### Method Detail

#### getGroupId

    public int getGroupId()

Gets cache group id.

Specified by:
  `getGroupId` in interface `CacheGroupMetricsMXBean`
Returns:
  Cache group id.

#### getGroupName

    public String getGroupName()

Gets cache group name.

Specified by:
  `getGroupName` in interface `CacheGroupMetricsMXBean`
Returns:
  Cache group name.

#### getCaches

    public List<String> getCaches()

Gets list of cache names of this cache group.

Specified by:
  `getCaches` in interface `CacheGroupMetricsMXBean`
Returns:
  List of cache names.

#### getBackups

    public int getBackups()

Gets count of backups configured for this cache group.

Specified by:
  `getBackups` in interface `CacheGroupMetricsMXBean`
Returns:
  Count of backups.

#### getPartitions

    public int getPartitions()

Gets count of partitions for this cache group.

Specified by:
  `getPartitions` in interface `CacheGroupMetricsMXBean`
Returns:
  Count of partitions.

#### getMinimumNumberOfPartitionCopies

    public int getMinimumNumberOfPartitionCopies()

Calculates minimum number of partitions copies for all partitions of this cache group.

Specified by:
  `getMinimumNumberOfPartitionCopies` in interface `CacheGroupMetricsMXBean`
Returns:
  Minimum number of copies.

#### getMaximumNumberOfPartitionCopies

    public int getMaximumNumberOfPartitionCopies()

Calculates maximum number of partitions copies for all partitions of this cache group.

Specified by:
  `getMaximumNumberOfPartitionCopies` in interface `CacheGroupMetricsMXBean`
Returns:
  Maximum number of copies.

#### getLocalNodeOwningPartitionsCount

    public int getLocalNodeOwningPartitionsCount()

Gets count of partitions with state OWNING for this cache group located on this node.

Specified by:
  `getLocalNodeOwningPartitionsCount` in interface `CacheGroupMetricsMXBean`
Returns:
  Partitions count.

#### getLocalNodeMovingPartitionsCount

    public int getLocalNodeMovingPartitionsCount()

Gets count of partitions with state MOVING for this cache group located on this node.

Specified by:
  `getLocalNodeMovingPartitionsCount` in interface `CacheGroupMetricsMXBean`
Returns:
  Partitions count.

#### getClusterOwningPartitionsCount

    public int getClusterOwningPartitionsCount()

Gets count of partitions with state OWNING for this cache group in the entire cluster.

Specified by:
  `getClusterOwningPartitionsCount` in interface `CacheGroupMetricsMXBean`
Returns:
  Partitions count.

#### getClusterMovingPartitionsCount

    public int getClusterMovingPartitionsCount()

Gets count of partitions with state MOVING for this cache group in the entire cluster.

Specified by:
  `getClusterMovingPartitionsCount` in interface `CacheGroupMetricsMXBean`
Returns:
  Partitions count.

#### getOwningPartitionsAllocationMap

    public Map<Integer,Set<String>> getOwningPartitionsAllocationMap()

Gets allocation map of partitions with state OWNING in the cluster.

Specified by:
  `getOwningPartitionsAllocationMap` in interface `CacheGroupMetricsMXBean`
Returns:
  Map from partition number to set of nodes, where partition is located.

#### getMovingPartitionsAllocationMap

    public Map<Integer,Set<String>> getMovingPartitionsAllocationMap()

Gets allocation map of partitions with state MOVING in the cluster.

Specified by:
  `getMovingPartitionsAllocationMap` in interface `CacheGroupMetricsMXBean`
Returns:
  Map from partition number to set of nodes, where partition is located

#### getAffinityPartitionsAssignmentMap

    public Map<Integer,List<String>> getAffinityPartitionsAssignmentMap()

Gets affinity partitions assignment map.

Specified by:
  `getAffinityPartitionsAssignmentMap` in interface `CacheGroupMetricsMXBean`
Returns:
  Map from partition number to list of nodes. The first node in this list is where the PRIMARY partition is assigned, other nodes in the list is where the BACKUP partitions is assigned.

#### getType

    public String getType()

Cache group type.

Specified by:
  `getType` in interface `CacheGroupMetricsMXBean`

#### getPartitionIds

    public List<Integer> getPartitionIds()

Local partition ids.

Specified by:
  `getPartitionIds` in interface `CacheGroupMetricsMXBean`

#### getTotalAllocatedPages

    public long getTotalAllocatedPages()

Cache group total allocated pages.

Specified by:
  `getTotalAllocatedPages` in interface `CacheGroupMetricsMXBean`

#### getTotalAllocatedSize

    public long getTotalAllocatedSize()

Total size of memory allocated for group, in bytes.

Specified by:
  `getTotalAllocatedSize` in interface `CacheGroupMetricsMXBean`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

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