[
https://issues.apache.org/jira/browse/HIVE-10227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14503228#comment-14503228
]
Sushanth Sowmyan commented on HIVE-10227:
-----------------------------------------
Hi Alan,
ReplicationTask.java:
{quote}
line 100: Instantiating new HiveConf objects is expensive. It also runs the
risk of ignoring conf values set elsewhere in the code. Is there not an
existing version of the conf that can be used here?
{quote}
This has been fixed already per feedback from Mithun, and is updated in patches
2 & 3.
{quote}
line 107: Why do you want to set factory class name to null? If someone
configures a bad class name this will result in an error message every time
this method is invoked, which appears to be everytime a caller attempt to read
the next replication task.
{quote}
Going by version 1 of this patch for line 107 (although the fundamental logic
hasn't changed for this bit across the versions, there are 2 ways for people to
configure/"fix" a factory configured on this:
* Through the HiveConf set on HCatClient (in the later versions - it was a
statically instantiated HiveConf in the first version you looked at)
* Through resetFactory(Class<? extends Factory>) (which is intended for
testing purposes)
If we cannot instantiate a factory, that is a fatal error for ReplicationTask,
and we must not allow it to continue until it's fixed. Thus, it is appropriate
for this to error out on each call. That said, the behaviour of erroring out on
each call will hold only in the case of it being set through HiveConf, since
the next time it runs, it again picks up the factoryClassName from HiveConf
(and thus, the nulling basically allows us to refetch the value to check in
case there has been any update to that). In the case of resetFactory-based
instantiation, nulling it out so that it goes to NoopFactory is an appropriate
fallback - that said, resetFactory is also more resilient, in that it will not
have a case of a bad classname, since it takes in a Class<? extends Factory>
itself(it can still error out in default construction, but that's a runtime
fault, in which case the failovers are appropriate).
DropDatabaseCommand.java and other <? extends HiveCommand> methods:
{quote} line 43: These comments would be better in javadoc {quote}
Agreed, doing a trivial rebase to generate a .4.patch.
HiveCommand:
This class has been removed as a result of feedback as of .3.patch. HiveCommand
was an experiment, to push usage of .run() on Commands, rather than trying to
do a get() to get SQL commands. In that scenario, if we had other
ReplicationTaskFactory implementations that were returning their own Commands
which allowed Hive->MySQL replication, for instance, their get() might return
SQL commands intended for MySQL, for eg. But trying that was still premature,
and since HCatClient did not support import and export, that problem was not
being solved well either. This class and all references to it have been removed.
> Concrete implementation of Export/Import based ReplicationTaskFactory
> ---------------------------------------------------------------------
>
> Key: HIVE-10227
> URL: https://issues.apache.org/jira/browse/HIVE-10227
> Project: Hive
> Issue Type: Sub-task
> Components: Import/Export
> Affects Versions: 1.2.0
> Reporter: Sushanth Sowmyan
> Assignee: Sushanth Sowmyan
> Attachments: HIVE-10227.2.patch, HIVE-10227.3.patch, HIVE-10227.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)