Skip to content

Commit

Permalink
comment, condition small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
saxenapranav committed Mar 9, 2023
1 parent e15ce58 commit f6283a9
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -153,16 +153,16 @@ public void setListener(Listener listener) {
* X_MS_CLIENT_REQUEST_ID header of the http operation
* @param httpOperation AbfsHttpOperation instance to set header into
* connection
* @param previousFailure Failure seen before this API trigger on
* same operation from AbfsClient. It shall be non-null if it is a retry-iteration.
* @param previousFailure Failure seen before this API trigger on same operation
* from AbfsClient.
*/
public void constructHeader(AbfsHttpOperation httpOperation, String previousFailure) {
clientRequestId = UUID.randomUUID().toString();
switch (format) {
case ALL_ID_FORMAT: // Optional IDs (e.g. streamId) may be empty
header =
clientCorrelationID + ":" + clientRequestId + ":" + fileSystemID + ":"
+ getPrimaryRequestIdForHeader(previousFailure != null) + ":" + streamID
+ getPrimaryRequestIdForHeader(retryCount > 0) + ":" + streamID
+ ":" + opType + ":" + retryCount;
header = addFailureReasons(header, previousFailure);
break;
Expand All @@ -181,7 +181,7 @@ public void constructHeader(AbfsHttpOperation httpOperation, String previousFail
* API call (previousFailure shall be null), maintain the last part of clientRequestId's
* UUID in primaryRequestIdForRetry. This field shall be used as primaryRequestId part
* of the x-ms-client-request-id header in case of retry of the same API-request.
* */
*/
if (primaryRequestId.isEmpty() && previousFailure == null) {
String[] clientRequestIdParts = clientRequestId.split("-");
primaryRequestIdForRetry = clientRequestIdParts[
Expand All @@ -195,7 +195,7 @@ public void constructHeader(AbfsHttpOperation httpOperation, String previousFail
* @return {@link #primaryRequestIdForRetry}:If the {@link #primaryRequestId}
* is an empty-string, and it's a retry iteration.
* {@link #primaryRequestId} for other cases.
* */
*/
private String getPrimaryRequestIdForHeader(final Boolean isRetry) {
if (!primaryRequestId.isEmpty() || !isRetry) {
return primaryRequestId;
Expand Down

0 comments on commit f6283a9

Please sign in to comment.