forked from line/centraldogma
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache the comparison result between two Git trees / Fail the timed-ou… (
line#375) Related commits: - 47764e9 - 422cec9 - 674d4ab Motivation: - Downgrading jGit from 5.3.0 to 5.2.1 did not help. - We should reuse the `RepositoryCache` for caching the comparison result between two Git trees. - We should fail more timed-out requests fast. Modifications: - Updated jGit from 5.2.1 to 5.3.0. - Moved `server.internal.storage.cache.RepositoryCache` and `CacheableCall` up to `server.internal.storage`. - `GitRepository` now depends on `RepositoryCache` optionally. - Added `CacheableCompareTreesCall` and took advantage of the cache in `GitRepository.findLatestRevision()`. - Removed the forked `DiffScanner` and `DiffEntry`. - Added `FailFastUtil` and used it in most `GitRepository` operations. - Modified `GitRepository.commit0()` to return the `List<DiffEntry>` produced during validation, so that `notifyWatchers()` does not need to compare the trees but reuse what's returned by `commit0()`. - Used `StampedLock` instead of `ReadWriteLock` to make `watch()` completely async. - Added `ReadLockStamp` to implement reentrancy. - Miscellaneous: - Added more test cases to `WatchTest`. - Added `RepositoryCache.get()` and `getIfPresent()` to reduce unsafe casts on the caller side. - Removed unnecessary `try { ... } catch (Exception) { ... }` blocks. - Renamed `GitRepository.toTreeId()` to `toTree()` and changed it to return `RevTree` instead of `ObjectId`. - De-duplicated anonymous `PathEdit` implementations into inner classes. Result: - The comparison result between two Git trees are now stored in `RepositoryCache` which can be configured by a user. - All `GitRepository` operations fail fast when timed out.
- Loading branch information
Showing
35 changed files
with
831 additions
and
969 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.