updated reference docs and build config for GF 7

This commit is contained in:
David Turanski
2012-10-22 13:58:00 -04:00
parent e97ab1d253
commit cfdac73247
8 changed files with 196 additions and 71 deletions

View File

@@ -14,7 +14,7 @@ group = 'org.springframework.data'
repositories {
maven { url "http://repo.springsource.org/libs-milestone" }
maven { url "http://repo.springsource.org/plugins-release"}
maven { url "https://repo.springsource.org/ext-private-local"}
maven { url "http://dist.gemstone.com.s3.amazonaws.com/maven/release"}
}

View File

@@ -1,47 +1,76 @@
<chapter xml:id="new-features" xmlns="http://docbook.org/ns/docbook" version="5.0">
<title>New Features</title>
<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0" xml:id="new-features"
xmlns="http://docbook.org/ns/docbook"
xmlns:ns6="http://www.w3.org/1999/xlink"
xmlns:ns5="http://www.w3.org/1999/xhtml"
xmlns:ns4="http://www.w3.org/2000/svg"
xmlns:ns3="http://www.w3.org/1998/Math/MathML"
xmlns:ns="http://docbook.org/ns/docbook">
<title>New Features</title>
<note>
As of the 1.2.0 release, this project, formerly known as Spring GemFire, has been renamed to Spring Data GemFire to reflect that
it is now a component of the <ulink url="http://www.springsource.org/spring-data">Spring Data</ulink> project.
</note>
<section id="new-in-1-2-0">
<title>New in the 1.2.0 Release</title>
<itemizedlist>
<listitem><para>
Full support for GemFire configuration via the <emphasis>gfe</emphasis> namespace. Now GemFire components may be configured completely without
requiring a native cache.xml file.
</para>
</listitem>
<listitem><para>
WAN Gateway support for both GemFire 6.6.x. See <xref linkend="bootstrap:gateway"/>
</para>
</listitem>
<listitem><para>
Spring Data Repository support with a dedicated namespace, <emphasis>gfe-data</emphasis>. See <xref linkend="gemfire-repositories"/>
</para>
</listitem>
<listitem><para>
Namespace support for registering GemFire functions. See <xref linkend="bootstrap:function"/>
</para>
</listitem>
<listitem>
<para>
A top level <literal>&lt;disk-store&gt;</literal> element has been added to the <emphasis>gfe</emphasis> namespace to allow sharing of persist stores among regions,
and other components that support persistent backup. See <xref linkend="bootstrap-diskstore"/>
<caution>The <literal>&lt;*-region&gt;</literal> elements no longer allow a nested <literal>&lt;disk-store&gt;</literal>
</caution>
</para>
</listitem>
<listitem><para>
GemFire subregions are supported via nested <literal>&lt;*-region&gt;</literal> elements
</para>
</listitem>
<listitem><para>
A <literal>&lt;local-region&gt;</literal> element has been added to configure a local region
</para>
</listitem>
</itemizedlist>
</section>
</chapter>
<note>
As of the 1.2.0 release, this project, formerly known as Spring GemFire, has been renamed to Spring Data GemFire to reflect that it is now a component of the
<ulink url="http://www.springsource.org/spring-data">Spring Data</ulink>
project.
</note>
<section>
<title>New in the 1.2.1 Release</title>
<itemizedlist>
<listitem>
<para>WAN Gateway Support for GemFire 7.0</para>
</listitem>
</itemizedlist>
</section>
<section id="new-in-1-2-0">
<title>New in the 1.2.0 Release</title>
<itemizedlist>
<listitem>
<para>Full support for GemFire configuration via the
<emphasis>gfe</emphasis> namespace. Now GemFire components may be
configured completely without requiring a native cache.xml
file.</para>
</listitem>
<listitem>
<para>WAN Gateway support for GemFire 6.6.x. See <xref
linkend="bootstrap:gateway"/></para>
</listitem>
<listitem>
<para>Spring Data Repository support with a dedicated namespace,
<emphasis>gfe-data</emphasis>. See <xref
linkend="gemfire-repositories"/></para>
</listitem>
<listitem>
<para>Namespace support for registering GemFire functions. See <xref
linkend="bootstrap:function"/></para>
</listitem>
<listitem>
<para>A top level <literal>&lt;disk-store&gt;</literal> element has
been added to the <emphasis>gfe</emphasis> namespace to allow sharing
of persist stores among regions, and other components that support
persistent backup. See <xref linkend="bootstrap-diskstore"/>
<caution>The <literal>&lt;*-region&gt;</literal> elements no longer
allow a nested <literal>&lt;disk-store&gt;</literal> </caution></para>
</listitem>
<listitem>
<para>GemFire subregions are supported via nested
<literal>&lt;*-region&gt;</literal> elements</para>
</listitem>
<listitem>
<para>A <literal>&lt;local-region&gt;</literal> element has been added
to configure a local region</para>
</listitem>
</itemizedlist>
</section>
</chapter>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<section version="5.0" id="bootstrap:gateway"
<section id="bootstrap:gateway" version="5.0"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
@@ -12,9 +12,77 @@
<para>WAN gateways provide a way to synchronize GemFire distributed systems
across geographic distributed areas. As of Release 1.2.0, Spring Data
GemFire provides namespace support for configuring WAN gateways as
illustrated in the following example:</para>
illustrated in the following examples:</para>
<programlisting language="xml">&lt;gfe:cache/&gt;
<section><title>WAN Configuration in GemFire 7.0</title>
<para>
GemFire 7.0 introduces new APIs for WAN configuration. While the original APIs provided
in GemFire 6 are still supported, it is recommended that you use the new
APIs if you are using GemFire 7.0. The Spring Data GemFire namespace
supports either. In the example below, <literal>GatewaySender</literal>s are configured for a
partitioned region by adding child elements to the region (<literal>gateway-sender</literal>
and <literal>gateway-sender-ref</literal>). The <literal>GatewaySender</literal> may register
<literal>EventFilter</literal>s and
<literal>TransportFilters</literal>. Also shown below is an example configuration of an
<literal>AsyncEventQueue</literal> which must also be wired into a region (not shown).
</para>
<programlisting language="xml">&lt;gfe:partitioned-region id="region-inner-gateway-sender" &gt;
&lt;gfe:gateway-sender
remote-distributed-system-id="1"&gt;
&lt;gfe:event-filter&gt;
&lt;bean class="org.springframework.data.gemfire.example.SomeEventFilter"/&gt;
&lt;/gfe:event-filter&gt;
&lt;gfe:transport-filter&gt;
&lt;bean class="org.springframework.data.gemfire.example.SomeTransportFilter"/&gt;
&lt;/gfe:transport-filter&gt;
&lt;/gfe:gateway-sender&gt;
&lt;gfe:gateway-sender-ref bean="gateway-sender"/&gt;
&lt;/gfe:partitioned-region&gt;
&lt;gfe:async-event-queue id="async-event-queue" batch-size="10" persistent="true" disk-store-ref="diskstore"
maximum-queue-memory="50"&gt;
&lt;gfe:async-event-listener&gt;
&lt;bean class="org.springframework.data.gemfire.example.SomeAsyncEventListener"/&gt;
&lt;/gfe:async-event-listener&gt;
&lt;/gfe:async-event-queue&gt;
&lt;gfe:gateway-sender id="gateway-sender" remote-distributed-system-id="2"&gt;
&lt;gfe:event-filter&gt;
&lt;ref bean="event-filter"/&gt;
&lt;bean class="org.springframework.data.gemfire.example.SomeEventFilter"/&gt;
&lt;/gfe:event-filter&gt;
&lt;gfe:transport-filter&gt;
&lt;ref bean="transport-filter"/&gt;
&lt;bean class="org.springframework.data.gemfire.example.SomeTransportFilter"/&gt;
&lt;/gfe:transport-filter&gt;
&lt;/gfe:gateway-sender&gt;
&lt;bean id="event-filter" class="org.springframework.data.gemfire.example.AnotherEventFilter"/&gt;
&lt;bean id="transport-filter" class="org.springframework.data.gemfire.example.AnotherTransportFilter"/&gt;
</programlisting>
<para>On the other end of a <literal>GatewaySender</literal> is a corresponding
<literal>GatewayReceiver</literal>
to receive gateway events. The <literal>GatewayReceiver</literal> may also be configured with
<literal>EventFilter</literal>s and <literal>TransportFilter</literal>s.</para>
<programlisting language="xml">&lt;gfe:gateway-receiver id="gateway-receiver"
start-port="12345" end-port="23456" bind-address="192.168.0.1"&gt;
&lt;gfe:transport-filter&gt;
&lt;bean class="org.springframework.data.gemfire.example.SomeTransportFilter"/&gt;
&lt;/gfe:transport-filter&gt;
&lt;/gfe:gateway-receiver&gt;</programlisting>
<para>Please refer to the GemFire product document for a detailed
explanation of all the configuration options.</para>
</section>
<section>
<title>WAN Configuration in GemFire 6.6</title>
<programlisting language="xml">&lt;gfe:cache/&gt;
&lt;gfe:replicated-region id="region-with-gateway" enable-gateway="true" hub-id="gateway-hub"/&gt;
@@ -33,16 +101,19 @@
&lt;/gfe:gateway&gt;
&lt;/gfe:gateway-hub&gt;</programlisting>
<para>A region may synchronize all or part of its contents to a gateway hub
used to access one or more remote systems. The region must set
<literal>enable-gateway</literal> to <literal>true</literal> and specify the
<literal>hub-id</literal>. </para>
<para>A region may synchronize all or part of its contents to a gateway
hub used to access one or more remote systems. The region must set
<literal>enable-gateway</literal> to <literal>true</literal> and specify
the <literal>hub-id</literal>.</para>
<para><note>
<para>If just a hub-id is specified, Spring Data GemFire automatically
assumes that the gateway should be enabled. </para>
</note></para>
<para>
<note>
<para>If just a hub-id is specified, Spring Data GemFire automatically
assumes that the gateway should be enabled.</para>
</note>
</para>
<para>Please refer to the GemFire product document for a detailed
explanation of all the configuration options.</para>
<para>Please refer to the GemFire product document for a detailed
explanation of all the configuration options.</para>
</section>
</section>

