[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13579089#comment-13579089 ] Hudson commented on HADOOP-9154: Integrated in Hadoop-Yarn-trunk #128 (See [https://builds.apache.org/job/Hadoop-Yarn-trunk/128/]) HADOOP-9154. SortedMapWritable#putAll() doesn't add key/value classes to the map. Contributed by Karthik Kambatla. (Revision 1446183) Result = SUCCESS tomwhite : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1446183 Files : * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/AbstractMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Fix For: 1.2.0, 0.23.7, 2.0.4-beta Attachments: HADOOP-9124.patch, hadoop-9154-branch1.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13579136#comment-13579136 ] Hudson commented on HADOOP-9154: Integrated in Hadoop-Hdfs-0.23-Build #526 (See [https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/526/]) HADOOP-9154. SortedMapWritable#putAll() doesn't add key/value classes to the map. (Karthik Kambatla via tgraves) (Revision 1446271) Result = SUCCESS tgraves : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1446271 Files : * /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/AbstractMapWritable.java * /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java * /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Fix For: 1.2.0, 0.23.7, 2.0.4-beta Attachments: HADOOP-9124.patch, hadoop-9154-branch1.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13579149#comment-13579149 ] Hudson commented on HADOOP-9154: Integrated in Hadoop-Hdfs-trunk #1317 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk/1317/]) HADOOP-9154. SortedMapWritable#putAll() doesn't add key/value classes to the map. Contributed by Karthik Kambatla. (Revision 1446183) Result = FAILURE tomwhite : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1446183 Files : * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/AbstractMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Fix For: 1.2.0, 0.23.7, 2.0.4-beta Attachments: HADOOP-9124.patch, hadoop-9154-branch1.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13579193#comment-13579193 ] Hudson commented on HADOOP-9154: Integrated in Hadoop-Mapreduce-trunk #1345 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1345/]) HADOOP-9154. SortedMapWritable#putAll() doesn't add key/value classes to the map. Contributed by Karthik Kambatla. (Revision 1446183) Result = SUCCESS tomwhite : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1446183 Files : * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/AbstractMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Fix For: 1.2.0, 0.23.7, 2.0.4-beta Attachments: HADOOP-9124.patch, hadoop-9154-branch1.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13578393#comment-13578393 ] Hudson commented on HADOOP-9154: Integrated in Hadoop-trunk-Commit #3361 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/3361/]) HADOOP-9154. SortedMapWritable#putAll() doesn't add key/value classes to the map. Contributed by Karthik Kambatla. (Revision 1446183) Result = SUCCESS tomwhite : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVNview=revrev=1446183 Files : * /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/AbstractMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java * /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestSortedMapWritable.java SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Fix For: 1.2.0, 2.0.4-beta Attachments: HADOOP-9124.patch, hadoop-9154-branch1.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13573773#comment-13573773 ] Hadoop QA commented on HADOOP-9154: --- {color:red}-1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12568438/hadoop-9154-branch1.patch against trunk revision . {color:red}-1 patch{color}. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/2161//console This message is automatically generated. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-branch1.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13568947#comment-13568947 ] Hadoop QA commented on HADOOP-9154: --- {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12567610/hadoop-9154.patch against trunk revision . {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 1 new or modified test files. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 core tests{color}. The patch passed unit tests in hadoop-common-project/hadoop-common. {color:green}+1 contrib tests{color}. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/2132//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/2132//console This message is automatically generated. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 1.1.1, 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560600#comment-13560600 ] Tom White commented on HADOOP-9154: --- Sorry to come to this late, but I feel that we should just fix the bug and not perform such extensive refactoring here. This is stable code and we need to be sure that such a change doesn't break compatibility. The following fix plus a unit test to show the problem should suffice, no? {noformat} diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java b/hadoop-common-p index eee744e..b533d94 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/SortedMapWritable.java @@ -141,7 +141,7 @@ public void putAll(Map? extends WritableComparable, ? extends Writable t) { for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { - instance.put(e.getKey(), e.getValue()); + put(e.getKey(), e.getValue()); } } {noformat} SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13560812#comment-13560812 ] Surenkumar Nihalani commented on HADOOP-9154: - I see better maintainability in this refactoring. If you feel otherwise, that's ok too. Since both {{MapWritable}}s extend {{AbstractMapWritable}} the one line fix and the unit tests should suffice. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13547019#comment-13547019 ] Surenkumar Nihalani commented on HADOOP-9154: - I agree with the refactoring. So, I just +1 and a this will be considered for commit, right? +1 SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13547273#comment-13547273 ] Karthik Kambatla commented on HADOOP-9154: -- That is right. At least one of the committers should review the patch and commit it. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545348#comment-13545348 ] Karthik Kambatla commented on HADOOP-9154: -- Hi Suren, Sorry I couldn't work on this. I ll try to take a look sometime this week. Regarding matching classes, this method is to be called on MapWritable and SortedMapWritable objects and hence couldn't use instanceof. The other option is to implement this method separately in those classes. In this case, I thought this should be okay. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545457#comment-13545457 ] Karthik Kambatla commented on HADOOP-9154: -- Suren, I took a closer look. Indeed the patch looks good. We might be able to clean up a little to make it. Let me take a shot at it, and post my changes here. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545459#comment-13545459 ] Surenkumar Nihalani commented on HADOOP-9154: - Karthik, I would highly appreciate it if you let me know what changes I need to make, so this way I'll be learning and this will bring up my coding workflow closer to what's the standard expectation, Instead of me examining the patch. Saves you time to code a trivial patch and I'll learn too. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545473#comment-13545473 ] Karthik Kambatla commented on HADOOP-9154: -- In its current form, the patch looks good to go. The only nit (I am not particular though) is in test messages: String {{failureReason}} is being initialized for every assertion. This is not required for a single assertion of that kind. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545479#comment-13545479 ] Hadoop QA commented on HADOOP-9154: --- {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12563498/hadoop-9154.patch against trunk revision . {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 3 new or modified test files. {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages. {color:green}+1 eclipse:eclipse{color}. The patch built with eclipse:eclipse. {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 1.3.9) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 core tests{color}. The patch passed unit tests in hadoop-common-project/hadoop-common. {color:green}+1 contrib tests{color}. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/1951//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1951//console This message is automatically generated. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545499#comment-13545499 ] Surenkumar Nihalani commented on HADOOP-9154: - I debated initializing {{failureReason}} for a single assertion with myself when I was coding it and I went ahead it for three reasons: # Makes the code consistent. If you read the test from the start, you kinda start expecting it to have been initialized before every assert. # Easy extension. If anyone adds a bit more to the test, he/she wouldn't have to add initialization statement. # Code looks pretty and keeps all the assert statements (single assert ones especially) within 80 characters limit. If you think it's not worth above reasons, I am happy to change it and upload the patch. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545500#comment-13545500 ] Karthik Kambatla commented on HADOOP-9154: -- Suren, The points make sense. It is different from other tests in the code base, but that is no reason to not do it this way. Do you agree with my refactoring of the tests? +1 SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch, hadoop-9154.patch, hadoop-9154.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13545266#comment-13545266 ] Surenkumar Nihalani commented on HADOOP-9154: - Karthik, Had a chance to review the patch? SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13539568#comment-13539568 ] Karthik Kambatla commented on HADOOP-9154: -- Extremely sorry for messing up the name - I was thinking Suren, but typed Suresh (my co-advisor's name is Suresh, force of habit). I took a cursory look at the patch - it seems to be coming along very well. Let me try to take a closer look and add anything that I see we should. Regarding the hashCode() implementation, I don't understand the motive behind adding 1 to the hashCode either. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13539590#comment-13539590 ] Surenkumar Nihalani commented on HADOOP-9154: - No worries about the name. Just realized, {{ @SuppressWarnings(rawtypes) @Override public boolean equals(Object obj) { if(obj == null){ return false; } if (this == obj) { return true; } if (obj.getClass() == this.getClass()) { Map other = (Map) obj; if (size() != other.size()) { return false; } return entrySet().equals(other.entrySet()); } return false; } }} Shouldn't we be using instanceof instead of matching for classes? because incase some class extends MapWritable, we won't hit the branch because of exact match of the class check. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: HADOOP-9124.patch, hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13539409#comment-13539409 ] Surenkumar Nihalani commented on HADOOP-9154: - It's my understanding that merging the tests is my part here. If work division is different, please correct me. Now, we can merge the TestMapWritable TestSortedMapWritable into one TestAbstractMap. However deleting the older files doesn't seem like a good option because incase MapWritable SortedMapWritable change, we need the developer to be aware what he's changing, but, keeping them would mean code duplication. I was going through JUnit's offering. I think we'll have to create an abstract test class and then extend it in all files (TestMapWritable, TestSortedMapWritable, TestAbstractMap) with right initialization in a setup method. Is there a more elegant way to do this? SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13539416#comment-13539416 ] Karthik Kambatla commented on HADOOP-9154: -- Thanks for chipping in, Suresh. I didn't have any particular work division in mind. bq. I think we'll have to create an abstract test class and then extend it in all files (TestMapWritable, TestSortedMapWritable, TestAbstractMap) with right initialization in a setup method. I mostly agree. I was thinking of having an abstract test class {{AbstractMapWritableTest}} that has tests for each of the map methods. {{TestMapWritable}} and {{TestSortedMapWritable}} should have the right initialization as you mention. We shouldn't need {{TestAbstractMap}}. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13539490#comment-13539490 ] Surenkumar Nihalani commented on HADOOP-9154: - {Thanks for chipping in, Suresh.} It's Suren. :) In MapWritable's implementation, {{ @Override public int hashCode() { return 1 + this.instance.hashCode(); } }} What's the purpose of adding one to instance's hashCode? SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla Attachments: hadoop-9154-draft.patch In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HADOOP-9154) SortedMapWritable#putAll() doesn't add key/value classes to the map
[ https://issues.apache.org/jira/browse/HADOOP-9154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13539300#comment-13539300 ] Karthik Kambatla commented on HADOOP-9154: -- A better approach might be to add a protected {{Map}} instance to {{AbstractMapWritable}} to be instantiated in subclasses - {{SortedMapWritable}} and {{MapWritable}}. All the methods in {{Map}} can be implemented in the abstract class, while specific methods like {{#headMap()}} can be implemented in subclasses. That would let us avoid code duplication. SortedMapWritable#putAll() doesn't add key/value classes to the map --- Key: HADOOP-9154 URL: https://issues.apache.org/jira/browse/HADOOP-9154 Project: Hadoop Common Issue Type: Bug Components: io Affects Versions: 2.0.2-alpha Reporter: Karthik Kambatla Assignee: Karthik Kambatla In the following code from {{SortedMapWritable}}, #putAll() doesn't add key/value classes to the class-id maps. {code} @Override public Writable put(WritableComparable key, Writable value) { addToMap(key.getClass()); addToMap(value.getClass()); return instance.put(key, value); } @Override public void putAll(Map? extends WritableComparable, ? extends Writable t){ for (Map.Entry? extends WritableComparable, ? extends Writable e: t.entrySet()) { instance.put(e.getKey(), e.getValue()); } } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira