[
https://issues.apache.org/jira/browse/PHOENIX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15102536#comment-15102536
]
James Taylor commented on PHOENIX-2119:
---------------------------------------
Thanks for the patch, [~samarthjain]. Here's some feedback:
- We shouldn't make a copy of the defaultProps here, as it's already immutable
(and this would default the purpose of this JIRA):
{code}
private ReadOnlyProps(ReadOnlyProps defaultProps, Properties overrides) {
- Map<String,String> combinedProps =
Maps.newHashMapWithExpectedSize(defaultProps.props.size() + overrides.size());
- combinedProps.putAll(defaultProps.props);
- for (Entry<Object, Object> entry : overrides.entrySet()) {
- String key = entry.getKey().toString();
- String value = entry.getValue().toString();
- combinedProps.put(key, value);
+ this.props = ImmutableMap.copyOf(defaultProps.props); // Should just
be this.props = defaultProps.props;
{code}
- It's possible that the ReadOnlyProps defaultProps passed in would have
overrides itself, so we should copy the defaultProps.overrideProps first into
the new Map, and then overlay the overrides.
Otherwise, looks good.
> Do not copy underlying HBase configuration properties when connection
> properties are supplied
> ---------------------------------------------------------------------------------------------
>
> Key: PHOENIX-2119
> URL: https://issues.apache.org/jira/browse/PHOENIX-2119
> Project: Phoenix
> Issue Type: Improvement
> Reporter: James Taylor
> Assignee: Samarth Jain
> Labels: ReadOnlyDB, SFDC
> Fix For: 4.7.0
>
> Attachments: PHOENIX-2119.patch
>
>
> Related to PHOENIX-1958, we can avoid copying the underlying HBase
> configuration properties when connection properties are supplied by keeping
> an override maps on ConnectionQueryServices. In this case, a ReadOnlyProperty
> get will be first done on the override map and then subsequently on the
> base/shared map for the HBase configuration properties.
> The reason to do this is because some applications always provide connection
> properties (usually for custom annotations that identify the tenant and
> request) and the memory overhead of copying *all* properties is too high.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)