Dear Wiki user, You have subscribed to a wiki page or wiki category on "Metamodel Wiki" for change notification.
The "GettingStartedNewConnectors" page has been changed by tomaszguzialek: https://wiki.apache.org/metamodel/GettingStartedNewConnectors Comment: Pasting the content of my post in the mailing list. New page: = Getting started - new connectors = 1. Create a new XXXDataContext class that extends QueryPostProcessDataContext (to get functionalities for free) that holds a reference to a native API object. Taking existing examples: CouchDbDataContext holds Ektorp' CouchDbInstance<<BR>> HBaseDataContext holds HTablePool<<BR>> CsvDataContext holds a handle to a file (through MetaModel's Resource class, to be precise)<<BR>> 2. Implement materializeMainSchemaTable to fetch the data that is going to represent the table, using the native API. Existing examples: CouchDbDataContext fetches a view will all docs through Ektorp's CouchDbInstance<<BR>> HBaseDataContext creates a Scan of a table through HBaseTablePool<<BR>> CsvDataContext reads the whole file using our file handle<<BR>> 3. Return a new XXXDataSet instance with the native result passed as a parameter. XXXDataSet class takes the native result object and translates it to the MetaModel's Row objects. CouchDbDataSet will parse the JSON document and instantiate MetaModel's Row object with this data<<BR>> HBaseDataSet extracts the values from the Scan and instantiates MetaModel's Row object with the values<<BR>> CsvDataSet translates a line from a CSV file into MetaModel's Row object<<BR>> This is the minimum that needs to be implemented. While we have the native result translated to MetaModel's Row objects, selecting specific columns, filtering and so on we get for free from QueryPostProcessDataContext class that we subclassed. Of course, it is not the most performant way of querying, for example doing a full scan to get a single row by its primary key is optimized in many databases. Delegating primary key lookups, count queries, queries with simple WHERE clauses to the native API instead of post-processing it in Java is the next step for a developer of a new MetaModel connector.
