[
https://issues.apache.org/jira/browse/HADOOP-19645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18011828#comment-18011828
]
ASF GitHub Bot commented on HADOOP-19645:
-----------------------------------------
anmolanmol1234 commented on code in PR #7837:
URL: https://github.com/apache/hadoop/pull/7837#discussion_r2250972747
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/utils/TracingHeaderValidator.java:
##########
@@ -206,7 +207,7 @@ public void updateReadType(ReadType readType) {
}
/**
- * Sets the value of the number of blobs operated on
+ * Sets the value of the number of blobs operated on976345
Review Comment:
typo issue
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsInputStream.java:
##########
@@ -886,40 +928,54 @@ private void
testReadTypeInTracingContextHeaderInternal(AzureBlobFileSystem fs,
ArgumentCaptor<ContextEncryptionAdapter> captor8 =
ArgumentCaptor.forClass(ContextEncryptionAdapter.class);
ArgumentCaptor<TracingContext> captor9 =
ArgumentCaptor.forClass(TracingContext.class);
- verify(fs.getAbfsStore().getClient(), times(numOfReadCalls)).read(
+ verify(fs.getAbfsStore().getClient(), times(totalReadCalls)).read(
captor1.capture(), captor2.capture(), captor3.capture(),
captor4.capture(), captor5.capture(), captor6.capture(),
captor7.capture(), captor8.capture(), captor9.capture());
- TracingContext tracingContext = captor9.getAllValues().get(numOfReadCalls
- 1);
- verifyHeaderForReadTypeInTracingContextHeader(tracingContext, readType);
+ List<TracingContext> tracingContextList = captor9.getAllValues();
+ if (readType == PREFETCH_READ) {
+ /*
+ * For Prefetch Enabled, first read can be Normal or Missed Cache Read.
+ * Sow e will assert only for last 2 calls which should be Prefetched
Read.
+ * Since calls are asynchronous, we can not guarantee the order of calls.
+ * Therefore, we cannot assert on exact position here.
+ */
+ for (int i = tracingContextList.size() - (numOfReadCalls - 1); i <
tracingContextList.size(); i++) {
+
verifyHeaderForReadTypeInTracingContextHeader(tracingContextList.get(i),
readType, -1);
+ }
+ } else if (readType == DIRECT_READ) {
+ int expectedReadPos = ONE_MB/3;
Review Comment:
comment for why are we starting with this position will help in clarity
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestApacheHttpClientFallback.java:
##########
@@ -61,15 +61,15 @@ private TracingContext getSampleTracingContext(int[]
jdkCallsRegister,
answer.callRealMethod();
AbfsHttpOperation op = answer.getArgument(0);
if (op instanceof AbfsAHCHttpOperation) {
- Assertions.assertThat(tc.getHeader()).contains(APACHE_IMPL);
+ Assertions.assertThat(tc.getHeader()).endsWith(APACHE_IMPL);
apacheCallsRegister[0]++;
}
if (op instanceof AbfsJdkHttpOperation) {
jdkCallsRegister[0]++;
if (AbfsApacheHttpClient.usable()) {
- Assertions.assertThat(tc.getHeader()).contains(JDK_IMPL);
+ Assertions.assertThat(tc.getHeader()).endsWith(JDK_IMPL);
Review Comment:
this might fail if we add new header where the network library is not
maintained as the last header, so contains looks better to me
> ABFS: [ReadAheadV2] Improve Metrics for Read Calls to identify type of read
> done.
> ---------------------------------------------------------------------------------
>
> Key: HADOOP-19645
> URL: https://issues.apache.org/jira/browse/HADOOP-19645
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: fs/azure
> Affects Versions: 3.3.6, 3.4.1
> Reporter: Anuj Modi
> Assignee: Anuj Modi
> Priority: Major
> Labels: pull-request-available
>
> There are a number of ways in which ABFS driver can trigger a network call to
> read data. We need a way to identify what type of read call was made from
> client. Plan is to add an indication for this in already present
> ClientRequestId header.
> Following are types of read we want to identify:
> # Direct Read: Read from a given position in remote file. This will be
> synchronous read
> # Normal Read: Read from current seeked position where read ahead was
> bypassed. This will be synchronous read.
> # Prefetch Read: Read triggered from background threads filling up in memory
> cache. This will be asynchronous read.
> # Missed Cache Read: Read triggered after nothing was received from read
> ahead. This will be synchronous read.
> # Footer Read: Read triggered as part of footer read optimization. This will
> be synchronous.
> # Small File Read: Read triggered as a part of small file read. This will be
> synchronous read.
> We will add another field in the Tracing Header (Client Request Id) for each
> request. We can call this field "Operation Specific Header" very similar to
> how we have "Retry Header" today. As part of this we will only use it for
> read operations keeping it empty for other operations. Moving ahead f we need
> to publish any operation specific info, same header can be used.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]