The RDB via Snapshots Connector performs full and incremental scans of the rows in one or more tables of a database. Each row extracted from the database will be tagged with one of three possible actions - add, update or delete, so a different Aspire pipeline or job route can differentiate on the task to perform given this action. The exact nature of the extraction method is documented with the RDB via Snapshots Scanner

The connector, once started, can be stopped, paused or resumed sending a new Scanner Configuration Job. Typically the start job will contain all information required by the job to perform the scan. When pausing or stopping, the connector will wait until all the jobs it published have completed before updating the statistics and status of the connector. Pausing a scan will only work in incremental mode - resuming is much like a new incremental feed apart from the fact that the pre update SQL is not run .

RDB via Snapshots Application Bundle (Aspire 2)
AppBundle Name RDBMS Connector
Maven Coordinates com.searchtechnologies.aspire:app-rdbms-connector
Versions 2.2.2
Type Flags scheduled
Inputs AspireObject from a content source submitter holding all the information required for a crawl.
Outputs An AspireObject containing the data extracted from the database to be processed.

Configuration

This section lists all configuration parameters available to install the RDB via Snapshots Application Bundle and to execute crawls using the connector.

General Application Configuration

PropertyTypeDefaultDescription
snapshotDirstring${aspire.home}/snapshotsThe directory for snapshot files to be stored.
disableTextExtractbooleanfalseBy default, connectors use Apache Tika to extract text from downloaded documents. If you wish to apply special text processing to the downloaded document in the workflow, you should disable text extraction. The downloaded document is then available as a content stream.
workflowReloadPeriodint15mThe period after which to reload the business rules. Defaults to ms, but can be suffixed with ms, s, m, h or d to indicate the required units.
workflowErrorTolerantbooleanfalseWhen set, exceptions in workflow rules will only effect the execution of the rule in which the exception occurs. Subsequent rules will be executed and the job will complete the workflow sucessfully. If not set, exceptions in workflow rules will be re-thrown and the job will be moved to the error workflow.
debugBooleanfalseControls whether debugging is enabled for the application. Debug messages will be written to the log files.


Configuration Example

To install the application bundle, add the configuration, as follows, to the <autoStart> section of the Aspire settings.xml.

<application config="com.searchtechnologies.aspire:app-snapshot-rdbms-connector">
  <properties>
    <property name="generalConfiguration">true</property>
    <property name="rdbmsHasDefaults">true</property>
    <property name="rdbmsJDBCUrl">jdbc:mysql://127.0.0.1:3306/test</property>
    <property name="rdbmsJDBCUser">root</property>
    <property name="rdbmsJDBCPassword">encrypted:771FA372D6F46E9F0C058B359683E8CB</property>
    <property name="rdbmsJDBCDriverJar">lib/mysql-connector-java-5.1.27-bin.jar</property>
    <property name="rdbmsJDBCDriverClass"/>
    <property name="snapshotDir">${dist.data.dir}/${app.name}/snapshots</property>
    <property name="workflowReloadPeriod">15s</property>
    <property name="workflowErrorTolerant">false</property>
    <property name="debug">false</property>
  </properties>
</application>

Note: Any optional properties can be removed from the configuration to use the default value described on the table above.

Source Configuration

Scanner Control Configuration

The following table describes the list of attributes that the AspireObject of the incoming scanner job requires to correctly execute and control the flow of a scan process.

ElementTypeOptionsDescription
@actionstringstart, stop, pause, resume, abortControl command to tell the scanner which operation to perform. Use start option to launch a new crawl.
@actionPropertiesstringfull, incrementalWhen a start @action is received, it will tell the scanner to either run a full or an incremental crawl.
@normalizedCSNamestring
Unique identifier name for the content source that will be crawled.
displayNamestring
Display or friendly name for the content source that will be crawled.

Header Example

  <doc action="start" actionProperties="full" actionType="manual" crawlId="0" dbId="0" jobNumber="0" normalizedCSName="FeedOne_Connector"
   scheduleId="0" scheduler="##AspireSystemScheduler##" sourceName="ContentSourceName">
    ...
    <displayName>testSource</displayName>
    ...
  </doc>

All configuration properties described in this section are relative to /doc/connectorSource of the AspireObject of the incoming Job.

