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

    https://github.com/apache/incubator-metron/pull/491#discussion_r108192355
  
    --- Diff: 
metron-interface/metron-rest/src/test/java/org/apache/metron/rest/controller/KafkaControllerIntegrationTest.java
 ---
    @@ -54,135 +58,165 @@
     @ActiveProfiles(TEST_PROFILE)
     public class KafkaControllerIntegrationTest {
     
    -    @Autowired
    -    private KafkaComponent kafkaWithZKComponent;
    -
    -    class SampleDataRunner implements Runnable {
    -
    -        private boolean stop = false;
    -        private String path = 
"../../metron-platform/metron-integration-test/src/main/sample/data/bro/raw/BroExampleOutput";
    -
    -        @Override
    -        public void run() {
    -            SampleDataGenerator broSampleDataGenerator = new 
SampleDataGenerator();
    -            
broSampleDataGenerator.setBrokerUrl(kafkaWithZKComponent.getBrokerList());
    -            broSampleDataGenerator.setNum(1);
    -            broSampleDataGenerator.setSelectedSensorType("bro");
    -            broSampleDataGenerator.setDelay(0);
    -            try {
    -                while(!stop) {
    -                    broSampleDataGenerator.generateSampleData(path);
    -                }
    -            } catch (IOException e) {
    -                e.printStackTrace();
    -            } catch (ParseException e) {
    -                e.printStackTrace();
    -            }
    -        }
    -
    -        public void stop() {
    -            stop = true;
    +  private static final int KAFKA_RETRY = 10;
    +  @Autowired
    +  private KafkaComponent kafkaWithZKComponent;
    +
    +  class SampleDataRunner implements Runnable {
    +
    +    private boolean stop = false;
    +    private String path = 
"../../metron-platform/metron-integration-test/src/main/sample/data/bro/raw/BroExampleOutput";
    +
    +    @Override
    +    public void run() {
    +      SampleDataGenerator broSampleDataGenerator = new 
SampleDataGenerator();
    +      
broSampleDataGenerator.setBrokerUrl(kafkaWithZKComponent.getBrokerList());
    +      broSampleDataGenerator.setNum(1);
    +      broSampleDataGenerator.setSelectedSensorType("bro");
    +      broSampleDataGenerator.setDelay(0);
    +      try {
    +        while(!stop) {
    +          broSampleDataGenerator.generateSampleData(path);
             }
    +      } catch (IOException e) {
    --- End diff --
    
    Good catch, absolutely.  Thanks!


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to