HHH-12495 - Cache statistics (binary compatibility)

This commit is contained in:
Steve Ebersole 2018-04-17 18:57:12 -05:00
parent e508d6bee8
commit a63c4fe1d2
2 changed files with 15 additions and 1 deletions

View File

@ -6,6 +6,10 @@
*/ */
package org.hibernate.stat; package org.hibernate.stat;
import java.io.Serializable;
import java.util.Collections;
import java.util.Map;
/** /**
* @deprecated (since 5.3) Use {@link NaturalIdStatistics} - unfortunately the * @deprecated (since 5.3) Use {@link NaturalIdStatistics} - unfortunately the
* old statistics contracts exposed these by region name, rather than the name of * old statistics contracts exposed these by region name, rather than the name of
@ -14,7 +18,7 @@
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@Deprecated @Deprecated
public interface NaturalIdCacheStatistics { public interface NaturalIdCacheStatistics extends Serializable {
/** /**
* Number of times (since last Statistics clearing) the "natural id * Number of times (since last Statistics clearing) the "natural id
* resolution" query has been executed * resolution" query has been executed
@ -50,4 +54,8 @@ public interface NaturalIdCacheStatistics {
long getElementCountOnDisk(); long getElementCountOnDisk();
long getSizeInMemory(); long getSizeInMemory();
default Map getEntries() {
return Collections.emptyMap();
}
} }

View File

@ -6,6 +6,9 @@
*/ */
package org.hibernate.stat; package org.hibernate.stat;
import java.util.Collections;
import java.util.Map;
/** /**
* Cache statistics pertaining to a specific data region * Cache statistics pertaining to a specific data region
* *
@ -16,4 +19,7 @@
*/ */
@Deprecated @Deprecated
public interface SecondLevelCacheStatistics extends CacheRegionStatistics { public interface SecondLevelCacheStatistics extends CacheRegionStatistics {
default Map getEntries() {
return Collections.emptyMap();
}
} }