GitHub user merrimanr opened a pull request:

    https://github.com/apache/metron/pull/821

    METRON-1281: Remove hard-coded indices from the Alerts UI

    ## Contributor Comments
    This PR adjusts the Alerts UI and REST app to remove the need to hard-code 
the indices in the Alerts UI source code.  I felt like this feature could be 
kept simple by having the REST SearchService supply the appropriate indices by 
default because:
    
    - the front end code has no knowledge of when the list of available indices 
changes and would have to make an extra call on every search
    - the underlying ElasticsearchDao lives in a different module and does not 
have access to the SensorIndexingConfigService which is required to look up the 
available indices
    
    This resulted in an additional "index.writer.name" property because the 
indices lookup requires this information.  The "error" index doesn't make sense 
in an alert search context so it is excluded. 
     The "metaalert" index is added by default in anticipation of 
https://github.com/apache/metron/pull/803.
    
    A SearchServiceTest had not been created yet so it has been added with 
coverage for this PR.  An integration test for a query with default indices was 
also added.  While working on the integration tests I noticed an intermittent 
failure happening frequently so I fixed that in this PR to get the build to 
pass consistently (GlobalConfigControllerIntegrationTest.java).  I can revert 
that if desired but my thinking was it's probably not worth the overhead of a 
separate PR. 
    
    ## Pull Request Checklist
    
    Thank you for submitting a contribution to Apache Metron.  
    Please refer to our [Development 
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
 for the complete guide to follow for contributions.  
    Please refer also to our [Build Verification 
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
 for complete smoke testing guides.  
    
    
    In order to streamline the review of the contribution we ask you follow 
these guidelines and ask you to double check the following:
    
    ### For all changes:
    - [x] Is there a JIRA ticket associated with this PR? If not one needs to 
be created at [Metron 
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
 
    - [x] Does your PR title start with METRON-XXXX where XXXX is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
    - [x] Has your PR been rebased against the latest commit within the target 
branch (typically master)?
    
    
    ### For code changes:
    - [x] Have you included steps to reproduce the behavior or problem that is 
being changed or addressed?
    - [x] Have you included steps or a guide to how the change may be verified 
and tested manually?
    - [x] Have you ensured that the full suite of tests and checks have been 
executed in the root metron folder via:
      ```
      mvn -q clean integration-test install && build_utils/verify_licenses.sh 
      ```
    
    - [x] Have you written or updated unit tests and or integration tests to 
verify your changes?
    - [x] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)? 
    - [x] Have you verified the basic functionality of the build by building 
and running locally with Vagrant full-dev environment or the equivalent?
    
    ### For documentation related changes:
    - [x] Have you ensured that format looks appropriate for the output in 
which it is rendered by building and verifying the site-book? If not then run 
the following commands and the verify changes via 
`site-book/target/site/index.html`:
    
      ```
      cd site-book
      mvn site
      ```
    
    #### Note:
    Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.
    It is also recommended that [travis-ci](https://travis-ci.org) is set up 
for your personal repository such that your branches are built there before 
submitting a pull request.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/merrimanr/incubator-metron 
remove_hardcoded_indices

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/metron/pull/821.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #821
    
----
commit 0570ba18d773688bfc2d71e2f081155583c21a2e
Author: cstella <[email protected]>
Date:   2017-10-09T19:03:32Z

    Abstracting zookeeper substantially.

commit e59a82266c7cefb2a4fe6c033e9b14c2fe7c001b
Author: cstella <[email protected]>
Date:   2017-10-09T20:10:57Z

    Updating tests to use the new API.

commit 8d64f05f33bb248ae3306cb580ac589400887b81
Author: cstella <[email protected]>
Date:   2017-10-09T20:15:51Z

    Missed a couple of tests.

commit a195ae51e3c5a04079c2b401ae325bcf4e46c05e
Author: cstella <[email protected]>
Date:   2017-10-09T20:32:41Z

    moved the cache into commons.

commit 0932c30e9af4b75285c7003e722888e4a5675f9f
Author: cstella <[email protected]>
Date:   2017-10-09T21:15:20Z

    Updating test.

commit 7c05716ceb6db505ec323f7b04716df07399a05c
Author: cstella <[email protected]>
Date:   2017-10-09T23:41:44Z

    Refactored tests to mock the configurations cache

commit 8a295a271fe94995283e02b2b291f50ec2db30ef
Author: cstella <[email protected]>
Date:   2017-10-10T00:13:41Z

    fixing tests.

commit dd41e6ed9a28a3b30102aad76f5396c51cf540f4
Author: cstella <[email protected]>
Date:   2017-10-10T00:54:57Z

    Updating some weird bugs.

commit 24df486a0c0d254f14f298ba8fb09e14152a2bf8
Author: cstella <[email protected]>
Date:   2017-10-10T01:47:05Z

    updating config test.

commit e6d48efd03bd848ca4eefd11c4277b2148550330
Author: cstella <[email protected]>
Date:   2017-10-10T02:42:48Z

    Updating log4j properties to debug travis.

commit 3e320d63512a860f571ee3fc0a8b41fa98b7558d
Author: cstella <[email protected]>
Date:   2017-10-10T02:59:00Z

    updating with better logging

commit 09019a52a4c689cdb71b512643c6f381dec114cf
Author: cstella <[email protected]>
Date:   2017-10-10T03:17:20Z

    reducing logging.

commit 9948df08bd2dc7a11e10bf800fe71427ba482b44
Author: cstella <[email protected]>
Date:   2017-10-10T03:41:32Z

    Removing debugging

commit 9134b81a5e1d5200e698131b0f66fc3ea015c56b
Author: cstella <[email protected]>
Date:   2017-10-10T03:45:41Z

    Better error debugging...

commit bbe87c5f1e29cb362f0dac90eb33f537285c1b27
Author: cstella <[email protected]>
Date:   2017-10-10T03:47:21Z

    Warn level.

commit 105127ed32003f0defdc7a7bed1f7357a69128ab
Author: cstella <[email protected]>
Date:   2017-10-10T03:55:34Z

    Small error in getTypes()

commit 475853cb72ab891ead4a360ca37c0e53035ba183
Author: cstella <[email protected]>
Date:   2017-10-10T04:36:11Z

    Updating configurations util

commit a0ce71be196b6c8c068a2f4ee4697af5a4e8d0f1
Author: cstella <[email protected]>
Date:   2017-10-10T04:45:35Z

    Updating integration tests.

commit c3c3c36e664c9e9216e04c72a06005a37d2a2652
Author: cstella <[email protected]>
Date:   2017-10-10T06:21:18Z

    Fixing tests.

commit a13c24a8daaf303704dc1313387b04f415cb236f
Author: cstella <[email protected]>
Date:   2017-10-10T14:54:59Z

    Updating infrastructure to be more spring-friendly.

commit 316eb5e24f6e46cd7d4364532834a460eeeac898
Author: cstella <[email protected]>
Date:   2017-10-10T15:45:56Z

    Fixed test.

commit e476cbaf5600f9428edffb25cd570eea90c8d957
Author: cstella <[email protected]>
Date:   2017-10-10T16:16:45Z

    Updating test to not be so chatty.

commit 0cb5bbcdfe1e17212620c752c200b78fe7ca6106
Author: cstella <[email protected]>
Date:   2017-10-10T20:48:00Z

    Found another classpath bug...

commit 8afa6c40733a2b53fb1d7a39264bc43ab9fb43a5
Author: cstella <[email protected]>
Date:   2017-10-10T22:13:09Z

    Add a rest endpoint that returns the list of indices based on zookeeper 
configs.

commit b3f1fb8d37430c2a6d306817ee5c8832ce9054cc
Author: cstella <[email protected]>
Date:   2017-10-10T22:26:31Z

    Updating functionality to take into account whether the index is enabled or 
disabled

commit 2eb9d69f53cc4897a5112b89d9269dd40544d875
Author: cstella <[email protected]>
Date:   2017-10-10T22:37:25Z

    Refactoring to handle some asynchronicity

commit 8a8012a5c7db4d9672ea3e02cdbd548433986cb2
Author: cstella <[email protected]>
Date:   2017-10-10T22:37:43Z

    Merge branch 'zookeeper_refactor' into all_indices

commit ddbd409acc19becf0bd5b193dcb602c273dade40
Author: cstella <[email protected]>
Date:   2017-10-11T13:34:28Z

    Asynchronicity leads to some unit test drama.  We now need to retry to get 
the right return code.

commit a0dba7ebd2941b07149c12bcfe567dcd8e8de39e
Author: cstella <[email protected]>
Date:   2017-10-11T13:50:23Z

    Merge branch 'zookeeper_refactor' into all_indices

commit 1968f392873ab57a3556d3f1bfbf7a57145806af
Author: cstella <[email protected]>
Date:   2017-10-11T15:04:15Z

    Longer time for retries.

----


---

Reply via email to