View File

@@ -7,7 +7,7 @@ slf4jVersion = 1.6.4
# Common libraries
springVersion = 3.1.2.RELEASE
springDataCommonsVersion = 1.4.0.RELEASE
gemfireVersion = 7.0.Beta-SNAPSHOT
gemfireVersion = 7.0
gemfireVersion6x = 6.6.3
# Testing

View File

@@ -123,14 +123,14 @@ abstract class AbstractRegionParser extends AliasReplacingBeanDefinitionParser {
String hubId = element.getAttribute("hub-id");
// Factory will enable gateway if it is not set and hub-id is set.
if (StringUtils.hasText(enableGateway)) {
if (ParsingUtils.GEMFIRE_VERSION.startsWith("7")) {
if (ParsingUtils.isGemfireV7OrAbove()) {
log.warn("'enable-gateway' is deprecated since Gemfire 7.0");
}
}
ParsingUtils.setPropertyValue(element, builder, "enable-gateway");
if (StringUtils.hasText(hubId)) {
if (ParsingUtils.GEMFIRE_VERSION.startsWith("7")) {
if (ParsingUtils.isGemfireV7OrAbove()) {
log.warn("'hub-id' is deprecated since Gemfire 7.0");
}
if (!CollectionUtils.isEmpty(DomUtils.getChildElementsByTagName(element, "gateway-sender"))) {

View File

@@ -18,6 +18,8 @@ package org.springframework.data.gemfire.config;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeanMetadataAttribute;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanDefinitionHolder;
@@ -48,6 +50,8 @@ import com.gemstone.gemfire.cache.Scope;
* @author David Turanski
*/
abstract class ParsingUtils {
private static Log log = LogFactory.getLog(ParsingUtils.class);
final static String GEMFIRE_VERSION = CacheFactory.getVersion();
@@ -309,6 +313,17 @@ abstract class ParsingUtils {
if (StringUtils.hasText(indexUpdateType)) {
attrBuilder.addPropertyValue("indexMaintenanceSynchronous", "synchronous".equals(indexUpdateType));
}
String concurrencyChecksEnabled = element.getAttribute("concurrency-checks-enabled");
if (StringUtils.hasText(concurrencyChecksEnabled)) {
if (!ParsingUtils.isGemfireV7OrAbove()) {
log.warn("'concurrency-checks-enabled' is only available in Gemfire 7.0 or above");
} else {
ParsingUtils.setPropertyValue(element, attrBuilder, "concurrency-checks-enabled");
}
}
}
static void parseMembershipAttributes(ParserContext parserContext, Element element,
@@ -339,8 +354,7 @@ abstract class ParsingUtils {
}
static void throwExceptionIfNotGemfireV7(String elementName, String attributeName, ParserContext parserContext) {
boolean checkGemfireV7 = !GEMFIRE_VERSION.startsWith("7");
if (checkGemfireV7) {
if (!isGemfireV7OrAbove()) {
String messagePrefix = (attributeName == null) ? "element '" + elementName + "'" : "attribute '"
+ attributeName + " of element '" + elementName + "'";
parserContext.getReaderContext().error(
@@ -348,6 +362,13 @@ abstract class ParsingUtils {
null);
}
}
static boolean isGemfireV7OrAbove() {
int version = Integer.parseInt(GEMFIRE_VERSION.substring(0,1));
return version >= 7;
}
static void parseScope(Element element, BeanDefinitionBuilder builder) {
String scope = element.getAttribute("scope");

View File

@@ -1064,6 +1064,16 @@ reduce thread contention. This sets an initial parameter on the underlying java.
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="concurrency-checks-enabled" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Enables a versioning system that detects concurrent modifications and ensures that region contents are consistent across
the distributed system. True by default. Only available in GemFire 7.0 or above
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

View File

@@ -306,12 +306,6 @@ public class GemfireV7GatewayNamespaceTest extends RecreatingContextTest impleme
return this;
}
@Override
public AsyncEventQueueFactory setBatchTimeInterval(int arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public AsyncEventQueueFactory setParallel(boolean arg0) {
// TODO Auto-generated method stub