Search in sources :

Example 1 with ExtendedStatisticsSupport

use of org.hibernate.cache.spi.ExtendedStatisticsSupport in project hibernate-orm by hibernate.

the class DeprecatedNaturalIdCacheStatisticsImpl method getElementCountOnDisk.

@Override
public long getElementCountOnDisk() {
    long count = 0;
    HashSet<Region> processedRegions = null;
    for (NaturalIdDataAccess accessStrategy : accessStrategies) {
        final DomainDataRegion region = accessStrategy.getRegion();
        if (ExtendedStatisticsSupport.class.isInstance(region)) {
        }
        if (region instanceof ExtendedStatisticsSupport) {
            if (processedRegions == null) {
                processedRegions = new HashSet<>();
            }
            if (processedRegions.add(region)) {
                count += ((ExtendedStatisticsSupport) region).getElementCountOnDisk();
            }
        }
    }
    if (count == 0) {
        return NO_EXTENDED_STAT_SUPPORT_RETURN;
    }
    return count;
}
Also used : ExtendedStatisticsSupport(org.hibernate.cache.spi.ExtendedStatisticsSupport) DomainDataRegion(org.hibernate.cache.spi.DomainDataRegion) Region(org.hibernate.cache.spi.Region) NaturalIdDataAccess(org.hibernate.cache.spi.access.NaturalIdDataAccess) DomainDataRegion(org.hibernate.cache.spi.DomainDataRegion)

Example 2 with ExtendedStatisticsSupport

use of org.hibernate.cache.spi.ExtendedStatisticsSupport in project hibernate-orm by hibernate.

the class DeprecatedNaturalIdCacheStatisticsImpl method getSizeInMemory.

@Override
public long getSizeInMemory() {
    long count = 0;
    HashSet<Region> processedRegions = null;
    for (NaturalIdDataAccess accessStrategy : accessStrategies) {
        final DomainDataRegion region = accessStrategy.getRegion();
        if (ExtendedStatisticsSupport.class.isInstance(region)) {
        }
        if (region instanceof ExtendedStatisticsSupport) {
            if (processedRegions == null) {
                processedRegions = new HashSet<>();
            }
            if (processedRegions.add(region)) {
                count += ((ExtendedStatisticsSupport) region).getElementCountOnDisk();
            }
        }
    }
    if (count == 0) {
        return NO_EXTENDED_STAT_SUPPORT_RETURN;
    }
    return count;
}
Also used : ExtendedStatisticsSupport(org.hibernate.cache.spi.ExtendedStatisticsSupport) DomainDataRegion(org.hibernate.cache.spi.DomainDataRegion) Region(org.hibernate.cache.spi.Region) NaturalIdDataAccess(org.hibernate.cache.spi.access.NaturalIdDataAccess) DomainDataRegion(org.hibernate.cache.spi.DomainDataRegion)

Example 3 with ExtendedStatisticsSupport

use of org.hibernate.cache.spi.ExtendedStatisticsSupport in project hibernate-orm by hibernate.

the class DeprecatedNaturalIdCacheStatisticsImpl method getElementCountInMemory.

@Override
public long getElementCountInMemory() {
    long count = 0;
    HashSet<Region> processedRegions = null;
    for (NaturalIdDataAccess accessStrategy : accessStrategies) {
        final DomainDataRegion region = accessStrategy.getRegion();
        if (ExtendedStatisticsSupport.class.isInstance(region)) {
        }
        if (region instanceof ExtendedStatisticsSupport) {
            if (processedRegions == null) {
                processedRegions = new HashSet<>();
            }
            if (processedRegions.add(region)) {
                count += ((ExtendedStatisticsSupport) region).getElementCountInMemory();
            }
        }
    }
    if (count == 0) {
        return NO_EXTENDED_STAT_SUPPORT_RETURN;
    }
    return count;
}
Also used : ExtendedStatisticsSupport(org.hibernate.cache.spi.ExtendedStatisticsSupport) DomainDataRegion(org.hibernate.cache.spi.DomainDataRegion) Region(org.hibernate.cache.spi.Region) NaturalIdDataAccess(org.hibernate.cache.spi.access.NaturalIdDataAccess) DomainDataRegion(org.hibernate.cache.spi.DomainDataRegion)

Aggregations

DomainDataRegion (org.hibernate.cache.spi.DomainDataRegion)3 ExtendedStatisticsSupport (org.hibernate.cache.spi.ExtendedStatisticsSupport)3 Region (org.hibernate.cache.spi.Region)3 NaturalIdDataAccess (org.hibernate.cache.spi.access.NaturalIdDataAccess)3