Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching for versions infos #900

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

LiubovDidkivska
Copy link
Contributor

@LiubovDidkivska LiubovDidkivska commented Jun 8, 2020

Add implementation to put/get versions
list to catalog client cache.
Implement versions infos cache tests.

Relates-To: OLPEDGE-2080

Signed-off-by: Liubov Didkivska ext-liubov.didkivska@here.com

@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #900 into master will increase coverage by 0.0%.
The diff coverage is 87.8%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #900   +/-   ##
======================================
  Coverage    81.2%   81.2%           
======================================
  Files         303     305    +2     
  Lines       10575   10620   +45     
======================================
+ Hits         8591    8628   +37     
- Misses       1984    1992    +8     
Impacted Files Coverage Δ
...ice-read/src/repositories/CatalogCacheRepository.h 100.0% <ø> (ø)
...rc/generated/serializer/VersionInfosSerializer.cpp 64.3% <64.3%> (ø)
...e-read/src/generated/parser/JsonParserCacheValue.h 100.0% <100.0%> (ø)
...e-read/src/repositories/CatalogCacheRepository.cpp 100.0% <100.0%> (ø)
...ude/olp/dataservice/read/model/VersionDependency.h 57.1% <0.0%> (-42.9%) ⬇️
...d/include/olp/dataservice/read/model/VersionInfo.h 100.0% <0.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd2d656...0ef9d58. Read the comment docs.

@LiubovDidkivska LiubovDidkivska force-pushed the task/olpedge-1606_versions_api_2__ branch 7 times, most recently from db5e6c8 to ba94dd9 Compare June 9, 2020 08:17
@LiubovDidkivska LiubovDidkivska changed the title Add metadata api to get versions list Add versions list implementation Jun 9, 2020
@LiubovDidkivska LiubovDidkivska force-pushed the task/olpedge-1606_versions_api_2__ branch from 610f818 to 0d299bd Compare June 9, 2020 09:52
olp-cpp-sdk-dataservice-read/src/CatalogClientImpl.cpp Outdated Show resolved Hide resolved
Comment on lines 139 to 149
return repository::CatalogRepository::GetVersionsList(
std::move(catalog), context, std::move(request), std::move(settings));
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why do we need then copy parameters on CatalogRepository::GetVersionsList() if it is sync? Can we move towards pass by reference to save copies?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could we do this in separate pull request and make this changes also in other clients?

Copy link
Contributor

Choose a reason for hiding this comment

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

Considering our current backlog I dont think that will be any time soon. Ill add a ticket to the backlog for this but i would prefer if we can already do it in your PR as we also did it in #891.
But please note that this is not valid for all methods. For example CatalogClient::GetCatalog() could still use it as it does not have any version relation.

Copy link
Contributor

@andescu andescu left a comment

Choose a reason for hiding this comment

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

Tests missing!

Comment on lines 139 to 149
return repository::CatalogRepository::GetVersionsList(
std::move(catalog), context, std::move(request), std::move(settings));
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering our current backlog I dont think that will be any time soon. Ill add a ticket to the backlog for this but i would prefer if we can already do it in your PR as we also did it in #891.
But please note that this is not valid for all methods. For example CatalogClient::GetCatalog() could still use it as it does not have any version relation.

olp-cpp-sdk-dataservice-read/src/CatalogClientImpl.cpp Outdated Show resolved Hide resolved
@LiubovDidkivska LiubovDidkivska force-pushed the task/olpedge-1606_versions_api_2__ branch from 0f27430 to e327e4e Compare June 10, 2020 09:02
@LiubovDidkivska LiubovDidkivska changed the title Add versions list implementation Add caching for versions infos Jun 10, 2020
@LiubovDidkivska LiubovDidkivska force-pushed the task/olpedge-1606_versions_api_2__ branch from e327e4e to 61e3967 Compare June 10, 2020 09:05
@@ -65,4 +68,50 @@ TEST(PartitionsCacheRepositoryTest, DefaultExpiry) {
}
}

TEST(CatalogCacheRepositoryTest, VersionsList) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please also add a test case for start_version = -1 as specified by the documentation:

startVersion
The beginning of the range of versions you want to get (exclusive). By convention -1 indicates the initial version before the first publication. After the first publication, the catalog version is 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test will be added to CatalogRepositoryTest

Copy link
Contributor

Choose a reason for hiding this comment

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

But why in CatalogRepositoryTest as this will have direct implication upon the key generation, which needs to be tested that it works correctly, means that not by mistake the -1 startVersion is converted to 0 as we do not support -1 while converting to string.

Liubov Didkivska added 3 commits June 10, 2020 17:24
Add implementation to put/get versions
list to catalog client cache.
Implement versions infos cache tests.

Relates-To: OLPEDGE-1606

Signed-off-by: Liubov Didkivska <ext-liubov.didkivska@here.com>
Add implementation to put/get versions
list to catalog client cache.
Implement versions infos cache tests.

Relates-To: OLPEDGE-1606

Signed-off-by: Liubov Didkivska <ext-liubov.didkivska@here.com>
Add implementation to put/get versions
list to catalog client cache.
Implement versions infos cache tests.

Relates-To: OLPEDGE-1606

Signed-off-by: Liubov Didkivska <ext-liubov.didkivska@here.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants