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

added some loggings

parent f1c04891
...@@ -10,7 +10,7 @@ public interface BundlesStreamSource { ...@@ -10,7 +10,7 @@ public interface BundlesStreamSource {
default Set<Metadatum> getAllMetadata(String scopedIdentifier) { default Set<Metadatum> getAllMetadata(String scopedIdentifier) {
Set<Metadatum> result; Set<Metadatum> result;
String bundleIdentifier = getReference() + "@@" + scopedIdentifier; String bundleIdentifier = getReference() + "@@" + scopedIdentifier;
Optional<Bundle> bundleOptional = getBundlesStream().filter( b -> bundleIdentifier.equals( b.getReference() ) ).findFirst(); Optional<Bundle> bundleOptional = getBundlesStream().filter( b -> bundleIdentifier.equals( b.getReference() ) ).findFirst();
if ( bundleOptional.isPresent() ) { if ( bundleOptional.isPresent() ) {
result = bundleOptional.get().getMetadata(); result = bundleOptional.get().getMetadata();
......
...@@ -3,6 +3,7 @@ package org.gesis.dda.wizard.service; ...@@ -3,6 +3,7 @@ package org.gesis.dda.wizard.service;
import java.time.Instant; import java.time.Instant;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.stream.Stream;
import javax.inject.Inject; import javax.inject.Inject;
...@@ -80,6 +81,7 @@ public class FeederService { ...@@ -80,6 +81,7 @@ public class FeederService {
BundlesSource bundlesSourceEntity = bundlesSourceRepository.findByReference(sourceReference); BundlesSource bundlesSourceEntity = bundlesSourceRepository.findByReference(sourceReference);
log.info("bundlesSourceEntity={}", bundlesSourceEntity); log.info("bundlesSourceEntity={}", bundlesSourceEntity);
log.info("feeding context={}", feedingContext.toString());
BundlesStreamSource bundlesStreamSource = feedingContext.getBundlesStreamSource(); BundlesStreamSource bundlesStreamSource = feedingContext.getBundlesStreamSource();
BundlesSourceState bundlesSourceState = bundlesSourceEntity.getBundlesSourceState(); BundlesSourceState bundlesSourceState = bundlesSourceEntity.getBundlesSourceState();
...@@ -91,16 +93,18 @@ public class FeederService { ...@@ -91,16 +93,18 @@ public class FeederService {
nihis.updateNextIncrementalHarvestingStartInstant(startOfFeedingInstant); nihis.updateNextIncrementalHarvestingStartInstant(startOfFeedingInstant);
bundlesSourceEntity.setBundlesSourceState(BundlesSourceState.PROCESSING); bundlesSourceEntity.setBundlesSourceState(BundlesSourceState.PROCESSING);
BundlesSource savedBundlesSourceEntity = bundlesSourceRepository.save(bundlesSourceEntity); BundlesSource savedBundlesSourceEntity = bundlesSourceRepository.save(bundlesSourceEntity);
BundleState fullIngestionResult = bundlesStreamSource. Stream<Bundle> bundlesStream = bundlesStreamSource.getBundlesStream();
getBundlesStream(). BundleState fullIngestionResult = bundlesStream.
map(bundle -> { map(bundle -> {
BundleState result; BundleState result;
log.info("bundle iterate: {}", bundle.getReference());
org.gesis.dda.wizard.domain.Bundle bundleEntity = createOrUpdateBundle(bundle, savedBundlesSourceEntity); org.gesis.dda.wizard.domain.Bundle bundleEntity = createOrUpdateBundle(bundle, savedBundlesSourceEntity);
log.info("bundleEntity= {}", bundleEntity.getId());
// by now, we have an existing bundleEntity // by now, we have an existing bundleEntity
result = feedBundle(feedingContext, bundleEntity, bundle); result = feedBundle(feedingContext, bundleEntity, bundle);
BundlesSourceEntityDataModificationStrategy dataModificationStrategy = feedingContext.getBundlesSourceEntityDataModificationStrategy(); BundlesSourceEntityDataModificationStrategy dataModificationStrategy = feedingContext.getBundlesSourceEntityDataModificationStrategy();
BundlesSource bse = dataModificationStrategy.updateDataOnBundleIngestionResult(savedBundlesSourceEntity, bundle, result); BundlesSource bse = dataModificationStrategy.updateDataOnBundleIngestionResult(savedBundlesSourceEntity, bundle, result);
log.info("BSE= {}", bse.getId());
bse = bundlesSourceRepository.save(bse); bse = bundlesSourceRepository.save(bse);
return result; 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