Skip to content
Snippets Groups Projects
Commit aeeb2224 authored by felmer's avatar felmer
Browse files

SSDM-7430: log improved in AttachmentsSynchronizer.

parent 3a44967e
No related branches found
No related tags found
No related merge requests found
...@@ -182,12 +182,12 @@ public class AttachmentsSynchronizer implements ITaskExecutor<List<IncomingEntit ...@@ -182,12 +182,12 @@ public class AttachmentsSynchronizer implements ITaskExecutor<List<IncomingEntit
this.monitor = monitor; this.monitor = monitor;
} }
private void log(List<IncomingEntity<?>> entities, int numberOfEntitiesWithAttachments, String description) private void log(List<IncomingEntity<?>> entities, int numberOfEntitiesWithAttachments, int totalNumberOfEntities, String description)
{ {
List<String> ids = entities.stream().map(IncomingEntity::getIdentifer).collect(Collectors.toList()); List<String> ids = entities.stream().map(IncomingEntity::getIdentifer).collect(Collectors.toList());
String idsAsString = CollectionUtils.abbreviate(ids, 200); String idsAsString = CollectionUtils.abbreviate(ids, 20);
monitor.log(String.format("%4d (of %4d) %ss %s. %s", monitor.log(String.format("%4d (of %4d) %ss %s. %s",
numberOfEntitiesWithAttachments, entities.size(), entityKind, description, idsAsString)); numberOfEntitiesWithAttachments, totalNumberOfEntities, entityKind, description, idsAsString));
} }
public <AH extends IPermIdHolder & IAttachmentsHolder> void handle(List<IncomingEntity<?>> entities) public <AH extends IPermIdHolder & IAttachmentsHolder> void handle(List<IncomingEntity<?>> entities)
...@@ -197,9 +197,9 @@ public class AttachmentsSynchronizer implements ITaskExecutor<List<IncomingEntit ...@@ -197,9 +197,9 @@ public class AttachmentsSynchronizer implements ITaskExecutor<List<IncomingEntit
{ {
return; return;
} }
log(entities, filteredEntities.size(), "with attachments on data source"); log(filteredEntities, filteredEntities.size(), entities.size(), "with attachments on data source");
Map<String, Map<String, Attachment>> existingAttachments = retrievAttachments(v3api, sessionToken, entities); Map<String, Map<String, Attachment>> existingAttachments = retrievAttachments(v3api, sessionToken, entities);
log(entities, existingAttachments.size(), "on harvester"); log(entities, existingAttachments.size(), entities.size(), "on harvester");
Map<String, Map<String, Attachment>> attachmentsFromDataSource = Map<String, Map<String, Attachment>> attachmentsFromDataSource =
retrievAttachments(v3apiDataSource, sessionTokenDataSource, filteredEntities); retrievAttachments(v3apiDataSource, sessionTokenDataSource, filteredEntities);
List<AttachmentChange> attachmentChanges = new ArrayList<>(); List<AttachmentChange> attachmentChanges = new ArrayList<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment