Merge branch 'master' into feature/METRON-1416-upgrade-solr

Project: http://git-wip-us.apache.org/repos/asf/metron/repo
Commit: http://git-wip-us.apache.org/repos/asf/metron/commit/e0fc4758
Tree: http://git-wip-us.apache.org/repos/asf/metron/tree/e0fc4758
Diff: http://git-wip-us.apache.org/repos/asf/metron/diff/e0fc4758

Branch: refs/heads/feature/METRON-1416-upgrade-solr
Commit: e0fc47582e65e9daf1a0c85dc1b1657166ff14f5
Parents: 1767727 622d50a
Author: justinjleet <justinjl...@gmail.com>
Authored: Tue Jun 26 15:34:09 2018 -0400
Committer: justinjleet <justinjl...@gmail.com>
Committed: Tue Jun 26 16:07:29 2018 -0400

----------------------------------------------------------------------
 .../configuration/metron-enrichment-env.xml     |   12 +
 .../configuration/metron-profiler-env.xml       |   12 +
 .../CURRENT/package/scripts/metron_service.py   |   20 +
 .../package/scripts/params/params_linux.py      |    4 +
 .../METRON/CURRENT/themes/metron_theme.json     |   41 +-
 metron-interface/metron-alerts/README.md        |   19 +-
 .../e2e/alert-details/alert-details.po.ts       |   67 +-
 .../alert-details-status.e2e-spec.ts            |  168 +-
 .../alert-filters/alert-filters.e2e-spec.ts     |   78 +-
 .../alert-filters/alert-filters.po.ts           |   31 +-
 .../alert-status/alerts-list-status.e2e-spec.ts |  125 +-
 .../e2e/alerts-list/alerts-list.e2e-spec.ts     |  369 +-
 .../e2e/alerts-list/alerts-list.po.ts           |  308 +-
 .../configure-table/configure-table.e2e-spec.ts |   62 +-
 .../meta-alerts/meta-alert.e2e-spec.ts          |  248 +-
 .../alerts-list/meta-alerts/meta-alert.po.ts    |   21 +-
 .../save-search/save-search.e2e-spec.ts         |   93 +-
 .../alerts-list/tree-view/tree-view.e2e-spec.ts |  208 +-
 .../e2e/alerts-list/tree-view/tree-view.po.ts   |  170 +-
 .../metron-alerts/e2e/login/login.e2e-spec.ts   |   36 +-
 .../metron-alerts/e2e/login/login.po.ts         |   44 +-
 .../e2e/utils/clean_metron_update_table.ts      |   52 +
 .../metron-alerts/e2e/utils/e2e_util.ts         |  223 +-
 .../metron-alerts/package-lock.json             | 6163 +++++++++++++++---
 metron-interface/metron-alerts/package.json     |    8 +-
 .../metron-alerts/protractor.conf.js            |   31 +-
 .../alert-details/alert-details.component.ts    |   49 +-
 .../alert-filters/alert-filters.component.ts    |    2 +-
 .../alerts-list/alerts-list.component.html      |    8 +-
 .../alerts-list/alerts-list.component.scss      |    3 +-
 .../alerts/alerts-list/alerts-list.component.ts |    4 +-
 .../tree-view/tree-view.component.html          |    4 +-
 .../configure-rows/configure-rows.component.ts  |    2 +-
 .../saved-searches.component.html               |    4 +-
 .../app/shared/group-by/group-by.component.html |    2 +-
 .../shared/time-range/time-range.component.html |   12 +-
 .../shared/time-range/time-range.component.scss |    4 +
 .../metron-alerts/src/app/utils/constants.ts    |    1 +
 .../src/environments/environment.e2e.ts         |    3 +-
 .../src/environments/environment.js             |    6 +-
 .../src/environments/environment.prod.ts        |    3 +-
 .../src/environments/environment.ts             |    3 +-
 metron-interface/metron-alerts/src/index.html   |    2 +-
 metron-interface/metron-alerts/src/styles.scss  |   10 +
 44 files changed, 6761 insertions(+), 1974 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_service.py
