[ 
https://issues.apache.org/jira/browse/EAGLE-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15416372#comment-15416372
 ] 

ASF GitHub Bot commented on EAGLE-440:
--------------------------------------

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

    https://github.com/apache/incubator-eagle/pull/324#discussion_r74361599
  
    --- Diff: 
eagle-core/eagle-alert-parent/eagle-alert/alert-metadata-parent/alert-metadata/src/main/java/org/apache/eagle/alert/metadata/impl/MongoMetadataDaoImpl.java
 ---
    @@ -285,6 +318,21 @@ public OpResult removePublishmentType(String pubType) {
             return remove(publishmentType, pubType);
         }
     
    +    private <T> OpResult addOne(MongoCollection<Document> collection, T t) 
{
    +        OpResult result = new OpResult();
    +        try {
    +            String json = mapper.writeValueAsString(t);
    +            collection.insertOne(Document.parse(json));
    +            result.code = 200;
    +            result.message = "add state succeed!";
    +        } catch (Exception e) {
    +            result.code = 400;
    +            result.message = e.getMessage();
    +            LOG.error("", e);
    --- End diff --
    
    better to have meaningful message


> Alert mongodb storage refine
> ----------------------------
>
>                 Key: EAGLE-440
>                 URL: https://issues.apache.org/jira/browse/EAGLE-440
>             Project: Eagle
>          Issue Type: Improvement
>            Reporter: Zeng, Bryant
>            Assignee: Zeng, Bryant
>
> Currently, some Alert Mongo Collection is too large. Consider future 
> increase, need to split large collection to some small collections.
> To back compatible, need to keep the interface as the same as before. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to