carp84 commented on a change in pull request #8930: [FLINK-12955] HBase
LookupableTableSource
URL: https://github.com/apache/flink/pull/8930#discussion_r300952482
##########
File path:
flink-connectors/flink-hbase/src/main/java/org/apache/flink/addons/hbase/HBaseTableSchema.java
##########
@@ -179,8 +185,57 @@ 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 (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()));
+ }
+ }
+ return qualifierList;
+ }
+
+ /**
+ * Adds a column defined by family, qualifier, and type to the table
schema.
+ *
+ * @param family the family name
+ * @param qualifier the qualifier name
+ * @param type the data type info of the qualifier
+ */
+ public void addColumn(String family, String qualifier,
TypeInformation<?> type) {
Review comment:
Change the method visibility to package-private
----------------------------------------------------------------
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