You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Vishanth <gi...@git.apache.org> on 2015/02/06 13:52:00 UTC

[GitHub] stratos pull request: Raising registry exception for adding autosc...

GitHub user Vishanth opened a pull request:

    https://github.com/apache/stratos/pull/215

    Raising registry exception for adding autoscaler policy and dep policy

    Raising registry exception  for persisting autoscaler policy and persisting deployment policy.

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

    $ git pull https://github.com/Vishanth/stratos master

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

    https://github.com/apache/stratos/pull/215.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 #215
    
----
commit 245b46a9ab5df184c840ec323b5c0442551c8d57
Author: Vishanth <vi...@gmail.com>
Date:   2015-02-06T12:43:59Z

    Raising registry exception for persisting autoscaler policy and persisting deployment policy

----


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

[GitHub] stratos pull request: Raising registry exception for adding autosc...

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

    https://github.com/apache/stratos/pull/215


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

[GitHub] stratos pull request: Raising registry exception for adding autosc...

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

    https://github.com/apache/stratos/pull/215#discussion_r25868253
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -118,19 +118,33 @@ private void persist(Object dataObj, String resourcePath) throws AutoScalerExcep
         }
     
         public void persistAutoscalerPolicy(AutoscalePolicy autoscalePolicy) {
    -        String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE + AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    -        persist(autoscalePolicy, resourcePath);
    -        if (log.isDebugEnabled()) {
    -            log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    -                    autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +        try {
    +            String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE +
    +                    AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    +
    +            persist(autoscalePolicy, resourcePath);
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    +                        autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +            }
    +        } catch (Exception e) {
    +            log.error((String.format("Unable to persist autoscaler policy [autoscaler-policy-id] %s",
    +                    autoscalePolicy.getId())), e);
    --- End diff --
    
    @imesh There was a problem with my Git. I will make sure this solves the problem and send a fresh PR. Shall we close this now?


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

[GitHub] stratos pull request: Raising registry exception for adding autosc...

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

    https://github.com/apache/stratos/pull/215#discussion_r25842718
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -118,19 +118,33 @@ private void persist(Object dataObj, String resourcePath) throws AutoScalerExcep
         }
     
         public void persistAutoscalerPolicy(AutoscalePolicy autoscalePolicy) {
    -        String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE + AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    -        persist(autoscalePolicy, resourcePath);
    -        if (log.isDebugEnabled()) {
    -            log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    -                    autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +        try {
    +            String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE +
    +                    AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    +
    +            persist(autoscalePolicy, resourcePath);
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    +                        autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +            }
    +        } catch (Exception e) {
    +            log.error((String.format("Unable to persist autoscaler policy [autoscaler-policy-id] %s",
    +                    autoscalePolicy.getId())), e);
    --- End diff --
    
    @Vishanth This pull request was open for quite some time now. Shall we proceed further on this? If you could try to re-create the original issue and verify whether this change fix that problem it would be great!
    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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: Raising registry exception for adding autosc...

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

    https://github.com/apache/stratos/pull/215#discussion_r24238660
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -118,19 +118,33 @@ private void persist(Object dataObj, String resourcePath) throws AutoScalerExcep
         }
     
         public void persistAutoscalerPolicy(AutoscalePolicy autoscalePolicy) {
    -        String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE + AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    -        persist(autoscalePolicy, resourcePath);
    -        if (log.isDebugEnabled()) {
    -            log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    -                    autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +        try {
    +            String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE +
    +                    AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    +
    +            persist(autoscalePolicy, resourcePath);
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    +                        autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +            }
    +        } catch (Exception e) {
    +            log.error((String.format("Unable to persist autoscaler policy [autoscaler-policy-id] %s",
    +                    autoscalePolicy.getId())), e);
    --- End diff --
    
    Thanks for looking into this @Vishanth! IMO we need to raise an Autoscaler exception if there is a problem in persisting an artifact. Would you mind throwing an Autoscaler exception something like AutoscalerPersistenceException from this method?
    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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] stratos pull request: Raising registry exception for adding autosc...

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

    https://github.com/apache/stratos/pull/215#discussion_r25942573
  
    --- Diff: components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/registry/RegistryManager.java ---
    @@ -118,19 +118,33 @@ private void persist(Object dataObj, String resourcePath) throws AutoScalerExcep
         }
     
         public void persistAutoscalerPolicy(AutoscalePolicy autoscalePolicy) {
    -        String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE + AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    -        persist(autoscalePolicy, resourcePath);
    -        if (log.isDebugEnabled()) {
    -            log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    -                    autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +        try {
    +            String resourcePath = AutoscalerConstants.AUTOSCALER_RESOURCE +
    +                    AutoscalerConstants.AS_POLICY_RESOURCE + "/" + autoscalePolicy.getId();
    +
    +            persist(autoscalePolicy, resourcePath);
    +            if (log.isDebugEnabled()) {
    +                log.debug(String.format("Autoscaler policy written to registry: [id] %s [name] %s [description] %s",
    +                        autoscalePolicy.getId(), autoscalePolicy.getDisplayName(), autoscalePolicy.getDescription()));
    +            }
    +        } catch (Exception e) {
    +            log.error((String.format("Unable to persist autoscaler policy [autoscaler-policy-id] %s",
    +                    autoscalePolicy.getId())), e);
    --- End diff --
    
    Yes please close this as we have done the same fix in a different pull request.


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