Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Feature/load overlays #236

Merged
merged 2 commits into from
Sep 28, 2021

Conversation

SebastianSchildt
Copy link
Contributor

Add support to overlay several VSS models. New parameter --overlays expecting a directory. All *.json files will be applied in alphanumeric order.

The effect is the same, as authenticated and adding the files via updateVSSTree, but it happens automatically at server start (terminating in case of any problems), so it is possible to refrain from doing this potentially dangerous and complex operations during runtime.

This will close #177

Also this changed the log level for applying a default from INFO to VERBOSE

}

// Sort according to filename
std::sort(overlayfiles.begin(), overlayfiles.end(),
Copy link
Contributor

Choose a reason for hiding this comment

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

why sort?

Copy link
Contributor Author

@SebastianSchildt SebastianSchildt Sep 23, 2021

Choose a reason for hiding this comment

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

Because the resulting VSS tree depends on the order the VSS files are merged. So the documentation (--help) states will be merged in "alphanumeric order". This sorts the detected filenames (it is not defined in what order we get them, when just iterating directory entries)

@wenwenchenbosch
Copy link
Contributor

tested and it works. only a doubts: Is it meaningful to consider all *.json file of the given folder?

For testing, I have a json file created in the given folder:

> cat test.json 
{
    "bla": "blu"
}

Then

Test Client> getMetaData bla
{
    "action": "getMetaData", 
    "metadata": {
        "bla": "blu"
    }, 
    "requestId": "6f19c09f-dafe-4f36-a4a8-29cf5ac5caca", 
    "ts": "2021-09-24T12:24:11.1632482651Z"
}

it is also perfectly merged. but it may be somehow unexpected.

Maybe better to support list of file with wildcard support like --overlay myfolder/vss_*.json

@wenwenchenbosch wenwenchenbosch merged commit 0da2093 into eclipse:master Sep 28, 2021
@wenwenchenbosch wenwenchenbosch deleted the feature/load_overlays branch September 28, 2021 12:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading multiple models
2 participants