carp84 commented on a change in pull request #8930: [FLINK-12955] HBase 
LookupableTableSource
URL: https://github.com/apache/flink/pull/8930#discussion_r298978989
 
 

 ##########
 File path: 
flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/HBaseTableSchema.java
 ##########
 @@ -179,8 +185,58 @@ void setCharset(String charset) {
         *
         * @return The charset for value strings and HBase identifiers.
         */
-       String getStringCharset() {
+       public String getStringCharset() {
                return this.charset;
        }
 
+       /**
+        * A helper method returns a flat qualifiers list in defining order.
+        * Qualifier info is a Tuple3 representation:
+        * (byte[] columnFamily, byte[] qualifier, TypeInformation typeInfo)
+        */
+       public List<Tuple3<byte[], byte[], TypeInformation<?>>> 
getFlatByteQualifiers() {
+               List<Tuple3<byte[], byte[], TypeInformation<?>>> qualifierList 
= new ArrayList<>();
+
+               for (String family : getFamilyNames()) {
 
 Review comment:
   Here we could reduce some loops, like below:
   ```
                for (Map.Entry<String, Map<String, TypeInformation<?>>> entry : 
familyMap.entrySet()) {
                        byte[] columnBytes = Bytes.toBytes(entry.getKey());
                        Map<String, TypeInformation<?>> qualifiers = 
entry.getValue();
                        for (Map.Entry<String, TypeInformation<?>> qEntry : 
qualifiers.entrySet()) {
                                qualifierList.add(new Tuple3<>(columnBytes, 
Bytes.toBytes(qEntry.getKey()), qEntry.getValue()));
                        }
                }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to