metron-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [metron] merrimanr commented on a change in pull request #1365: Metron-2050: Automatically populate a list of enrichments from HBase
Date Fri, 05 Apr 2019 20:10:17 GMT
merrimanr commented on a change in pull request #1365: Metron-2050: Automatically populate
a list of enrichments from HBase
URL: https://github.com/apache/metron/pull/1365#discussion_r272728494
 
 

 ##########
 File path: metron-platform/metron-hbase/src/main/java/org/apache/metron/hbase/client/HBaseClient.java
 ##########
 @@ -302,4 +303,35 @@ private static String tableName(HTableInterface table) {
     }
     return tableName;
   }
+
+  /**
+   * Puts a record into the configured HBase table synchronously (not batched).
+   */
+  public void put(String rowKey, String columnFamily, String columnQualifier, String value)
+      throws IOException {
+    Put put = new Put(Bytes.toBytes(rowKey));
+    put.addColumn(Bytes.toBytes(columnFamily), Bytes.toBytes(columnQualifier),
+        Bytes.toBytes(value));
+    table.put(put);
+  }
+
+  /**
+   * Scans an entire table returning all row keys as a List of Strings.
+   *
+   * <p>
+   * <b>**WARNING**:</b> Do not use this method unless you're absolutely crystal
clear about the performance
+   * impact. Doing full table scans in HBase can adversely impact performance.
+   *
+   * @return List of all row keys as Strings for this table.
+   */
+  public List<String> readRecords() throws IOException {
 
 Review comment:
   Would it make sense to add some kind of configurable guard here or do you think a warning
is enough?  

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message