Browse code

FEATBL-669 Fix: consider created + updated as changeset on directory seems to produce strange results

Thomas Cataldo authored on 05/12/2018 15:18:59
Showing 1 changed files
... ...
@@ -26,6 +26,7 @@ import java.nio.file.Path;
26 26
 import java.nio.file.Paths;
27 27
 import java.nio.file.SimpleFileVisitor;
28 28
 import java.nio.file.attribute.BasicFileAttributes;
29
+import java.util.ArrayList;
29 30
 import java.util.Collections;
30 31
 import java.util.HashMap;
31 32
 import java.util.List;
... ...
@@ -36,7 +37,9 @@ import java.util.stream.Collectors;
36 36
 import org.slf4j.Logger;
37 37
 import org.slf4j.LoggerFactory;
38 38
 
39
+import com.google.common.collect.Iterables;
39 40
 import com.google.common.collect.Lists;
41
+import com.google.common.collect.Sets;
40 42
 import com.netflix.hollow.api.consumer.HollowConsumer;
41 43
 import com.netflix.hollow.api.consumer.HollowConsumer.AnnouncementWatcher;
42 44
 import com.netflix.hollow.api.consumer.HollowConsumer.BlobRetriever;
... ...
@@ -50,6 +53,7 @@ import com.netflix.hollow.api.producer.fs.HollowFilesystemBlobStorageCleaner;
50 50
 import com.netflix.hollow.api.producer.fs.HollowFilesystemPublisher;
51 51
 
52 52
 import net.bluemind.config.InstallationId;
53
+import net.bluemind.core.container.model.ContainerChangeset;
53 54
 import net.bluemind.core.container.model.ItemValue;
54 55
 import net.bluemind.core.context.SecurityContext;
55 56
 import net.bluemind.core.rest.ServerSideServiceProvider;
... ...
@@ -142,8 +146,8 @@ public class DirectorySerializer implements DataSerializer {
142 142
 		IMailboxes mboxApi = prov.instance(IMailboxes.class, domainUid);
143 143
 
144 144
 		String installationId = InstallationId.getIdentifier();
145
-
146
-		List<String> allUids = dirApi.changeset(0L).created;
145
+		ContainerChangeset<String> changeset = dirApi.changeset(0L);
146
+		List<String> allUids = new ArrayList<>(Sets.newHashSet(Iterables.concat(changeset.created, changeset.updated)));
147 147
 
148 148
 		Map<String, DataLocation> locationCache = new HashMap<>();
149 149
 		for (List<String> dirPartition : Lists.partition(allUids, 100)) {