[ 
https://issues.apache.org/jira/browse/HADOOP-19735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18035270#comment-18035270
 ] 

ASF GitHub Bot commented on HADOOP-19735:
-----------------------------------------

manika137 commented on code in PR #8050:
URL: https://github.com/apache/hadoop/pull/8050#discussion_r2489381491


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsInputStream.java:
##########
@@ -899,6 +908,91 @@ private void 
testReadTypeInTracingContextHeaderInternal(AzureBlobFileSystem fs,
     assertReadTypeInClientRequestId(fs, numOfReadCalls, totalReadCalls, 
readType);
   }
 
+  /*
+   * Test to verify that both conditions of prefetch read and respective config
+   * enabled needs to be true for the priority header to be added
+   */
+  @Test
+  public void testPrefetchReadAddsPriorityHeaderWithDifferentConfigs()
+      throws Exception {
+    Configuration configuration1 = new Configuration(getRawConfiguration());
+    configuration1.set(FS_AZURE_ENABLE_PREFETCH_REQUEST_PRIORITY, "true");
+
+    Configuration configuration2 = new Configuration(getRawConfiguration());
+    //use the default value for the config: false
+    configuration2.unset(FS_AZURE_ENABLE_PREFETCH_REQUEST_PRIORITY);
+
+    TracingContext tracingContext1 = mock(TracingContext.class);
+    when(tracingContext1.getReadType()).thenReturn(PREFETCH_READ);
+
+    //Prefetch Read with config enabled
+    executePrefetchReadTest(tracingContext1, configuration1, true);
+    //Prefetch Read with config disabled
+    executePrefetchReadTest(tracingContext1, configuration2, false);
+
+    when(tracingContext1.getReadType()).thenReturn(DIRECT_READ);
+
+    //Non-prefetch read with config disabled
+    executePrefetchReadTest(tracingContext1, configuration2, false);
+    //Non-prefetch read with config enabled
+    executePrefetchReadTest(tracingContext1, configuration1, false);
+  }
+
+  private void executePrefetchReadTest(TracingContext tracingContext,

Review Comment:
   Added





> ABFS: Adding request priority for prefetches
> --------------------------------------------
>
>                 Key: HADOOP-19735
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19735
>             Project: Hadoop Common
>          Issue Type: Task
>          Components: fs/azure
>    Affects Versions: 3.4.1, 3.4.2
>            Reporter: Manika Joshi
>            Assignee: Manika Joshi
>            Priority: Major
>              Labels: pull-request-available
>
> Adding low traffic request priority (behind a config flag) for prefetches to 
> reduce load on server during throttling



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to