-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Refactor ConfigCache and related pathways ,uniformly use UTF-8 encoding for md5 fields #12876
Conversation
… use UTF-8 encoding for md5 fields. Utilize the SPI mechanism in related pathways and methods to ensure extensibility for support of other types of encoding. Fix test.
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
|
* @param lastModifiedTs the last modified ts | ||
* @return the config cache | ||
*/ | ||
public ConfigCache createConfigCache(String md5, long lastModifiedTs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interface中减少方法数量,仅透出createConfigCache(),createConfigCacheGray() ,
比如
可在次基础上在ConfigCacheFactoryDelegate中重载提供四个方法,内部调用ConfigCacheFactory中的原子方法进行二次封装
} | ||
|
||
public ConfigCacheGray createConfigCacheGray(String grayName) { | ||
return configCacheFactory.createConfigCacheGray(grayName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为
ConfigCacheGray configGray=configCacheFactory.createConfigCacheGray();
configGray.setGrayName(grayName);
} | ||
|
||
public ConfigCache createConfigCache(String md5, long lastModifiedTs) { | ||
return configCacheFactory.createConfigCache(md5, lastModifiedTs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改为
ConfigCache configGray=this.createConfigCachhe();
configGray.setMd5(md5);
configGray.setlastModifiedTs(lastModifiedTs);
* | ||
* @author Sunrisea | ||
*/ | ||
public interface ConfigCacheMd5PostProcessor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类名上可以不要透出md5,不要在开源侧过多展示md5相关的语义
|
|
|
|
|
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #12876 +/- ##
=============================================
+ Coverage 72.17% 72.28% +0.11%
- Complexity 9792 9855 +63
=============================================
Files 1283 1293 +10
Lines 41387 41522 +135
Branches 4374 4384 +10
=============================================
+ Hits 29872 30016 +144
+ Misses 9408 9398 -10
- Partials 2107 2108 +1
... and 15 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
LOGGER.info("[ConfigCacheFactory] Load ConfigCacheFactory({}) ConfigCacheFactoryName({}) successfully. ", | ||
each.getClass(), each.getConfigCacheFactoryName()); | ||
if (StringUtils.equals(configCacheFactoryType, each.getConfigCacheFactoryName())) { | ||
this.configCacheFactory = each; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add log , load specific config cache factory successfully with name {name}
} | ||
} | ||
if (this.configCacheFactory == null) { | ||
this.configCacheFactory = new NacosConfigCacheFactory(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add log , load default config cache factory successfully
|
fix syntax errors
…edirected to the login page without pop-ups. (related issue alibaba#11153) (alibaba#12907) * Remove excess code.(related issue alibaba#12871 ) * Log in to the console through a browser http://ip:8848/nacos and be redirected to the login page without pop-ups. (related issue alibaba#11153)
…12892) config query chain of responsibility model refactor
alibaba#12805) * The error message is not user-friendly when adding duplicate permissions. (alibaba#12273) * The error message is not user-friendly when adding duplicate permissions. (alibaba#12773) * add some unit test. * fix ci fail.
alibaba#12803) * The error message is not user-friendly when adding duplicate permissions. (alibaba#12773) * The error message is not user-friendly when adding duplicate permissions.(alibaba#12773)
…cilitate the extension and implementation of databases like Oracle. (alibaba#12343) * Improve the retrieval of ConfigInfoState to facilitate the extension and implementation of databases like Oracle. * Add unit tests for the SQL construction part of the `ExternalConfigInfoPersistServiceImpl#findConfigInfoState` method. * Enhance the construction of the delete statement in AbstractMapper by using a unified appendWhereClause method to construct the WHERE clause. Modify appendWhereClause to be protected, allowing for customization based on different database types, such as adjustments according to column names.
… use UTF-8 encoding for md5 fields. Utilize the SPI mechanism in related pathways and methods to ensure extensibility for support of other types of encoding. Fix test.
…p-issue#12872 # Conflicts: # config/src/main/java/com/alibaba/nacos/config/server/controller/ConfigServletInner.java # config/src/main/java/com/alibaba/nacos/config/server/remote/ConfigQueryRequestHandler.java # config/src/test/java/com/alibaba/nacos/config/server/controller/ConfigServletInnerTest.java
Please do not create a Pull Request without creating an issue first.
What is the purpose of the change
Refactor ConfigCache and related pathways ,uniformly use UTF-8 encoding for md5 fields. Utilize the SPI mechanism in related pathways and methods to ensure extensibility for support of other types of encoding. Fix test.
Brief changelog
Create the ConfigCacheFactory interface to handle the creation of ConfigCache instances.
Create the Md5PostProcessor interface to handle the md5 dump of ConfigCache.
Create the Md5Comparator interface.
Utilize the SPI (Service Provider Interface) mechanism in related pathways and methods to ensure extensibility for support of other types of encoding, and implement the default handling methods for UTF-8 encoded md5 values.
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily:
[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.