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
--
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]