Github user justinleet commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/286#discussion_r81340588
  
    --- Diff: 
metron-platform/metron-writer/src/main/java/org/apache/metron/writer/WriterToBulkWriter.java
 ---
    @@ -44,11 +45,15 @@ public void init(Map stormConf, WriterConfiguration 
config) throws Exception {
       }
     
       @Override
    -  public void write(String sensorType, WriterConfiguration configurations, 
Iterable<Tuple> tuples, List<MESSAGE_T> messages) throws Exception {
    +  public BulkWriterResponse write(String sensorType, WriterConfiguration 
configurations, Iterable<Tuple> tuples, List<MESSAGE_T> messages) throws 
Exception {
         if(messages.size() > 1) {
           throw new IllegalStateException("WriterToBulkWriter expects a batch 
of exactly 1");
         }
         messageWriter.write(sensorType, configurations, 
Iterables.getFirst(tuples, null), Iterables.getFirst(messages, null));
    +
    +    BulkWriterResponse response = new BulkWriterResponse();
    --- End diff --
    
    Right now, the Exception handling path is slightly different from the main 
path, and would just treat everything as failures, regardless. The 
BulkWriterComponent catches exceptions and uses its complete list to mark 
everything as failed regardless of what the response is.  
    
    The write() method interface does note in the comments that an exception 
should be treated as a full batch failure, but it could pretty easily be 
modified to catch the exception, mark failures and kick it back up that way. I 
left it as-is, because that matches current behavior exactly.  At that point, 
I'd want to do the same thing for all the implementations (hbase, etc.)


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to