SGF-289 - Enumeration restrictions (xsd:enumeration) should be avoided in the XML schema.

Removed the XSD enumeration restriction on the 'type' attribute of the 'evictionType' XSD complex-type definition in the SDG XML namespace schema, which is used by the 'eviction' sub-elements in the LOCAL, PARTITION and REPLICATE Region element schema types.  In addition, created the ExpirationAttributesFactoryBean class in the org.springframework.data.gemfire package which serves as a Spring FactoryBean and builder for constructing GemFire EvictionAttributes used in Region configuration.  Updated tests to assert and validate the use of property placeholders on both the Eviction 'type' and Expiration 'action' attributes in the Spring Data GemFire XML namespace configuration meta-data.
This commit is contained in:
John Blum
2015-01-19 18:16:06 -08:00
parent 844c630614
commit 3f72ab8928
9 changed files with 278 additions and 54 deletions

View File

@@ -1603,38 +1603,20 @@ Entity computing sizes for objects stored into the grid.
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="type" default="ENTRY_COUNT">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ENTRY_COUNT">
<xsd:annotation>
<xsd:documentation><![CDATA[
Considers the number of entries in the region before performing an eviction.
]]></xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="MEMORY_SIZE">
<xsd:annotation>
<xsd:documentation><![CDATA[
Considers the amount of memory consumed by the region before performing an eviction.
]]></xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="HEAP_PERCENTAGE">
<xsd:annotation>
<xsd:documentation><![CDATA[
Considers the amount of heap used (through the GemFire resource manager) before performing an eviction.
]]></xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
<xsd:attribute name="type" type="xsd:string" default="ENTRY_COUNT">
<xsd:annotation>
<xsd:documentation><![CDATA[
The 'type' of eviction performed, or algorithm used to perform eviction on the Region entries. Eviction types include:
ENTRY_COUNT: Considers the number of entries in the Region before performing an eviction.
HEAP_PERCENTAGE: Considers the amount of heap used (through the GemFire resource manager) before performing an eviction.
MEMORY_SIZE: Considers the amount of memory consumed by the Region before performing an eviction.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="threshold" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
The threshold (or limit) against which the eviction algorithm runs. Once the threashold is reached, eviction is
performed.
The threshold (or limit) against which the eviction algorithm runs. Once the threshold is reached, eviction is performed.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>