PropertyTypeDefaultDescription
rdbmsJDBCUrlstring
The JDBC URL for your RDBMS server and database. For example, "jdbc:mysql://192.168.40.27/mydb" (MySQL). This will vary depending on the type of RDBMS.
rdbmsJDBCUserstring
The name of a database user with read-only access to all of the tables which need to be indexed, and write access to the necessary update tables (if update management is handled through the RDB).
rdbmsJDBCPasswordstring
The database password
rdbmsJDBCDriverJarstring
Path to the JDBC driver JAR file for your RDBMS. Typically this is placed in the "lib" directory inside your Aspire Home, for example "lib/myjdbcdriver.jar".
rdbmsJDBCDriverClassstring
(Optional)The name of the JDBC driver class if the class name from the META-INF/services/java.sql.Driver file in the driver JAR file should not be used, or that file does not exist in the driver JAR file.
retrievePerBatchboolean
Determine if the discoverySQL + extractionSQL have to be used (batching mode). If false then the Scanner will perform a single SQL execution using the fullSQL query.
fullSQLstring
The SELECT query to be run for retrieve all documents. This query is used for full or incremental scan. The WHERE clause can be used to specify any required condition for crawling the desired documents. For slicing the discoverySQL, add {SLICES} tag to the WHERE clause. For more details, check the wiki.
discoverySQLstring
The SELECT query to be run for discovering documents. This query is used for full or incremental scan. The WHERE clause can be used to specify any required condition for crawling the desired documents. For slicing the discoverySQL, add {SLICES} tag to the WHERE clause. For more details, check the wiki.
extractionSQLstring
The SELECT query for extracting data for each document found. It is required to include a WHERE clause that contains, at least, the 'IN' expression. For example: "(...) WHERE idColumnName IN {IDS}", where idColumnName corresponds to unique key field name. {IDS} will be automatically replaced by the connector with the corresponding unique key values.
idColumnstring
The name of the column which contains unique identifiers for each row. This is used for both full and incremental crawls and must match the name returned by the SQL. If the column is aliased using the SQL "AS" construct, you should provide the alias name here.
idColumnStringbooleanfalseTrue if the ID column is a string.
useSlicesbooleanfalseTrue if you want to divide the Full crawl SQL into multiple slices. Only works when the id column is an integer.
slicesNuminteger10The number of SQL slices to split Full crawl SQL. Only works when idColumn is an integer.
indexContainersbooleanfalseTrue if the Tables will be indexed in the crawl.
stopOnErrorbooleantrue (2.2.1 Release)   True if the scan should stop when the JDBC driver throws an error while scanning though the results
waitForSubJobsinteger600000Timeout value for the crawler's sub-jobs, in milliseconds.
aclMethodstringSQLPossible values: column or SQL. Sets whether the ACLs will be retrieved from a column in the extractionSQL or the fullSQL, or if it will be retrieved by the aclSQL.
aclSQLstring
Retrieves the ACLs for the documents, the result should be in the following format: "domain\user@NT". There must be one row for every ACL on the document

Scanner Configuration Example

<doc action="start" actionProperties="full" normalizedCSName="My_RDB_Source">
  <connectorSource>
	  <useSlices>false</useSlices>
	  <retrievePerBatch>true</retrievePerBatch>
	  <discoverySQL>Select * from main_data</discoverySQL>
	  <extractionSQL>Select * from main_data WHERE ID IN {IDS}</extractionSQL>
	  <idColumn>id</idColumn>
	  <idColumnString>false</idColumnString>
	  <indexContainers>false</indexContainers>
	  <stopOnError>true</stopOnError>
	  <waitForSubJobs>600000</waitForSubJobs>
	  <aclMethod>SQL</aclMethod>
	  <aclSQL>Select 'mydomain\\user@NT' as ACL from main_data</aclSQL>
	</connectorSource>
  <displayName>My RDB Source</displayName>
</doc>

Note: To launch a crawl, the job should be sent (processed/enqueued) to the "/RDBConnector/Main" pipeline.

Output

<doc>
  <url>3</url>
  <id>3</id>
  <displayUrl>3</displayUrl>
  <snapshotUrl>001 3</snapshotUrl>
  <repItemType>aspire/row</repItemType>
  <fetchId>3</fetchId>
  <fetchUrl>3</fetchUrl>
  <rdb>../MultiConnectionPool</rdb>
  <docType>item</docType>
  <sourceName>RBMS_snapshots</sourceName>
  <sourceType>database</sourceType>
  <connectorSource>
    <useSlices>false</useSlices>
    <retrievePerBatch>true</retrievePerBatch>
    <discoverySQL>Select ID from main_data</discoverySQL>
    <extractionSQL>Select ID from main_data WHERE ID IN {IDS}</extractionSQL>
    <idColumn>ID</idColumn>
    <idColumnString>false</idColumnString>
    <indexContainers>false</indexContainers>
    <stopOnError>true</stopOnError>
    <waitForSubJobs>600000</waitForSubJobs>
    <aclMethod>SQL</aclMethod>
    <aclSQL>Select 'mydomain\\user@NT' as ACL from main_data</aclSQL>
    <displayName>RBMS snapshots</displayName>
    <dbUrl>jdbc:mysql://127.0.0.1:3306/test</dbUrl>
    <dbUser>root</dbUser>
    <dbPassword>encrypted:771FA372D6F46E9F0C058B359683E8CB</dbPassword>
    <dbDriverJar>lib/mysql-connector-java-5.1.27-bin.jar</dbDriverJar>
    <dbProps/>
    <dbDriverClass/>
    <contentSourceId>RBMS_snapshots</contentSourceId>
  </connectorSource>
  <action>add</action>
  <connectorSpecific>
    <field name="id">3</field>
  </connectorSpecific>
  <acls>
    <acl access="allow" domain="mydomain" entity="group" fullname="mydomain\user@NT" name="user@NT" scope="global"/>
  </acls>
</doc>
  • No labels