1 Reply Latest reply: Dec 6, 2013 11:03 AM by Dwayne Chung RSS

    ClassCastException while accessing EnvironmentStats

    user4547579

      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