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

Optimize read local cache file #457

Closed

Conversation

finefuture
Copy link
Contributor

Refer: #455

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (05141fd) 26.67% compared to head (9980b0e) 26.67%.

Files Patch % Lines
...java/com/tencent/polaris/client/flow/BaseFlow.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main     #457   +/-   ##
=========================================
  Coverage     26.67%   26.67%           
  Complexity      595      595           
=========================================
  Files           183      183           
  Lines          7752     7752           
  Branches       1004     1004           
=========================================
  Hits           2068     2068           
  Misses         5421     5421           
  Partials        263      263           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chuntaojun
Copy link
Member

chuntaojun commented Jan 18, 2024

https://github.com/polarismesh/polaris-java/blob/05141fd553d3d41461515a1c2742b46677c8b5fb/polaris-common/polaris-client/src/main/java/com/tencent/polaris/client/flow/BaseFlow.java#L234C1-L241C26


现有代码已经有降级读取本地文件的逻辑,只需要移除 MessagePersistHandler调用 init 全量加载本地文件的逻辑即可

@finefuture
Copy link
Contributor Author

https://github.com/polarismesh/polaris-java/blob/05141fd553d3d41461515a1c2742b46677c8b5fb/polaris-common/polaris-client/src/main/java/com/tencent/polaris/client/flow/BaseFlow.java#L234C1-L241C26

现有代码已经有降级读取本地文件的逻辑,只需要移除 MessagePersistHandler调用 init 全量加载本地文件的逻辑即可

image
readResourcesFromLocalCache这个方法最终是调用InMemoryRegistry的getInstances等方法, 此方法是从本地缓存读取数据, 并未从本地文件读取.此处需要增加一个降级处理: 当本地缓存不存在时从本地文件加载到缓存中.

@chuntaojun
Copy link
Member

getInstances

嗯,对,这个是需要调整

@chuntaojun
Copy link
Member

see this pr:#459

@finefuture finefuture closed this Feb 19, 2024
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.

2 participants