class CacheSamplerImpl implements CacheSampler, CacheConfigurationListener {

    @Override
    public long getSize() {
        if (cache.getCacheConfiguration().isTerracottaClustered()) {
            return getRemoteSizeSample().getMostRecentSample().getCounterValue();
        }

        try {
            return cache.getStatistics().getSize();
        } catch (RuntimeException e) {
            throw Utils.newPlainException(e);
        }
    }

    public  CacheSamplerImpl(Ehcache cache);

}