----------------------------------------------------------------------
diff --cc 
metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_service.py
index 58d581f,e3e48ab..9d15e93
--- 
a/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_service.py
+++ 
b/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/metron_service.py
@@@ -148,15 -119,29 +148,35 @@@ def build_global_config_patch(params, p
          "op": "add",
          "path": "/threat.triage.score.field",
          "value": "{{threat_triage_score_field}}"
+     },
+     {
+         "op": "add",
+         "path": "/enrichment.writer.batchSize",
+         "value": "{{enrichment_kafka_writer_batch_size}}"
+     },
+     {
+         "op": "add",
+         "path": "/enrichment.writer.batchTimeout",
+         "value": "{{enrichment_kafka_writer_batch_timeout}}"
+     },
+     {
+         "op": "add",
+         "path": "/profiler.writer.batchSize",
+         "value": "{{profiler_kafka_writer_batch_size}}"
+     },
+     {
+         "op": "add",
+         "path": "/profiler.writer.batchTimeout",
+         "value": "{{profiler_kafka_writer_batch_timeout}}"
      }
 -  ]
    """
 +  patch_template = ambari_format(
 +  """
 +  [
 +    {indexing_patches},
 +    {other_patches}
 +  ]
 +  """)
    File(patch_file,
         content=InlineTemplate(patch_template),
         owner=params.metron_user,

http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/params_linux.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/themes/metron_theme.json
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-interface/metron-alerts/README.md
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.ts
----------------------------------------------------------------------
diff --cc 
metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.ts
index 39d47ac,efc7e84..e68a8e0
--- 
a/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.ts
+++ 
b/metron-interface/metron-alerts/src/app/alerts/alert-details/alert-details.component.ts
@@@ -15,10 -15,10 +15,10 @@@
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
--import { Component, OnInit } from '@angular/core';
--import {Router, ActivatedRoute} from '@angular/router';
++import {Component, OnInit} from '@angular/core';
++import {ActivatedRoute, Router} from '@angular/router';
  import * as moment from 'moment/moment';
--import {Observable, Subscription} from 'rxjs/Rx';
++import {Subscription} from 'rxjs/Rx';
  
  import {SearchService} from '../../service/search.service';
  import {UpdateService} from '../../service/update.service';
@@@ -30,14 -30,13 +30,13 @@@ import {Patch} from '../../model/patch'
  import {AlertComment} from './alert-comment';
  import {AuthenticationService} from '../../service/authentication.service';
  import {MetronDialogBox} from '../../shared/metron-dialog-box';
 -import {META_ALERTS_INDEX, META_ALERTS_SENSOR_TYPE} from 
'../../utils/constants';
 -import { GlobalConfigService } from '../../service/global-config.service';
 +import {CommentAddRemoveRequest} from 
"../../model/comment-add-remove-request";
 +import {META_ALERTS_SENSOR_TYPE} from '../../utils/constants';
- import { GlobalConfigService } from '../../service/global-config.service';
++import {GlobalConfigService} from '../../service/global-config.service';
  
  export enum AlertState {
    NEW, OPEN, ESCALATE, DISMISS, RESOLVE
  }
--
  export enum Tabs {
    DETAILS, COMMENTS
  }
@@@ -222,18 -221,18 +220,26 @@@ export class AlertDetailsComponent impl
    }
  
    onAddComment() {
+     let newComment = new AlertComment(this.alertCommentStr, 
this.authenticationService.getCurrentUserName(), new Date().getTime());
+     let alertComments = this.alertCommentsWrapper.map(alertsWrapper => 
alertsWrapper.alertComment);
+     alertComments.unshift(newComment);
+     this.setComments(alertComments);
 -    this.patchAlert(new Patch('add', '/comments', alertComments), () => {
 -      let previousComments = this.alertCommentsWrapper.map(alertsWrapper => 
alertsWrapper.alertComment)
 -              .filter(alertComment => alertComment !== newComment);
 -      this.setComments(previousComments);
 -    });
 +    let commentRequest = new CommentAddRemoveRequest();
 +    commentRequest.guid = this.alertSource.guid;
 +    commentRequest.comment = this.alertCommentStr;
 +    commentRequest.username = this.authenticationService.getCurrentUserName();
 +    commentRequest.timestamp = new Date().getTime();
 +    commentRequest.sensorType = this.alertSourceType;
-     this.updateService.addComment(commentRequest).subscribe( () => {
-       this.getData(true);
-     });
++    this.updateService.addComment(commentRequest).subscribe(
++        () => {},
++        () => {
++          let previousComments = this.alertCommentsWrapper.map(alertsWrapper 
=> alertsWrapper.alertComment)
++          .filter(alertComment => alertComment !== newComment);
++          this.setComments(previousComments);
++        });
    }
  
-   patchAlert(patch: Patch) {
+   patchAlert(patch: Patch, onPatchError) {
      let patchRequest = new PatchRequest();
      patchRequest.guid = this.alertSource.guid;
      patchRequest.index = this.alertIndex;
@@@ -255,18 -252,15 +259,23 @@@
  
      
this.metronDialogBox.showConfirmationMessage(commentText).subscribe(response => 
{
        if (response) {
+         let deletedCommentWrapper = this.alertCommentsWrapper.splice(index, 
1)[0];
 -        this.patchAlert(new Patch('add', '/comments', 
this.alertCommentsWrapper.map(alertsWrapper => alertsWrapper.alertComment)), () 
=> {
 -          // add the deleted comment back
 -          this.alertCommentsWrapper.unshift(deletedCommentWrapper);
 -          this.alertCommentsWrapper.sort((a, b) => b.alertComment.timestamp - 
a.alertComment.timestamp);
 -        });
 +        let commentRequest = new CommentAddRemoveRequest();
 +        commentRequest.guid = this.alertSource.guid;
 +        commentRequest.comment = 
this.alertCommentsWrapper[index].alertComment.comment;
 +        commentRequest.username = 
this.alertCommentsWrapper[index].alertComment.username;
 +        commentRequest.timestamp = 
this.alertCommentsWrapper[index].alertComment.timestamp;
 +        commentRequest.sensorType = this.alertSourceType;
-         this.updateService.removeComment(commentRequest).subscribe( () => {
-           this.getData(true);
-         });
++        this.updateService.removeComment(commentRequest).subscribe(
++            () => {
++              this.alertCommentsWrapper.map(alertsWrapper => 
alertsWrapper.alertComment)
++            },
++            () => {
++              // add the deleted comment back
++              this.alertCommentsWrapper.unshift(deletedCommentWrapper);
++              this.alertCommentsWrapper.sort((a, b) => 
b.alertComment.timestamp - a.alertComment.timestamp);
++            });
        }
      });
    }
  }
--
--

http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
----------------------------------------------------------------------
diff --cc 
metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
index 07f7015,c13b7d4..ca1bd50
--- 
a/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
+++ 
b/metron-interface/metron-alerts/src/app/alerts/alerts-list/alerts-list.component.ts
@@@ -36,10 -36,10 +36,10 @@@ import {AlertSearchDirective} from '../
  import {SearchResponse} from '../../model/search-response';
  import {ElasticsearchUtils} from '../../utils/elasticsearch-utils';
  import {Filter} from '../../model/filter';
- import {TIMESTAMP_FIELD_NAME, ALL_TIME} from '../../utils/constants';
+ import { TIMESTAMP_FIELD_NAME, ALL_TIME, POLLING_DEFAULT_STATE } from 
'../../utils/constants';
  import {TableViewComponent} from './table-view/table-view.component';
  import {Pagination} from '../../model/pagination';
 -import {META_ALERTS_SENSOR_TYPE, META_ALERTS_INDEX} from 
'../../utils/constants';
 +import {META_ALERTS_SENSOR_TYPE} from '../../utils/constants';
  import {MetaAlertService} from '../../service/meta-alert.service';
  import {Facets} from '../../model/facets';
  import { GlobalConfigService } from '../../service/global-config.service';

http://git-wip-us.apache.org/repos/asf/metron/blob/e0fc4758/metron-interface/metron-alerts/src/app/utils/constants.ts
----------------------------------------------------------------------

Reply via email to