Skip to content

Commit fde1783

Browse files
committed
PR Checks
1 parent 5b9dfa5 commit fde1783

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import javax.xml.parsers.ParserConfigurationException;
2323
import javax.xml.parsers.SAXParser;
2424
import javax.xml.parsers.SAXParserFactory;
25-
import java.io.ByteArrayInputStream;
2625
import java.io.FileNotFoundException;
2726
import java.io.IOException;
2827
import java.io.InputStream;
@@ -1606,7 +1605,7 @@ public Hashtable<String, String> getXMSProperties(AbfsHttpOperation result)
16061605
@Override
16071606
public ListResponseData parseListPathResults(AbfsHttpOperation result, URI uri)
16081607
throws AzureBlobFileSystemException {
1609-
try (InputStream stream = new ByteArrayInputStream(result.getListResultData())) {
1608+
try (InputStream stream = result.getListResultStream()) {
16101609
try {
16111610
BlobListResultSchema listResultSchema;
16121611
final SAXParser saxParser = saxParserThreadLocal.get();

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package org.apache.hadoop.fs.azurebfs.services;
2020

21-
import java.io.ByteArrayInputStream;
2221
import java.io.FileNotFoundException;
2322
import java.io.IOException;
2423
import java.io.InputStream;
@@ -1481,7 +1480,7 @@ public Hashtable<String, String> getXMSProperties(AbfsHttpOperation result)
14811480
@Override
14821481
public ListResponseData parseListPathResults(AbfsHttpOperation result, URI uri)
14831482
throws AzureBlobFileSystemException {
1484-
try (InputStream stream = new ByteArrayInputStream(result.getListResultData())) {
1483+
try (InputStream stream = result.getListResultStream()) {
14851484
try {
14861485
DfsListResultSchema listResultSchema;
14871486
final ObjectMapper objectMapper = new ObjectMapper();

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package org.apache.hadoop.fs.azurebfs.services;
2020

21+
import java.io.ByteArrayInputStream;
2122
import java.io.ByteArrayOutputStream;
2223
import java.io.IOException;
2324
import java.io.InputStream;
@@ -76,7 +77,7 @@ public abstract class AbfsHttpOperation implements AbfsPerfLoggable {
7677
private String requestId = "";
7778
private String expectedAppendPos = "";
7879
private ListResultSchema listResultSchema = null;
79-
private byte[] listResultData = null;
80+
private InputStream listResultStream = null;
8081
private List<String> blockIdList = null;
8182

8283
// metrics
@@ -222,8 +223,8 @@ public ListResultSchema getListResultSchema() {
222223
return listResultSchema;
223224
}
224225

225-
public final byte[] getListResultData() {
226-
return listResultData;
226+
public InputStream getListResultStream() {
227+
return listResultStream;
227228
}
228229

229230
/**
@@ -511,7 +512,7 @@ private void parseBlockListResponse(final InputStream stream) throws IOException
511512
* @throws IOException if an error occurs while reading the stream.
512513
*/
513514
private void parseListPathResponse(final InputStream stream) throws IOException {
514-
if (stream == null || listResultData != null) {
515+
if (stream == null || listResultStream != null) {
515516
return;
516517
}
517518
try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) {
@@ -520,7 +521,7 @@ private void parseListPathResponse(final InputStream stream) throws IOException
520521
while ((bytesRead = stream.read(tempBuffer, 0, CLEAN_UP_BUFFER_SIZE)) != -1) {
521522
buffer.write(tempBuffer, 0, bytesRead);
522523
}
523-
listResultData = buffer.toByteArray();
524+
listResultStream = new ByteArrayInputStream(buffer.toByteArray());
524525
}
525526
}
526527

0 commit comments

Comments
 (0)