(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: nonsampling 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.
- Add the x_winCmdDisc (Windows)
or x_unixCmdDisc (UNIX) parameter 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.
- 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:
- For the transporter module, implement the
com.sybase.esp.adapter.framework.discovery.TableDiscoveryWithSample
interface.
- For the formatter module, implement the
com.sybase.esp.adapter.framework.discovery.ColumnDiscovery interface.