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 Author as a field in Repository #682

Merged
merged 3 commits into from
Feb 24, 2022
Merged

Conversation

minwoox
Copy link
Contributor

@minwoox minwoox commented Feb 23, 2022

Motivation:
Repository.author() and Repository.creationTimeMillis() have a blocking call in it.
We can add author and creationTimeMillis as member variables and assign them in the constructor to avoid the blocking call.

Modifications:

  • Add author and creationTimeMillis as member variables
  • Change Repository.author() and Repository.creationTimeMillis() methods not to have implementation

Result:

  • Repository.author() and Repository.creationTimeMillis() do not block anymore.

Motivation:
`Repository.author()` and `Repository.creationTimeMillis()` have a blocking call in it.
We can add `author` and `creationTimeMillis` as member variables and assign them in the consturctor to avoid the blocking call.

Modifications:
- Add `author` and `creationTimeMillis` as member variables
- Change `Repository.author()` and `Repository.creationTimeMillis()` methods not to have implementation

Result:
- `Repository.author()` and `Repository.creationTimeMillis()` do not block anymore.
@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #682 (673b805) into master (0ed7a9a) will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #682      +/-   ##
============================================
+ Coverage     70.04%   70.15%   +0.10%     
+ Complexity     3415     3414       -1     
============================================
  Files           349      349              
  Lines         13482    13468      -14     
  Branches       1454     1454              
============================================
+ Hits           9444     9448       +4     
+ Misses         3153     3136      -17     
+ Partials        885      884       -1     
Impacted Files Coverage Δ
...raldogma/server/storage/repository/Repository.java 74.03% <ø> (+5.93%) ⬆️
...al/storage/repository/cache/CachingRepository.java 95.31% <100.00%> (+3.40%) ⬆️
...internal/storage/repository/git/GitRepository.java 75.93% <100.00%> (+0.18%) ⬆️
...server/internal/thrift/CentralDogmaExceptions.java 63.63% <0.00%> (+13.63%) ⬆️

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 0ed7a9a...673b805. Read the comment docs.

@@ -315,6 +318,9 @@
commitIdDatabase.rebuild(jGitRepository);
assert headRevision.equals(commitIdDatabase.headRevision());
}
final Commit initialCommit = blockingHistory(Revision.INIT, Revision.INIT, ALL_PATH, 1).get(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also update CachingRepository to delegate author and creationTimeMillis?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, fixed. 😉

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

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

Thanks, @minwoox!

@minwoox minwoox added this to the 0.55.0 milestone Feb 24, 2022
@minwoox
Copy link
Contributor Author

minwoox commented Feb 24, 2022

Thanks, @ikhoon!

@minwoox minwoox merged commit e9e82d1 into line:master Feb 24, 2022
@minwoox minwoox deleted the cacheAuthor branch February 24, 2022 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants