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

 ##########
 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:
   What were you thinking? I had considered what to do about this. One option 
was simply putting this in its own class only useable by the coprocessor, but I 
felt like that might be a bit too heavy handed and redundant. Adding an 
aggressive note was where I landed as a hopefully reasonable compromise, but 
I'm definitely open to suggestions.

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