[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086752#comment-16086752 ] Ted Yu commented on HBASE-18378: I haven't found an existing JIRA after a quick search. Let me know if hbase side can be improved. > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086689#comment-16086689 ] James Taylor commented on HBASE-18378: -- Would you consider this an HDFS bug and if so was a JIRA ever filed, [~tedyu]? We'd definitely prefer not having the cost of the deep merge (though we've minimized it by holding on to one single modified config instance). > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086619#comment-16086619 ] Ted Yu commented on HBASE-18378: Maybe add a variant of create() which skips changing class loader. > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086615#comment-16086615 ] Samarth Jain commented on HBASE-18378: -- Using the HBaseConfiguration method could have unintended side-effects. For ex, the HBaseConfiguration#create() method adds the HBaseConfiguration.class.getClassLoader(). {code} /** * Creates a Configuration with HBase resources * @return a Configuration with HBase resources */ public static Configuration create() { Configuration conf = new Configuration(); // In case HBaseConfiguration is loaded from a different classloader than // Configuration, conf needs to be set with appropriate class loader to resolve // HBase resources. conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); return addHbaseResources(conf); } {code} So if I used {code} public static Configuration create(final Configuration that) {code} then the config returned by the above method would have the class loader set. > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086610#comment-16086610 ] Ted Yu commented on HBASE-18378: Deep copy (merge(Configuration destConf, Configuration srcConf)) has its cost. I guess we cannot turn on deep copy by default in copy constructor. > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086606#comment-16086606 ] Samarth Jain commented on HBASE-18378: -- Thanks for the comment, [~tedyu]. While it might just work out in our case, it seems a bit odd to me that for copying a CompoundConfiguration I need to use a method of it's sibling class, HBaseConfiguration. > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (HBASE-18378) Cloning configuration contained in CoprocessorEnvironment doesn't work
[ https://issues.apache.org/jira/browse/HBASE-18378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086393#comment-16086393 ] Ted Yu commented on HBASE-18378: Have you tried this method from HBaseConfiguration ? {code} public static Configuration create(final Configuration that) { {code} > Cloning configuration contained in CoprocessorEnvironment doesn't work > -- > > Key: HBASE-18378 > URL: https://issues.apache.org/jira/browse/HBASE-18378 > Project: HBase > Issue Type: Bug >Reporter: Samarth Jain > > In our phoenix co-processors, we need to clone configuration passed in > CoprocessorEnvironment. > However, using the copy constructor declared in it's parent class, > Configuration, doesn't copy over anything. > For example: > {code} > CorpocessorEnvironment e > Configuration original = e.getConfiguration(); > Configuration clone = new Configuration(original); > clone.get(HConstants.ZK_SESSION_TIMEOUT) -> returns null > e.configuration.get(HConstants.ZK_SEESION_TIMEOUT) -> returns > HConstants.DEFAULT_ZK_SESSION_TIMEOUT > {code} -- This message was sent by Atlassian JIRA (v6.4.14#64029)