Skip to content

Commit 5b9dfa5

Browse files
committed
PR Checks
1 parent 5df635d commit 5b9dfa5

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1925,6 +1925,7 @@ private List<AbfsHttpHeader> getMetadataHeadersList(final Hashtable<String, Stri
19251925
* @param listResultSchema List of entries returned by Blob Endpoint.
19261926
* @param uri URI to be used for path conversion.
19271927
* @return List of entries after removing duplicates.
1928+
* @throws IOException if path conversion fails.
19281929
*/
19291930
@VisibleForTesting
19301931
public ListResponseData filterDuplicateEntriesAndRenamePendingFiles(

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsHttpOperation.java

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,6 @@ public final byte[] getListResultData() {
226226
return listResultData;
227227
}
228228

229-
@VisibleForTesting
230-
public byte[] readDataFromStream(InputStream stream) throws IOException{
231-
try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
232-
byte[] tempBuffer = new byte[CLEAN_UP_BUFFER_SIZE];
233-
int bytesRead;
234-
while ((bytesRead = stream.read(tempBuffer, 0, CLEAN_UP_BUFFER_SIZE)) != -1) {
235-
buffer.write(tempBuffer, 0, bytesRead);
236-
}
237-
return buffer.toByteArray();
238-
}
239-
}
240-
241229
/**
242230
* Get response header value for the given headerKey.
243231
*
@@ -526,7 +514,14 @@ private void parseListPathResponse(final InputStream stream) throws IOException
526514
if (stream == null || listResultData != null) {
527515
return;
528516
}
529-
listResultData = readDataFromStream(stream);
517+
try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
518+
byte[] tempBuffer = new byte[CLEAN_UP_BUFFER_SIZE];
519+
int bytesRead;
520+
while ((bytesRead = stream.read(tempBuffer, 0, CLEAN_UP_BUFFER_SIZE)) != -1) {
521+
buffer.write(tempBuffer, 0, bytesRead);
522+
}
523+
listResultData = buffer.toByteArray();
524+
}
530525
}
531526

532527
public List<String> getBlockIdList() {

0 commit comments

Comments
 (0)