Commit 6b7c4b9e by Steinberg, Jan

added some loggings

parent f1c04891
......@@ -10,7 +10,7 @@ public interface BundlesStreamSource {
default Set<Metadatum> getAllMetadata(String scopedIdentifier) {
Set<Metadatum> result;
String bundleIdentifier = getReference() + "@@" + scopedIdentifier;
String bundleIdentifier = getReference() + "@@" + scopedIdentifier;
Optional<Bundle> bundleOptional = getBundlesStream().filter( b -> bundleIdentifier.equals( b.getReference() ) ).findFirst();
if ( bundleOptional.isPresent() ) {
result = bundleOptional.get().getMetadata();
......
......@@ -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().
map(bundle -> {
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