metron-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cestella <...@git.apache.org>
Subject [GitHub] incubator-metron pull request #486: METRON-793: Migrate to storm-kafka-clien...
Date Thu, 23 Mar 2017 14:30:09 GMT
Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/486#discussion_r107682535
  
    --- Diff: metron-platform/metron-pcap-backend/src/main/java/org/apache/metron/spout/pcap/HDFSWriterCallback.java
---
    @@ -96,16 +109,18 @@ public HDFSWriterCallback withConfig(HDFSWriterConfig config) {
             this.config = config;
             return this;
         }
    +
         @Override
         public List<Object> apply(List<Object> tuple, EmitContext context) {
    -
    -        List<Object> keyValue = (List<Object>) tuple.get(0);
    -        LongWritable ts = (LongWritable) keyValue.get(0);
    -        BytesWritable rawPacket = (BytesWritable)keyValue.get(1);
    +        byte[] key = (byte[]) tuple.get(0);
    +        byte[] value = (byte[]) tuple.get(1);
    +        if(!config.getDeserializer().deserializeKeyValue(key, value, KeyValue.key.get(),
KeyValue.value.get())) {
    +            LOG.debug("Dropping malformed packet...");
    --- End diff --
    
    I could, but, of course, they're raw bytes and the value could be rather big.  How about
I compromise and make this a bit more helpful by including:
    * Their lengths
    * The key itself in hex


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message