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_r273094589
 
 

 ##########
 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:
   I was thinking a configurable limit that would break out of the scan loop 
after a threshold is reached.  Looks like there would be more work involved 
though to pass in a config so I think a note is fine.

----------------------------------------------------------------
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