You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@eagle.apache.org by coheigea <gi...@git.apache.org> on 2018/01/24 12:29:26 UTC

[GitHub] eagle pull request #978: EAGLE-1075 - Can't specify configuration options fo...

GitHub user coheigea opened a pull request:

    https://github.com/apache/eagle/pull/978

    EAGLE-1075 - Can't specify configuration options for AlertFilePublisher

    <!--
    {% comment %}
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to you under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    {% endcomment %}
    -->
    
    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
     - [ ] Make sure the PR title is formatted like:
       `[EAGLE-<Jira issue #>] Description of pull request`
     - [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
           Travis-CI on your fork and ensure the whole test matrix passes).
     - [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
           number, if there is one.
     - [ ] If this contribution is large, please file an Apache
           [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt).
    
    ---

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

    $ git pull https://github.com/coheigea/eagle EAGLE-1075

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

    https://github.com/apache/eagle/pull/978.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 #978
    
----
commit 1a217025af9080ada64104920e7c6bb434164e99
Author: Colm O hEigeartaigh <co...@...>
Date:   2018-01-24T12:28:09Z

    EAGLE-1075 - Can't specify configuration options for AlertFilePublisher

----


---

[GitHub] eagle pull request #978: EAGLE-1075 - Can't specify configuration options fo...

Posted by coheigea <gi...@git.apache.org>.
GitHub user coheigea reopened a pull request:

    https://github.com/apache/eagle/pull/978

    EAGLE-1075 - Can't specify configuration options for AlertFilePublisher

    <!--
    {% comment %}
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to you under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at
    
    http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    {% endcomment %}
    -->
    
    Be sure to do all of the following to help us incorporate your contribution
    quickly and easily:
    
     - [ ] Make sure the PR title is formatted like:
       `[EAGLE-<Jira issue #>] Description of pull request`
     - [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
           Travis-CI on your fork and ensure the whole test matrix passes).
     - [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
           number, if there is one.
     - [ ] If this contribution is large, please file an Apache
           [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.txt).
    
    ---

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

    $ git pull https://github.com/coheigea/eagle EAGLE-1075

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

    https://github.com/apache/eagle/pull/978.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 #978
    
----
commit fb3868a8532a6e3b40c305ddd3d317b3fc8e1a29
Author: Colm O hEigeartaigh <co...@...>
Date:   2018-01-31T15:15:57Z

    EAGLE-1075 - Can't specify configuration options for AlertFilePublisher

----


---

[GitHub] eagle pull request #978: EAGLE-1075 - Can't specify configuration options fo...

Posted by jhsenjaliya <gi...@git.apache.org>.
Github user jhsenjaliya commented on a diff in the pull request:

    https://github.com/apache/eagle/pull/978#discussion_r165162632
  
    --- Diff: eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertFilePublisher.java ---
    @@ -54,13 +54,26 @@ public void init(Config config, Publishment publishment, Map conf) throws Except
             int numOfFiles = DEFAULT_FILE_NUMBER;
             if (publishment.getProperties() != null) {
                 if (publishment.getProperties().containsKey(PublishConstants.FILE_NAME)) {
    -                fileName = (String) publishment.getProperties().get(PublishConstants.FILE_NAME);
    +                String property = (String) publishment.getProperties().get(PublishConstants.FILE_NAME);
    +                if (property != null && !"".equals(property)) {
    +                    fileName = property;
    +                }
                 }
                 if (publishment.getProperties().containsKey(PublishConstants.ROTATE_EVERY_KB)) {
    -                rotateSize = Integer.valueOf(publishment.getProperties().get(PublishConstants.ROTATE_EVERY_KB).toString());
    +                Object property = publishment.getProperties().get(PublishConstants.ROTATE_EVERY_KB);
    +                if (property instanceof Integer) {
    +                    rotateSize = (Integer)property;
    +                } else if (property instanceof String && !"".equals((String)property)) {
    --- End diff --
    
    could also check for null once its is instanceof string.


---

[GitHub] eagle pull request #978: EAGLE-1075 - Can't specify configuration options fo...

Posted by coheigea <gi...@git.apache.org>.
Github user coheigea closed the pull request at:

    https://github.com/apache/eagle/pull/978


---

[GitHub] eagle pull request #978: EAGLE-1075 - Can't specify configuration options fo...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/eagle/pull/978


---

[GitHub] eagle issue #978: EAGLE-1075 - Can't specify configuration options for Alert...

Posted by jhsenjaliya <gi...@git.apache.org>.
Github user jhsenjaliya commented on the issue:

    https://github.com/apache/eagle/pull/978
  
    +1, merging since its improved than earlier and more improvements can be later.  Thanks for the PR.


---