LATEST VERSION: 3.3.0 - RELEASE NOTES
Pivotal GemFire®-Greenplum® Connector v3.3

GemFire Event Handlers

An implementation of an event listener interface defines callbacks that will be invoked at various points within the import or export operation.

Interface OperationEventListener

Callbacks are invoked during import or export operations, so defining one or more will impact performance. Each of these methods will be applied for either an import or an export operation.

  • void onBeforeType(TypeOperationEvent event) Invoked before Pivotal Greenplum® (GPDB) SQL types are resolved into Pivotal GemFire® region fields.

  • void onAfterType(TypeOperationEvent event) Invoked after GPDB SQL types are resolved into GemFire region fields.

  • void onBeforeExternalTable(ExternalTableOperationEvent event) Invoked before an External GPDB table is created.

  • void onAfterExternalTable(ExternalTableOperationEvent event) Invoked after an External GPDB table is created.

  • void onBeforeCommit(CommitOperationEvent event) Invoked after the import or export of data, but before any GPDB commit.

  • void onAfterCommit(CommitOperationEvent event) Invoked after the import or export of data and after any GPDB commit.

Code Fragment Examples

//CustomOperationEventListener class
public class CustomOperationEventListener 
       extends AbstractOperationEventListener{

  @Override
    public void onAfterExternalTable(ExternalTableOperationEvent event) {
      // Do something against an external table after it gets created
    }

  ...
}
// Example - import operation with an event listener
ImportConfiguration importConfig = ImportConfiguration.builder(region)
    .addOperationEventListener(new CustomOperationEventListener())
    .build();
GpdbService.importRegion(importConfig);

// UPSERT export operation with the same event listener
ExportConfiguration exportConfig = ExportConfiguration.builder(region)
    .setType(ExportType.UPSERT)
    .addOperationEventListener(new CustomOperationEventListener())
    .build();
GpdbService.exportRegion(exportConfig);