[
https://issues.apache.org/jira/browse/HADOOP-17862?focusedWorklogId=642277&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-642277
]
ASF GitHub Bot logged work on HADOOP-17862:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 26/Aug/21 11:18
Start Date: 26/Aug/21 11:18
Worklog Time Spent: 10m
Work Description: steveloughran commented on a change in pull request
#3331:
URL: https://github.com/apache/hadoop/pull/3331#discussion_r696528779
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsListStatusRemoteIterator.java
##########
@@ -84,7 +90,7 @@ public void testAbfsIteratorWithHasNext() throws Exception {
.isEqualTo(TEST_FILES_NUMBER);
Assertions.assertThat(fileNames.size())
Review comment:
1. factor out into a new method and use wherever the same test is made
1. use assertThat(fileNames).hasSize(0) and assertJ will report the full
fileNames contents
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsListStatusRemoteIterator.java
##########
@@ -75,7 +79,9 @@ public void testAbfsIteratorWithHasNext() throws Exception {
while (fsItr.hasNext()) {
FileStatus fileStatus = fsItr.next();
String pathStr = fileStatus.getPath().toString();
- fileNames.remove(pathStr);
+ if (!fileNames.remove(pathStr)) {
Review comment:
should this be a failure?
And it's also replicated in a lot of places. Can you pull it into its own
method
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsListStatusRemoteIterator.java
##########
@@ -113,7 +119,9 @@ public void testAbfsIteratorWithoutHasNext() throws
Exception {
for (int i = 0; i < TEST_FILES_NUMBER; i++) {
FileStatus fileStatus = fsItr.next();
String pathStr = fileStatus.getPath().toString();
- fileNames.remove(pathStr);
+ if (!fileNames.remove(pathStr)) {
Review comment:
again should this be failed?
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsListStatusRemoteIterator.java
##########
@@ -113,7 +119,9 @@ public void testAbfsIteratorWithoutHasNext() throws
Exception {
for (int i = 0; i < TEST_FILES_NUMBER; i++) {
FileStatus fileStatus = fsItr.next();
String pathStr = fileStatus.getPath().toString();
- fileNames.remove(pathStr);
+ if (!fileNames.remove(pathStr)) {
+ LOG.debug("Could not remove path string {} from fileNames", pathStr);
+ }
itrCount++;
}
Assertions.assertThatThrownBy(() -> fsItr.next())
Review comment:
Can we move this to LambdaTestUtils.intercept()...it raises better
exceptions on failures, including the result of fsItr.next().toString() in the
message
##########
File path:
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsListResult.java
##########
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.fs.azurebfs.services;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Iterator;
+
+import org.apache.hadoop.fs.FileStatus;
+
+public class AbfsListResult {
Review comment:
nit: javadocs
##########
File path:
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsListStatusRemoteIterator.java
##########
@@ -127,7 +135,7 @@ public void testAbfsIteratorWithoutHasNext() throws
Exception {
.isEqualTo(TEST_FILES_NUMBER);
Assertions.assertThat(fileNames.size())
Review comment:
see previous assertJ comment. I know, it's existing code, but...
##########
File path: hadoop-tools/hadoop-azure/src/test/resources/log4j.properties
##########
@@ -27,6 +27,10 @@
log4j.logger.org.apache.hadoop.fs.azure.BlockBlobAppendStream=DEBUG
log4j.logger.org.apache.hadoop.fs.azurebfs.contracts.services.TracingService=TRACE
log4j.logger.org.apache.hadoop.fs.azurebfs.services.AbfsClient=DEBUG
+#to track transient test failure in ITestAbfsListStatusRemoteIterator
Review comment:
must not go into final patch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 642277)
Time Spent: 1h (was: 50m)
> ABFS: Fix unchecked cast compiler warning for AbfsListStatusRemoteIterator
> --------------------------------------------------------------------------
>
> Key: HADOOP-17862
> URL: https://issues.apache.org/jira/browse/HADOOP-17862
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/azure
> Affects Versions: 3.3.1
> Reporter: Sumangala Patki
> Assignee: Sumangala Patki
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Hadoop yetus run shows a java compiler warning for unchecked casting of
> Object to Iterator<FileStatus> in a method of AbfsListStatusRemoteIterator
> class. This can be resolved by introducing a new class to hold the iterator
> and exception thrown when applicable.
>
> hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsListStatusRemoteIterator.java:97:38:[unchecked]
> unchecked cast
>
> This task will also add logging to facilitate better investigation of the
> transient failure tracked in HADOOP-17797.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]