public class ShenyuTrie
extends java.lang.Object
| 构造器和说明 |
|---|
ShenyuTrie(java.lang.Long cacheSize,
java.lang.String matchMode) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
clear the trie.
|
java.util.Set<java.lang.String> |
getKeyRootKeys()
get key root map key set.
|
ShenyuTrieNode |
getNode(java.lang.String uriPath,
java.lang.String bizInfo)
getNode.
|
boolean |
isEmpty()
judge the trie is empty.
|
ShenyuTrieNode |
match(java.lang.String uriPath,
java.lang.String bizInfo)
match trie, trie exist and match the path will return current node
match strategy: plugin get the node from trie and mark conflict, match sort: path, wildcard, match-all, path variable. |
<T> void |
putNode(java.util.List<java.lang.String> uriPaths,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
put node to trie.
|
<T> void |
putNode(java.lang.String uriPath,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
put node to trie, shenyu trie support *, **, path, pathVariable parameters.
|
<T> void |
remove(java.util.List<java.lang.String> paths,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
remove trie node.
|
<T> void |
remove(java.lang.String path,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
remove trie node.
|
void |
removeByKey(java.lang.String key)
remove trie cache by key.
|
public void clear()
public boolean isEmpty()
public <T> void putNode(java.util.List<java.lang.String> uriPaths,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
T - the data typeuriPaths - uri pathsource - datacacheType - cache typepublic <T> void putNode(java.lang.String uriPath,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
* means match 0 or more character
** means match 0 or more dictory directory
pathVariable maybe like {name}
T - biz info typeuriPath - uri pathsource - rule data or selector datacacheType - cache typeAntPathMatcher,
PathPatternpublic ShenyuTrieNode match(java.lang.String uriPath, java.lang.String bizInfo)
uriPath - uri pathbizInfo - bizInfopublic <T> void remove(java.util.List<java.lang.String> paths,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
T - selector data or rule datapaths - path listsource - source datacacheType - cache typepublic <T> void remove(java.lang.String path,
T source,
org.apache.shenyu.common.enums.TrieCacheTypeEnum cacheType)
query node of the current path, if the node exists and the node exist the value of pathCache, delete a rule with the same ruleId from pathCache or delete a selector by pluginName.
if current source data list is empty, children and pathVariablesSet is null,remove concurrent node from parent node.
T - selector data or rule datapath - pathsource - source datacacheType - cache typepublic void removeByKey(java.lang.String key)
key - keypublic ShenyuTrieNode getNode(java.lang.String uriPath, java.lang.String bizInfo)
uriPath - uriPathbizInfo - sourceShenyuTrieNodepublic java.util.Set<java.lang.String> getKeyRootKeys()
Copyright © 2026 The Apache Software Foundation. All rights reserved.