[
https://issues.apache.org/jira/browse/SQOOP-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14265901#comment-14265901
]
Sqoop QA bot commented on SQOOP-1968:
-------------------------------------
Testing file
[SQOOP-1968.patch|https://issues.apache.org/jira/secure/attachment/12690284/SQOOP-1968.patch]
against branch sqoop2 took 0:27:24.033500.
{color:red}Overall:{color} -1 due to 3 errors
{color:red}ERROR:{color} File {{spi/target/rat.txt}} have missing licence header
{color:red}ERROR:{color} File {{spi/target/.plxarc}} have missing licence header
{color:red}ERROR:{color} Failed to run license check (exit code 1,
[report|https://builds.apache.org/job/PreCommit-SQOOP-Build/880/artifact/patch-process/rat.txt])
{color:green}SUCCESS:{color} Clean was successful
{color:green}SUCCESS:{color} Patch applied correctly
{color:green}SUCCESS:{color} Patch add/modify test case
{color:green}SUCCESS:{color} Patch compiled
{color:green}SUCCESS:{color} All unit tests passed
{color:green}SUCCESS:{color} All integration tests passed
Console output is available
[here|https://builds.apache.org/job/PreCommit-SQOOP-Build/880/console].
This message is automatically generated.
> Optimize schema operation in getMatchingData of NameMatcher
> -----------------------------------------------------------
>
> Key: SQOOP-1968
> URL: https://issues.apache.org/jira/browse/SQOOP-1968
> Project: Sqoop
> Issue Type: Improvement
> Components: connectors/generic
> Affects Versions: 2.0.0
> Reporter: Jerry Chen
> Assignee: Qian Xu
> Attachments: SQOOP-1968.patch
>
>
> Two performance issues found in the Matcher implementations.
> 1. In getMatchingData of NameMatcher, the following code block of building a
> HashMap will not change across different getMatchingData calls. The HashMap
> can build only once in Constructor.
> {code}
> HashMap<String,Column> colNames = new HashMap<String, Column>();
> for (Column fromCol: getFromSchema().getColumnsArray()) {
> colNames.put(fromCol.getName(), fromCol);
> }
> {code}
> 2. In getMatchingData of NameMatcher, indexOf of a List implementation is
> not efficient. It usually involves a loop for finding the object and return
> the index. To improve, we can simple store the index in the above HashMap and
> retrieve the index by HashMap lookup directly
> {code}
> int fromIndex = getFromSchema().getColumnsList().indexOf(fromCol);
> {code}
> These performance problems are critical because getMatchingData is repeatedly
> calling for each record.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)