anmolanmol1234 commented on code in PR #7421:
URL: https://github.com/apache/hadoop/pull/7421#discussion_r1982780815
##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsBlobClient.java:
##########
@@ -1583,26 +1590,40 @@ public Hashtable<String, String>
getXMSProperties(AbfsHttpOperation result)
/**
* Parse the XML response body returned by ListBlob API on Blob Endpoint.
- * @param stream InputStream contains the response from server.
- * @return BlobListResultSchema containing the list of entries.
- * @throws IOException if parsing fails.
+ * @param result InputStream contains the response from server.
+ * @param uri to be used for path conversion.
+ * @return {@link ListResponseData}. containing listing response.
+ * @throws AzureBlobFileSystemException if parsing fails.
*/
@Override
- public ListResultSchema parseListPathResults(final InputStream stream)
throws IOException {
- if (stream == null) {
- return null;
- }
+ public ListResponseData parseListPathResults(AbfsHttpOperation result, URI
uri)
+ throws AzureBlobFileSystemException {
BlobListResultSchema listResultSchema;
- try {
- final SAXParser saxParser = saxParserThreadLocal.get();
- saxParser.reset();
- listResultSchema = new BlobListResultSchema();
- saxParser.parse(stream, new BlobListXmlParser(listResultSchema,
getBaseUrl().toString()));
- } catch (SAXException | IOException e) {
- throw new RuntimeException(e);
+ try (InputStream stream = result.getListResultStream()) {
+ if (stream == null) {
+ return null;
+ }
+ try {
+ final SAXParser saxParser = saxParserThreadLocal.get();
+ saxParser.reset();
+ listResultSchema = new BlobListResultSchema();
+ saxParser.parse(stream,
+ new BlobListXmlParser(listResultSchema, getBaseUrl().toString()));
+ result.setListResultSchema(listResultSchema);
+ } catch (SAXException | IOException e) {
+ throw new AbfsDriverException(e);
+ }
+ } catch (IOException e) {
+ LOG.error("Unable to deserialize list results", e);
Review Comment:
Given we have the uri now, should we include that in the error log as well ?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]