Skip to content

Latest commit

 

History

History

kafka-connect-upload-source

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

RADAR-base Upload Source connector

This sub module contains upload source connector of RADAR-base platform. This application periodically pools data stored in radar_upload_backend for processing then uploading it to Kafka. The processing of the data depends on the metadata of each record read from the database and eventually converted into to avro records and published to Kafka.

Some files such as wearable camera data (images) and raw binary data from Physilog5 are directly uploaded to the target destination.

Each record of data belongs to a specific source-type and each source-type should have a matching ConverterFactory implemented in radar-upload-source-connector.

Currently supported ConverterFactory classes are listed below:

  • org.radarbase.connect.upload.converter.altoida.AltoidaConverterFactory
  • org.radarbase.connect.upload.converter.axivity.AxivityConverterFactory
  • org.radarbase.connect.upload.converter.oxford.WearableCameraConverterFactory
  • org.radarbase.connect.upload.converter.gaitup.Physilog5ConverterFactory

To add support to process data from new source-types, a compatible ConverterFactory should be implemented according to the data structure of the data.

Installation

In addition to Zookeeper and Kafka brokers, [radar-upload-backend] and [managment-portal] applications should be running to use radar-upload-source-connector

To run a all dependent services of radar-upload-source-connect in your localhost, please refer to the docker-compose

Usage

First, create OAuth Clients for radar-upload-source-connector and radar-upload-backend in Management Portal

Copy etc/source-upload.properties.template to docker/source-upload.properties and enter the client ID and client secret of radar-upload-source-connector.

By default all ConverterFactory classes are enabled. You can enable a subset of them by specifying a list of ConverterFactory classes in comma-separated-value for property upload.source.record.converter.classes

The following tables shows the all properties.

Name Description Type Default Valid Values Importance
upload.source.client.idOAuth Client id of radar-upload-source-connector in Management Portal.stringradar-upload-connector-clienthigh
upload.source.client.secretOAuth Client secret of radar-upload-source-connector in Management Portal.stringhigh
upload.source.client.tokenUrlOAuth Token url of Managment Portal.stringhttp://managementportal-app:8080/managementportal/oauth/tokenResolvable URL of Managmemnt portal plus /oauth/tokenlow
upload.source.backend.baseUrlBase URL of radar-upload-backendstringhttp://radar-upload-connect-backend:8085/radar-upload/low
upload.source.poll.interval.msHow often the connector should poll new data from radar-upload-backend to process in millseconds long60000high
upload.source.queue.sizeCapacity of the records queue.int1000high
upload.source.record.converter.classesList of `ConverterFactory` classes to be enabled, separated by commas.listhigh

If any of the ConverterFactory with direct file upload is enabled, the following properties must be configured.

local/output
Name Description s3 sftp local
upload.source.file.uploader.typeWhat type of file uploader should be used for direct file uploads. Specify a value from `s3`, `sftp` or `local`. s3sftp
upload.source.file.uploader.target.endpointAdvertised URL Endpoint of the file upload target. For sftp, specify advertised url in sftp://host:port format. If port is not specified default port 22 will be used.http://minio:9000/sftp://hostname:port/ file://
upload.source.file.uploader.target.root.directoryTarget root directory or a s3 bucket name where files should be uploaded to.radar-output-storage/output
upload.source.file.uploader.usernameUsername to upload files to the target. Specify the access-key if s3 is chosen.access-keysftp username
upload.source.file.uploader.passwordUsername to upload files to the target. Specify the secret-key if s3 is chosen.secret-keysftp password
upload.source.file.uploader.sftp.private.key.filePath of private-key file if using private key for uploading files using sftp./etc/upload-upload-source-connect/ssh-privatekey
upload.source.file.uploader.sftp.passphrasePassphrase of the private-key file if using private key for uploading files using sftp.passphrase for private-key

Contributing

Code should be formatted using the Google Java Code Style Guide. If you want to contribute a feature or fix browse our issues, and please make a pull request.