Implementing Schema Discovery in a Custom Adapter

(Optional) Use interfaces and functions from the adapter toolkit to implement schema discovery in a transporter and formatter module. There are two types of schema discovery: non-sampling and sampling. Use non-sampling schema discovery when the transporter can fully determine schema on its own. Use sampling schema discovery when the transporter cannot determine the schema and passes this data to the formatter to generate the schema.

  1. Add the x_winCmdDisc (Windows) or x_unixCmdDisc (UNIX) parameters to the cnxml file for your custom adapter.

    See $ESP_HOME/adapters/framework/examples/discover/ExampleAdapterForDiscovery.cnxml for an example of a cnxml file with the discovery command.

  2. Implement schema discovery in your custom modules:
    • (For transporter modules only) To implement non-sampling schema discovery, implement the com.sybase.esp.adapter.framework.discovery.TableDiscovery and com.sybase.esp.adapter.framework.discovery.ColumnDiscovery interfaces.

      For an example of an adapter with non-sampling schema discovery, see $ESP_HOME/adapters/framework/examples/discover. For the source code of a discoverable transporter module, see $ESP_HOME/adapters/framework/examples/src/com/Sybase/esp/adapter/framework/examplemodules/ExampleDiscoverableInputTransporter.java.

    • (For input adapters only) To implement sampling schema discovery:
      1. For the transporter module, implement the com.sybase.esp.adapter.framework.discovery.TableDiscoveryWithSample interface.
      2. For the formatter module, implement the com.sybase.esp.adapter.framework.discovery.ColumnDiscovery interface.