ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Lantukh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-3227) IgniteCache: add method to calculate size per partition
Date Mon, 20 Jun 2016 15:03:05 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-3227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15339657#comment-15339657
] 

Ilya Lantukh commented on IGNITE-3227:
--------------------------------------

Hi [~saikatr],

I don't think that implementation of GridCacheAdapter#localSizeLong(int partition, CachePeekMode[]
peekModes) is correct. Currently it will count all local entries, even from other partitions.
To obtain partition size, you should use GridDhtLocalPartition#publicSize() method. It also
has methods to check whether partition is primary or backup for a given topology version.
An instance of GridDhtLocalPartition can be accessed from GridCacheAdapter by calling {code}ctx.topology().localPartition(int
p, AffinityTopologyVersion topVer, boolean create){code}.
To count entries in swap and offheap, methods GridCacheSwapManager#swapEntriesCount(int partId)
and GridCacheSwapManager#offheapEntriesCount(int partId) should be used, respectively.

> IgniteCache: add method to calculate size per partition
> -------------------------------------------------------
>
>                 Key: IGNITE-3227
>                 URL: https://issues.apache.org/jira/browse/IGNITE-3227
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Denis Magda
>            Assignee: Saikat Maitra
>              Labels: community, important
>
> It makes sense to add size calculation per partition. Actually the following methods
should be added to the {{IgniteCache}} API.
> {code}
> public int size(int partition, CachePeekMode... peekModes) throws CacheException;
> public int localSize(int partition, CachePeekMode... peekModes);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message