kadirozde commented on code in PR #1855:
URL: https://github.com/apache/phoenix/pull/1855#discussion_r1546603419


##########
phoenix-core/src/main/java/org/apache/phoenix/util/matcher/RowKeyMatcher.java:
##########
@@ -0,0 +1,144 @@
+package org.apache.phoenix.util.matcher;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.locks.StampedLock;
+
+/**
+ * This class holds the index, mapping row-key matcher patterns to tableIds.
+ * Assumes byte[] are UTF-8 encoded.
+ * This class is thread safe.
+ */
+public class RowKeyMatcher {
+       private static final Logger LOGGER = 
LoggerFactory.getLogger(RowKeyMatcher.class);
+
+       public static final int R = 256;
+       private TrieNode root = new TrieNode();

Review Comment:
   The trie data structure implemented here is not efficient in terms of space 
and time. We should be using a compressed trie data structure. I suggest using 
PATRICIA, please see 
https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/trie/PatriciaTrie.html



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to