Skip to content

Commit

Permalink
# IGNITE-96 Fixed TODO by usage of internal API.
Browse files Browse the repository at this point in the history
  • Loading branch information
akuznetsov-gridgain committed Feb 12, 2015
1 parent 78cc69e commit 4db559b
Showing 1 changed file with 8 additions and 10 deletions.
Expand Up @@ -30,12 +30,11 @@
import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.internal.util.typedef.internal.*;
import org.jetbrains.annotations.*; import org.jetbrains.annotations.*;


import javax.cache.*;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;


/** /**
* Data transfer object for {@link org.apache.ignite.cache.GridCache}. * Data transfer object for {@link IgniteCache}.
*/ */
public class VisorCache implements Serializable { public class VisorCache implements Serializable {
/** */ /** */
Expand Down Expand Up @@ -189,22 +188,21 @@ else if (ca instanceof GridDhtCacheAdapter)
int size = ca.size(); int size = ca.size();
int near = ca.nearSize(); int near = ca.nearSize();


Set<Cache.Entry> set = ca.entrySet(); Set<GridCacheEntryEx> set = ca.map().entries0();


long memSz = 0; long memSz = 0;


Iterator<Cache.Entry> it = set.iterator(); Iterator<GridCacheEntryEx> it = set.iterator();


int sz = sample > 0 ? sample : DFLT_CACHE_SIZE_SAMPLING; int sz = sample > 0 ? sample : DFLT_CACHE_SIZE_SAMPLING;


int cnt = 0; int cnt = 0;


// TODO ignite-96 while (it.hasNext() && cnt < sz) {
// while (it.hasNext() && cnt < sz) { memSz += it.next().memorySize();
// memSz += it.next().memorySize();
// cnt++;
// cnt++; }
// }


if (cnt > 0) if (cnt > 0)
memSz = (long)((double)memSz / cnt * size); memSz = (long)((double)memSz / cnt * size);
Expand Down

0 comments on commit 4db559b

Please sign in to comment.