This discussion is archived
1 Reply Latest reply: Dec 6, 2013 9:03 AM by DwayneChung RSS

ClassCastException while accessing EnvironmentStats

user4547579 Newbie
Currently Being Moderated

Hi there,


In case you are not already aware, there is a bug in recent versions of JE:

 

        Caused by: java.lang.ClassCastException: com.sleepycat.je.utilint.IntegralLongAvgStat cannot be cast to com.sleepycat.je.utilint.LongStat

            at com.sleepycat.je.utilint.StatGroup.getLong(StatGroup.java:207)

            at com.sleepycat.je.EnvironmentStats.getAvgBatchCritical(EnvironmentStats.java:1366)

 

In the method com.sleepycat.je.evictor.Evictor.loadStats(StatsConfig) you have:

 

        for (EvictionSource source : allSources) {

            int index = source.ordinal();

 

 

            new IntegralLongAvgStat(copy,

                                    source.getAvgBatchStatDef(),

                                    numBatchTargets[index].get(),

                                    copy.getAtomicLong

                                        (source.getNumBatchesStatDef()));

            if (config.getClear()) {

                numBatchTargets[index].set(0);

            }

 

 

        }

 

But in the EnvironmentStats getters you have:

 

    public long getAvgBatchManual() {

        return cacheStats.getLong

            (EvictionSource.MANUAL.getAvgBatchStatDef());

    }

 

Cheers,

 

Matt

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points