Package com.linkedin.venice.utils
Class TrieBasedPathResourceRegistry<T>
java.lang.Object
com.linkedin.venice.utils.TrieBasedPathResourceRegistry<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
PathResourceRegistry<T>
This class implements a generic trie-based lookup tree.
One feature in this implementation is to support wildcard match,
right now, it only supports '*' to match any paths.
You can register the following path patterns, which can be associate w/o wildcard:
/a/b\/*\/* => resource1
/a/b\/* => resource2
/a/b/c => resource3
You will get following results when do lookup:
/a/b/c/d => resource1
/a/b/ccc/eee => resource1
/a/b/c => resource3
/a/b/d => resource2
/aa/ => null
The operations support here:
1. Register paths w/o wildcard associated with resources;
2. Unregister paths;
3. Lookup/Match, by default it enables wildcard matching logic;
3.1 Exact match is preferable to wildcard match for a given path;
3.2 '*' is used to match any single level path;
-
Field Summary
Fields inherited from interface com.linkedin.venice.utils.PathResourceRegistry
WILDCARD_MATCH_ANY
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
TrieBasedPathResourceRegistry
public TrieBasedPathResourceRegistry()
-
-
Method Details
-
register
- Specified by:
register
in interfacePathResourceRegistry<T>
-
unregister
- Specified by:
unregister
in interfacePathResourceRegistry<T>
-
find
- Specified by:
find
in interfacePathResourceRegistry<T>
-