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 #188: METRON-227 (Time based flushing)
Date Wed, 13 Jul 2016 20:40:39 GMT
Github user cestella commented on a diff in the pull request:

    https://github.com/apache/incubator-metron/pull/188#discussion_r70704088
  
    --- Diff: metron-platform/metron-common/src/main/java/org/apache/metron/common/writer/BulkWriterComponent.java
---
    @@ -34,21 +34,37 @@
     import java.util.function.Function;
     
     public class BulkWriterComponent<MESSAGE_T> {
    -  public static final Logger LOG = LoggerFactory
    -            .getLogger(BulkWriterComponent.class);
    +  public static final Logger LOG = LoggerFactory.getLogger(BulkWriterComponent.class);
       private Map<String, Collection<Tuple>> sensorTupleMap = new HashMap<>();
       private Map<String, List<MESSAGE_T>> sensorMessageMap = new HashMap<>();
       private OutputCollector collector;
       private boolean handleCommit = true;
       private boolean handleError = true;
    +  private Long lastFlushTime;
    +  private Long flushIntervalInMs;
    +  private boolean flush = false;
    +
    +
       public BulkWriterComponent(OutputCollector collector) {
         this.collector = collector;
    +    this.lastFlushTime = System.currentTimeMillis();
    +    this.flush = false;
       }
     
       public BulkWriterComponent(OutputCollector collector, boolean handleCommit, boolean
handleError) {
         this(collector);
         this.handleCommit = handleCommit;
         this.handleError = handleError;
    +    this.lastFlushTime = System.currentTimeMillis();
    --- End diff --
    
    These guys aren't necessary because you're calling the constructor on line 55 which sets
them.


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