SGF-323 - Add support for GemFire 8's DiskStore 'diskUsageCriticalPercentage' and 'diskUsageWarningPercentage' properties in the SDG XML namespace (XSD) and DiskStoreFactoryBean API.

This commit is contained in:
John Blum
2014-09-04 18:32:28 -07:00
parent 7f2e6b899c
commit 93eb3b1fef
6 changed files with 149 additions and 5 deletions

View File

@@ -55,6 +55,9 @@ public class DiskStoreFactoryBean implements BeanNameAware , FactoryBean<DiskSto
private Integer timeInterval;
private Integer writeBufferSize;
private Float diskUsageCriticalPercentage;
private Float diskUsageWarningPercentage;
private List<DiskDir> diskDirs;
private String name;
@@ -90,6 +93,12 @@ public class DiskStoreFactoryBean implements BeanNameAware , FactoryBean<DiskSto
if (compactionThreshold != null) {
diskStoreFactory.setCompactionThreshold(compactionThreshold);
}
if (diskUsageCriticalPercentage != null) {
diskStoreFactory.setDiskUsageCriticalPercentage(diskUsageCriticalPercentage);
}
if (diskUsageWarningPercentage != null) {
diskStoreFactory.setDiskUsageWarningPercentage(diskUsageWarningPercentage);
}
if (maxOplogSize != null) {
diskStoreFactory.setMaxOplogSize(maxOplogSize);
}
@@ -155,6 +164,14 @@ public class DiskStoreFactoryBean implements BeanNameAware , FactoryBean<DiskSto
this.diskDirs = diskDirs;
}
public void setDiskUsageCriticalPercentage(Float diskUsageCriticalPercentage) {
this.diskUsageCriticalPercentage = diskUsageCriticalPercentage;
}
public void setDiskUsageWarningPercentage(Float diskUsageWarningPercentage) {
this.diskUsageWarningPercentage = diskUsageWarningPercentage;
}
public void setMaxOplogSize(Integer maxOplogSize) {
this.maxOplogSize = maxOplogSize;
}

View File

@@ -75,6 +75,8 @@ public class DiskStoreParser extends AbstractSingleBeanDefinitionParser {
ParsingUtils.setPropertyValue(element, builder, "allow-force-compaction");
ParsingUtils.setPropertyValue(element, builder, "auto-compact");
ParsingUtils.setPropertyValue(element, builder, "compaction-threshold");
ParsingUtils.setPropertyValue(element, builder, "disk-usage-critical-percentage");
ParsingUtils.setPropertyValue(element, builder, "disk-usage-warning-percentage");
ParsingUtils.setPropertyValue(element, builder, "max-oplog-size");
ParsingUtils.setPropertyValue(element, builder, "queue-size");
ParsingUtils.setPropertyValue(element, builder, "time-interval");

View File

@@ -1789,7 +1789,28 @@ Sets the threshold at which an oplog will become compactable. Until it reaches t
The threshold is a percentage in the range 0..100. When the amount of garbage in an oplog exceeds this percentage then when a
compaction is done and this garbage will be cleaned up freeing up disk space. Garbage is created by entry destroys,
entry updates, and region destroys.
]]></xsd:documentation>
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="disk-usage-critical-percentage" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Disk usage above this threshold generates an error message and shuts down the member's cache. For example,
if the threshold is set to 99%, then falling under 10 GB of free disk space on a 1 TB drive generates the error
and shuts down the cache.
Set to "0" (zero) to disable. GemFire default is 99%.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="disk-usage-warning-percentage" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Disk usage above this threshold generates a warning message. For example, if the threshold is set to 90%,
then on a 1 TB drive falling under 100 GB of free disk space generates the warning.
Set to "0" (zero) to disable. GemFire default is 90%.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="max-oplog-size" type="xsd:string" default="1024">