Skip to content

Commit

Permalink
Merge branch 'devel' into dbeaver-infra#2-renew-certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
kseniaguzeeva authored May 14, 2024
2 parents b8dc69e + bbd296f commit b644a70
Showing 1 changed file with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,22 +338,17 @@ private void importData(
DBRProgressMonitor monitor,
DataTransferProcessorDescriptor processor,
@NotNull DBSDataManipulator dataContainer,
Path path) throws DBException
{
Path path) throws DBException {
IDataTransferProcessor processorInstance = processor.getInstance();

StreamTransferProducer producer;
if (dataContainer.getDataSource() != null) {
DatabaseTransferConsumer consumer = new DatabaseTransferConsumer(dataContainer);
producer = new StreamTransferProducer(new StreamEntityMapping(path), processor);

DatabaseTransferConsumer consumer = new DatabaseTransferConsumer(dataContainer);
DatabaseConsumerSettings databaseConsumerSettings = new DatabaseConsumerSettings();
databaseConsumerSettings.setContainer((DBSObjectContainer) dataContainer.getDataSource());
consumer.setSettings(databaseConsumerSettings);
DatabaseMappingContainer databaseMappingContainer = new DatabaseMappingContainer(databaseConsumerSettings, dataContainer);
databaseMappingContainer.getAttributeMappings(monitor);
databaseMappingContainer.setTarget(dataContainer);
consumer.setContainerMapping(databaseMappingContainer);

StreamTransferProducer producer = new StreamTransferProducer(new StreamEntityMapping(path), processor);

StreamProducerSettings producerSettings = new StreamProducerSettings();
Map<String, Object> properties = new HashMap<>();
Expand All @@ -366,7 +361,11 @@ private void importData(
producer,
processorInstance,
properties);

DatabaseMappingContainer databaseMappingContainer =
new DatabaseMappingContainer(databaseConsumerSettings, producer.getDatabaseObject());
databaseMappingContainer.getAttributeMappings(monitor);
databaseMappingContainer.setTarget(dataContainer);
consumer.setContainerMapping(databaseMappingContainer);
try {
producer.transferData(monitor, consumer, processorInstance, producerSettings, null);
} catch (DBException e) {
Expand Down

0 comments on commit b644a70

Please sign in to comment.