[
https://issues.apache.org/jira/browse/LENS-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14263422#comment-14263422
]
Himanshu Gahlaut commented on LENS-123:
---------------------------------------
The requirement here is to define multiple drivers (hive/jdbc) with same
properties. It is like having one schema and multiple records to it. The nature
of the problem is to have structured configuration.
I absolutely agree that descriptions should be present. Since the properties of
multiple hive drivers / multiple jdbc drivers are repetitive, if each and
every tag is described, the descriptions might become repetitive. E.g.: host,
port, retry-failure-connection-limit, etc tags for different hive drivers might
have same description. In light of this comment, enforcing description on each
repetitive property in same / different file would be an overhead.
Instead of repetitive descriptions, the alternative is to use XML comments to
describe all properties of a hive/jdbc driver element only once. This approach
is followed in ehcache.xml. (http://ehcache.org/ehcache.xml). Please search for
"Cache Configuration" section and have a look at the XML documentation of each
property. Then search for sampleCache1, sampleCache2, etc to see xml code of
multiple caches. EhCache has a requirement of configuring multiple caches,
similar to lens requirement of configuring multiple drivers. It does not
enforces to have a description with every repetitive tag. However, XML comments
are extensively used for documentation.
Creating an XSD is not much of an effort (lot of online generators are
available).
Also, creating a conf object using xml file name and calling
conf.get("driver-defaults.hive.port") will give the port from above XML. Not
much of java code is required with Apache Commons Configuration classes to read
structured XML.
At the same time would like to hear disadvantages of maintaining configurations
in a structured fashion as well. Specially for the case at hand in which
multiple elements (drivers) have same properties. Please feel free to post the
disadvantages of the same.
> Ability to load different instances of same driver class
> --------------------------------------------------------
>
> Key: LENS-123
> URL: https://issues.apache.org/jira/browse/LENS-123
> Project: Apache Lens
> Issue Type: Improvement
> Components: server
> Reporter: Amareshwari Sriramadasu
> Assignee: Himanshu Gahlaut
> Fix For: 2.0
>
>
> Currently we are loading only one driver instance per class. We should be
> able to load multiple different instances of a driver class.
> For example, There can be multiple HiveDrivers talking to different
> HiveServers sitting on each colo. Or different JDBCDrivers talking to
> different dbs.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)