use of org.talend.components.api.component.runtime.ReaderDataProvider in project components by Talend.
the class SalesforceDatasetRuntime method getSample.
@Override
public void getSample(int limit, Consumer<IndexedRecord> consumer) {
SalesforceDataprepSource sds = new SalesforceDataprepSource();
SalesforceInputProperties properties = new SalesforceInputProperties("model");
properties.setDatasetProperties(dataset);
throwExceptionIfValidationResultIsError(sds.initialize(container, properties));
throwExceptionIfValidationResultIsError(sds.validate(container));
SalesforceBulkQueryReader reader = (SalesforceBulkQueryReader) sds.createReader(container);
reader.setLimit(limit);
ReaderDataProvider<IndexedRecord> readerDataProvider = new ReaderDataProvider<>(reader, limit, consumer);
readerDataProvider.retrieveData();
}
use of org.talend.components.api.component.runtime.ReaderDataProvider in project components by Talend.
the class JDBCDatasetRuntime method getSample.
@Override
public void getSample(int limit, Consumer<IndexedRecord> consumer) {
JDBCSource js = new JDBCSource();
throwExceptionIfValidationResultIsError(js.initialize(container, dataset));
throwExceptionIfValidationResultIsError(js.validate(container));
JDBCInputReader reader = (JDBCInputReader) js.createReader(container);
ReaderDataProvider<IndexedRecord> readerDataProvider = new ReaderDataProvider<>(reader, limit, consumer);
readerDataProvider.retrieveData();
}
use of org.talend.components.api.component.runtime.ReaderDataProvider in project components by Talend.
the class GoogleDriveDatasetRuntime method getSample.
@Override
public void getSample(int limit, Consumer<IndexedRecord> consumer) {
GoogleDriveInputProperties properties = new GoogleDriveInputProperties("sample");
properties.setDatasetProperties(dataset);
GoogleDriveInputReader reader = (GoogleDriveInputReader) createDataSource(properties).createReader(container);
reader.setLimit(limit);
ReaderDataProvider<IndexedRecord> provider = new ReaderDataProvider<>(reader, limit, consumer);
provider.retrieveData();
}
Aggregations