You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Michael Guymon (JIRA)" <ji...@apache.org> on 2012/11/27 19:39:57 UTC

[jira] [Created] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Michael Guymon created CASSANDRA-4998:
-----------------------------------------

             Summary: Add hook for modifying configuration after cassandra.yaml is loaded
                 Key: CASSANDRA-4998
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
             Project: Cassandra
          Issue Type: Improvement
            Reporter: Michael Guymon


When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 

For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508832#comment-13508832 ] 

Sylvain Lebresne commented on CASSANDRA-4998:
---------------------------------------------

I understand the need to allow configuring the instance by other mean than the yaml, but I'm also not fully convinced by loading the yaml and then run some hook on the result. I'd rather add a mean to directly provide a Config object but in that case skipping the yaml completely. For instance, we could simply replace the current Config.setLoadYaml(boolean) by a Config.useConfig(Config), we would completely remove the need for the yaml, which sounds more generally useful to me. On top of which we could add a simple interface
{noformat}
interface ConfigurationLoader {
  Config loadConfig();
}
{noformat}
and we'd add a runtime flag so that one could add -Dcassandra.config.loader=<myLoaderClass>.
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michael Guymon
>            Priority: Minor
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Michael Guymon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508047#comment-13508047 ] 

Michael Guymon commented on CASSANDRA-4998:
-------------------------------------------

Correct me if I am wrong, but embedding Cassandra does not prevent it from being in a cluster. 

The goal I am trying to get at is to allow runtime configuration of Cassandra when it inits, instead of only relying on the cassandra.yaml. This will allow Cassandra to be embedded with other services and be part of a standardize configuration process. 

This patch is not very invasive, just adds the option for a callback when the cassandra.yaml loads.

One of the added benefits of this patch is it make testing easier. By using the callback hook to toggle settings, the conditional processing in DatabaseDescriptor can be asserted. It should allow tests that use an embedded Cassandra to use the callback instead of generating a cassandra.yaml on the fly based on a template.


                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Michael Guymon
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Michael Guymon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Guymon updated CASSANDRA-4998:
--------------------------------------

    Attachment: Add-load-hook-for-updating-Config-before-processing.patch
    
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Michael Guymon
>              Labels: patch
>         Attachments: Add-load-hook-for-updating-Config-before-processing.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Michael Guymon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508189#comment-13508189 ] 

Michael Guymon commented on CASSANDRA-4998:
-------------------------------------------

I should bring up, the scenario I am attempting, the cassandra.yaml would be package and loaded from the classpath, not exposed directly. There is no foot violence by having to manage multiple configs.

That being said, this patch would not affect the current way Cassandra runs. Only if someone rolls their own hook, updates the start up of Cassandra so it loads into the classpath, and then explicitly sets it in the cassandra.yaml.
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michael Guymon
>            Priority: Minor
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Michael Guymon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Guymon updated CASSANDRA-4998:
--------------------------------------

    Attachment:     (was: Add-load-hook-for-updating-Config-before-processing.patch)
    
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Michael Guymon
>              Labels: patch
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Michael Guymon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Guymon updated CASSANDRA-4998:
--------------------------------------

    Attachment: 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
                0001-Add-load-hook-for-updating-Config-before-processing.patch

Updated to remove the need extra cassandra.yaml for the tests
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Michael Guymon
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Brandon Williams (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508130#comment-13508130 ] 

Brandon Williams commented on CASSANDRA-4998:
---------------------------------------------

It's worth noting that you can call Config.setLoadYaml(false) to prevent loading of the yaml, as BulkRecordWriter and the bulk loader do.
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michael Guymon
>            Priority: Minor
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13507887#comment-13507887 ] 

Jonathan Ellis commented on CASSANDRA-4998:
-------------------------------------------

What problem is this trying to solve?  We're not really interested in targetting the embedded, single server application domaion.
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Michael Guymon
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-4998:
--------------------------------------

      Reviewer: slebresne
      Priority: Minor  (was: Major)
    Issue Type: New Feature  (was: Improvement)

I'm definitely not a fan of "let's override things programatically instead of just updating the yaml;" that is a great way to shoot yourself in the foot.

Will let Sylvain weigh in on if this is useful enough for dtests to include anyway.
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michael Guymon
>            Priority: Minor
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CASSANDRA-4998) Add hook for modifying configuration after cassandra.yaml is loaded

Posted by "Michael Guymon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508967#comment-13508967 ] 

Michael Guymon commented on CASSANDRA-4998:
-------------------------------------------

That sounds better to me as well. If you like, I can roll another patch + ticket based on this?
                
> Add hook for modifying configuration after cassandra.yaml is loaded
> -------------------------------------------------------------------
>
>                 Key: CASSANDRA-4998
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4998
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Michael Guymon
>            Priority: Minor
>              Labels: patch
>         Attachments: 0001-Add-load-hook-for-updating-Config-before-processing.patch, 0002-Remove-the-need-for-separate-cassandra.yml-in-tests.patch
>
>
> When embedding Cassandra in an application, allow programmatic changes to Cassandra's config by using a hook to modify the configuration after the YAML is loaded. 
> For this to work, a new YAML configuration needs to be added: after_load_hook_class. If defined, it would be the FQN of a class that implements IAfterLoadHook. When DatabaseDescriptor calls loadYAML(), before any processing of the Config happens, the after_load_hook_class is checked and called if exists. Then processing of the config happens as normal.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira