Skip to content

Handle GVL deletions#4519

Open
Lightwood13 wants to merge 7 commits into
masterfrom
handle-gvl-deletions
Open

Handle GVL deletions#4519
Lightwood13 wants to merge 7 commits into
masterfrom
handle-gvl-deletions

Conversation

@Lightwood13

Copy link
Copy Markdown
Collaborator

🔧 Type of changes

  • new feature

✨ What's the context?

What's the context for the changes?

Periodically fetch latest GVL and handle deleted vendors.

CTMBNara
CTMBNara previously approved these changes Jun 3, 2026
return fileSystem.readDirBlocking(cacheDir).stream()
.filter(filepath -> filepath.endsWith(JSON_SUFFIX))
.collect(Collectors.toMap(VendorListFileStore::parseCachedFileVersion,
filename -> fileSystem.readFileBlocking(filename).toString()));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                .collect(
                        Collectors.toMap(VendorListFileStore::parseCachedFileVersion,
                        filename -> fileSystem.readFileBlocking(filename).toString()));

Comment on lines +44 to +47
return vendors.entrySet().stream()
.filter(entry -> !VendorListUtil.vendorIsDeletedAt(entry.getValue(), now))
.filter(entry -> !liveVendorListService.isDeleted(entry.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about to wrap with MapView instead of reconstructing the whole map? It may contain a big amount of entries

private static Integer parseCachedFileVersion(String filepath) {
final String filename = new File(filepath).getName();
final String filenameWithoutExtension = StringUtils.removeEnd(filename, JSON_SUFFIX);
return Integer.valueOf(filenameWithoutExtension);
public void createCacheFromDiskShouldFailIfNoWritePermissionsForCacheDir() {
// given
final String cacheDir = tempDir.toString();
tempDir.toFile().setWritable(false, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants