metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cestella <...@git.apache.org>
Subject [GitHub] metron pull request #824: METRON-1289: Alert fields are lost when a MetaAler...
Date Tue, 14 Nov 2017 23:26:27 GMT
Github user cestella commented on a diff in the pull request:

    https://github.com/apache/metron/pull/824#discussion_r150994812
  
    --- Diff: metron-platform/metron-indexing/src/main/java/org/apache/metron/indexing/dao/HBaseDao.java
---
    @@ -138,9 +142,17 @@ private Document getDocumentFromResult(Result result) throws IOException
{
         Map.Entry<byte[], byte[]> entry= columns.lastEntry();
         Long ts = Bytes.toLong(entry.getKey());
         if(entry.getValue()!= null) {
    -      Map<String, Object> json = JSONUtils.INSTANCE.load(new String(entry.getValue()),
new TypeReference<Map<String, Object>>() {
    -      });
    -      return new Document(json, Bytes.toString(result.getRow()), (String) json.get(SOURCE_TYPE),
ts);
    +      Map<String, Object> json = JSONUtils.INSTANCE.load(new String(entry.getValue()),
    +          new TypeReference<Map<String, Object>>() {});
    +      ByteArrayInputStream baos = new ByteArrayInputStream(result.getRow());
    --- End diff --
    
    Can we pull this out into a `readRowKey()` method, like we have a `buildRowKey()`?


---

Mime
View raw message