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>
public class TrieBasedPathResourceRegistry<T> extends java.lang.Object implements 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
Constructors Constructor Description TrieBasedPathResourceRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
find(java.lang.String path)
void
register(java.lang.String path, T resource)
void
unregister(java.lang.String path)
-
-
-
Method Detail
-
register
public void register(java.lang.String path, T resource)
- Specified by:
register
in interfacePathResourceRegistry<T>
-
unregister
public void unregister(java.lang.String path)
- Specified by:
unregister
in interfacePathResourceRegistry<T>
-
find
public T find(java.lang.String path)
- Specified by:
find
in interfacePathResourceRegistry<T>
-
-