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 37
 import org.slf4j.Logger;
37 38
 import org.slf4j.LoggerFactory;
38 39
 
40
+import com.google.common.collect.Iterables;
39 41
 import com.google.common.collect.Lists;
42
+import com.google.common.collect.Sets;
40 43
 import com.netflix.hollow.api.consumer.HollowConsumer;
41 44
 import com.netflix.hollow.api.consumer.HollowConsumer.AnnouncementWatcher;
42 45
 import com.netflix.hollow.api.consumer.HollowConsumer.BlobRetriever;
... ...
@@ -50,6 +53,7 @@ import com.netflix.hollow.api.producer.fs.HollowFilesystemBlobStorageCleaner;
50 53
 import com.netflix.hollow.api.producer.fs.HollowFilesystemPublisher;
51 54
 
52 55
 import net.bluemind.config.InstallationId;
56
+import net.bluemind.core.container.model.ContainerChangeset;
53 57
 import net.bluemind.core.container.model.ItemValue;
54 58
 import net.bluemind.core.context.SecurityContext;
55 59
 import net.bluemind.core.rest.ServerSideServiceProvider;
... ...
@@ -142,8 +146,8 @@ public class DirectorySerializer implements DataSerializer {
142 146
 		IMailboxes mboxApi = prov.instance(IMailboxes.class, domainUid);
143 147
 
144 148
 		String installationId = InstallationId.getIdentifier();
145
-
146
-		List<String> allUids = dirApi.changeset(0L).created;
149
+		ContainerChangeset<String> changeset = dirApi.changeset(0L);
150
+		List<String> allUids = new ArrayList<>(Sets.newHashSet(Iterables.concat(changeset.created, changeset.updated)));
147 151
 
148 152
 		Map<String, DataLocation> locationCache = new HashMap<>();
149 153
 		for (List<String> dirPartition : Lists.partition(allUids, 100)) {