Skip to content

Commit 295a12b

Browse files
moremindAias00
andauthored
[type:refactor] remove shenyu trie cache (#6303)
* [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache * [type:refactor] remove trie cache --------- Co-authored-by: aias00 <liuhongyu@apache.org>
1 parent 5c2c3ed commit 295a12b

29 files changed

Lines changed: 19 additions & 2661 deletions

File tree

shenyu-bootstrap/src/main/resources/application.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,12 @@ shenyu:
8787
enabled: false
8888
initialCapacity: 10000 # initial capacity in cache
8989
maximumSize: 10000 # max size in cache
90-
## selector L2 cache, use trie as L2 cache
91-
trie:
92-
enabled: false
93-
cacheSize: 128 # the number of plug-ins
94-
matchMode: antPathMatch
9590
ruleMatchCache:
9691
## rule L1 cache
9792
cache:
9893
enabled: false
9994
initialCapacity: 10000 # initial capacity in cache
10095
maximumSize: 65536 # max size in cache
101-
## rule L2 cache, use trie as L2 cache
102-
trie:
103-
enabled: false
104-
cacheSize: 1024 # the number of selectors
105-
matchMode: antPathMatch
10696
netty:
10797
http:
10898
# set to false, user can custom the netty tcp server config.

shenyu-common/src/main/java/org/apache/shenyu/common/config/ShenyuConfig.java

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.apache.commons.lang3.StringUtils;
2121
import org.apache.shenyu.common.concurrent.MemoryLimitCalculator;
2222
import org.apache.shenyu.common.constant.Constants;
23-
import org.apache.shenyu.common.enums.TrieMatchModeEnum;
2423

2524
import java.util.ArrayList;
2625
import java.util.HashSet;
@@ -614,11 +613,6 @@ public static class SelectorMatchCache {
614613
private MatchCacheConfig cache = new MatchCacheConfig();
615614

616615
/**
617-
* the trie cache, L2 cache.
618-
*/
619-
private ShenyuTrieConfig trie = new ShenyuTrieConfig();
620-
621-
/**
622616
* get selector cache config.
623617
*
624618
* @return {@linkplain MatchCacheConfig}
@@ -635,24 +629,6 @@ public MatchCacheConfig getCache() {
635629
public void setCache(final MatchCacheConfig cache) {
636630
this.cache = cache;
637631
}
638-
639-
/**
640-
* get rule cache Config.
641-
*
642-
* @return rule cache config
643-
*/
644-
public ShenyuTrieConfig getTrie() {
645-
return trie;
646-
}
647-
648-
/**
649-
* set rule cache config.
650-
*
651-
* @param trie rule cache
652-
*/
653-
public void setTrie(final ShenyuTrieConfig trie) {
654-
this.trie = trie;
655-
}
656632
}
657633

658634
public static class RuleMatchCache {
@@ -662,11 +638,6 @@ public static class RuleMatchCache {
662638
*/
663639
private MatchCacheConfig cache = new MatchCacheConfig();
664640

665-
/**
666-
* the trie cache, L2 cache.
667-
*/
668-
private ShenyuTrieConfig trie = new ShenyuTrieConfig();
669-
670641
/**
671642
* get selector cache config.
672643
*
@@ -684,24 +655,6 @@ public MatchCacheConfig getCache() {
684655
public void setCache(final MatchCacheConfig cache) {
685656
this.cache = cache;
686657
}
687-
688-
/**
689-
* get rule cache Config.
690-
*
691-
* @return rule cache config
692-
*/
693-
public ShenyuTrieConfig getTrie() {
694-
return trie;
695-
}
696-
697-
/**
698-
* set rule cache config.
699-
*
700-
* @param trie rule cache
701-
*/
702-
public void setTrie(final ShenyuTrieConfig trie) {
703-
this.trie = trie;
704-
}
705658
}
706659

707660
/**
@@ -1991,70 +1944,7 @@ public void setProps(final Properties props) {
19911944
}
19921945
}
19931946

1994-
/**
1995-
* shenyu trie config.
1996-
*/
1997-
public static class ShenyuTrieConfig {
1998-
1999-
private Boolean enabled = Boolean.FALSE;
2000-
2001-
private Long cacheSize = 512L;
20021947

2003-
/**
2004-
* match mode.
2005-
* @see TrieMatchModeEnum
2006-
*/
2007-
private String matchMode = TrieMatchModeEnum.ANT_PATH_MATCH.getMatchMode();
2008-
2009-
/**
2010-
* get match enabled.
2011-
* @return Boolean
2012-
*/
2013-
public Boolean getEnabled() {
2014-
return enabled;
2015-
}
2016-
2017-
/**
2018-
* set match enabled.
2019-
* @param enabled enabled
2020-
*/
2021-
public void setEnabled(final Boolean enabled) {
2022-
this.enabled = enabled;
2023-
}
2024-
2025-
/**
2026-
* get cache size.
2027-
* @return cache size
2028-
*/
2029-
public Long getCacheSize() {
2030-
return cacheSize;
2031-
}
2032-
2033-
/**
2034-
* set cache size.
2035-
* @param cacheSize cache size
2036-
*/
2037-
public void setCacheSize(final Long cacheSize) {
2038-
this.cacheSize = cacheSize;
2039-
}
2040-
2041-
/**
2042-
* get match mode.
2043-
* @return match mode
2044-
*/
2045-
public String getMatchMode() {
2046-
return matchMode;
2047-
}
2048-
2049-
/**
2050-
* set match mode.
2051-
* @param matchMode match mode
2052-
*/
2053-
public void setMatchMode(final String matchMode) {
2054-
this.matchMode = matchMode;
2055-
}
2056-
}
2057-
20581948
public static class SpringCloudCacheConfig {
20591949
private Boolean enabled = Boolean.FALSE;
20601950

shenyu-common/src/main/java/org/apache/shenyu/common/enums/TrieCacheTypeEnum.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

shenyu-common/src/main/java/org/apache/shenyu/common/enums/TrieEventEnum.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

shenyu-common/src/main/java/org/apache/shenyu/common/enums/TrieMatchModeEnum.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

shenyu-common/src/test/java/org/apache/shenyu/common/enums/TrieEventEnumTest.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)