Skip to content

Commit b40fd6a

Browse files
RestOperation fix
1 parent c88011c commit b40fd6a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import java.net.UnknownHostException;
2626
import java.util.List;
2727

28+
import org.apache.hadoop.classification.VisibleForTesting;
2829
import org.slf4j.Logger;
2930
import org.slf4j.LoggerFactory;
3031

@@ -260,7 +261,7 @@ private boolean executeHttpOperation(final int retryCount,
260261

261262
try {
262263
// initialize the HTTP request and open the connection
263-
httpOperation = new AbfsHttpOperation(url, method, requestHeaders);
264+
httpOperation = createHttpOperation();
264265
incrementCounter(AbfsStatistic.CONNECTIONS_MADE, 1);
265266
tracingContext.constructHeader(httpOperation);
266267

@@ -359,6 +360,15 @@ private boolean executeHttpOperation(final int retryCount,
359360
return true;
360361
}
361362

363+
/**
364+
* Creates new object of {@link AbfsHttpOperation} with the url, method, and
365+
* requestHeaders fields of the AbfsRestOperation object.
366+
*/
367+
@VisibleForTesting
368+
AbfsHttpOperation createHttpOperation() throws IOException {
369+
return new AbfsHttpOperation(url, method, requestHeaders);
370+
}
371+
362372
/**
363373
* Incrementing Abfs counters with a long value.
364374
*

0 commit comments

Comments
 (0)