Commit 6b7c4b9e authored by Steinberg, Jan's avatar Steinberg, Jan
Browse files

added some loggings

parent f1c04891
......@@ -3,6 +3,7 @@ package org.gesis.dda.wizard.service;
import java.time.Instant;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Stream;
import javax.inject.Inject;
......@@ -80,6 +81,7 @@ public class FeederService {
BundlesSource bundlesSourceEntity = bundlesSourceRepository.findByReference(sourceReference);
log.info("bundlesSourceEntity={}", bundlesSourceEntity);
log.info("feeding context={}", feedingContext.toString());
BundlesStreamSource bundlesStreamSource = feedingContext.getBundlesStreamSource();
BundlesSourceState bundlesSourceState = bundlesSourceEntity.getBundlesSourceState();
......@@ -91,16 +93,18 @@ public class FeederService {
nihis.updateNextIncrementalHarvestingStartInstant(startOfFeedingInstant);
bundlesSourceEntity.setBundlesSourceState(BundlesSourceState.PROCESSING);
BundlesSource savedBundlesSourceEntity = bundlesSourceRepository.save(bundlesSourceEntity);
BundleState fullIngestionResult = bundlesStreamSource.
getBundlesStream().
Stream<Bundle> bundlesStream = bundlesStreamSource.getBundlesStream();
BundleState fullIngestionResult = bundlesStream.
map(bundle -> {
BundleState result;
log.info("bundle iterate: {}", bundle.getReference());
org.gesis.dda.wizard.domain.Bundle bundleEntity = createOrUpdateBundle(bundle, savedBundlesSourceEntity);
log.info("bundleEntity= {}", bundleEntity.getId());
// by now, we have an existing bundleEntity
result = feedBundle(feedingContext, bundleEntity, bundle);
BundlesSourceEntityDataModificationStrategy dataModificationStrategy = feedingContext.getBundlesSourceEntityDataModificationStrategy();
BundlesSource bse = dataModificationStrategy.updateDataOnBundleIngestionResult(savedBundlesSourceEntity, bundle, result);
log.info("BSE= {}", bse.getId());
bse = bundlesSourceRepository.save(bse);
return result;
}).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment