Importing Data from Greenplum to GemFire
An import copies all rows from a Pivotal Greenplum® Database (GPDB) table to a Pivotal GemFire® region.
The import implements an upsert functionality: if a GPDB row imported is already present in a GemFire entry, the entry value will be updated if it has changed. If the GPDB row does not already exist as a GemFire entry, a new entry is created.
The mapping of GPDB table rows to GemFire region entries is
within the region
element definition of the GemFire cache.xml
file.
An import operation may be invoked using API calls or with the
gfsh import
command.
Import Using the API
Import region functionality is exposed through the GpdbService
class.
Example:
GpdbService.createOperation(region).importRegion();
The OperationEventListener
interface provides
further flexibility by allowing a set of callbacks to be defined.
The callbacks are invoked at various
points during an import of a GPDB table.
Import Using gfsh
See the command reference page for details
on this use of the gfsh import
command.
Requirements and Caveats
Multiple regions may import from the same GPDB table concurrently.
The import operation requires a definition of the GemFire key for an entry. A missing
cache.xml
entry for thegpdb:id
element or an empty field as<gpdb:id \>
will throw an error when an import operation is attempted.An incomplete
cache.xml
entry for thegpdb:id
element, which omits fields that should have been part of a composite key, will not result in an error for an import operation. It will, however, result in leaving the GemFire region in an indeterminate state.