[
https://issues.apache.org/jira/browse/SQOOP-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14267552#comment-14267552
]
Hudson commented on SQOOP-1968:
-------------------------------
SUCCESS: Integrated in Sqoop2-hadoop200 #691 (See
[https://builds.apache.org/job/Sqoop2-hadoop200/691/])
SQOOP-1968: Optimize schema operation in getMatchingData of NameMatcher
(jarcec:
https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=60066b8f3873cd322735a7b822b9eac16e24c0fc)
*
connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/Matcher.java
*
connector/connector-sdk/src/test/java/org/apache/sqoop/connector/matcher/SchemaFixture.java
*
connector/connector-sdk/src/test/java/org/apache/sqoop/connector/matcher/TestLocationMatcher.java
*
connector/connector-sdk/src/test/java/org/apache/sqoop/connector/matcher/TestNameMatcher.java
*
connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/NameMatcher.java
*
connector/connector-sdk/src/main/java/org/apache/sqoop/connector/matcher/LocationMatcher.java
> 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
> Fix For: 1.99.5
>
> Attachments: SQOOP-1968.2.patch, SQOOP-1968.3.patch, 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)