-
Notifications
You must be signed in to change notification settings - Fork 9k
HADOOP-19575. ABFS: [FNSOverBlob] Add Distinct String In User Agent to Get Telemetry for FNS-Blob #7713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
HADOOP-19575. ABFS: [FNSOverBlob] Add Distinct String In User Agent to Get Telemetry for FNS-Blob #7713
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,7 @@ public final class ITestAbfsClient extends AbstractAbfsIntegrationTest { | |
|
||
private static final String ACCOUNT_NAME = "bogusAccountName.dfs.core.windows.net"; | ||
private static final String FS_AZURE_USER_AGENT_PREFIX = "Partner Service"; | ||
private static final String FNS_BLOB_USER_AGENT_IDENTIFIER = "FNS"; | ||
private static final String HUNDRED_CONTINUE_USER_AGENT = SINGLE_WHITE_SPACE + HUNDRED_CONTINUE + SEMICOLON; | ||
private static final String TEST_PATH = "/testfile"; | ||
public static final int REDUCED_RETRY_COUNT = 2; | ||
|
@@ -355,6 +356,44 @@ public void verifyUserAgentClusterType() throws Exception { | |
.contains(DEFAULT_VALUE_UNKNOWN); | ||
} | ||
|
||
@Test | ||
// Test to verify the unique identifier in user agent string for FNS-Blob accounts | ||
public void verifyUserAgentForFNSBlob() throws Exception { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add similar test for dfs and validate that no extra string is added. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
Assume.assumeTrue(JDK_HTTP_URL_CONNECTION == httpOperationType); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this assume for connection type? |
||
assumeHnsDisabled(); | ||
Assume.assumeTrue(getAbfsServiceType() == AbfsServiceType.BLOB); | ||
final AzureBlobFileSystem fs = getFileSystem(getRawConfiguration()); | ||
final AbfsConfiguration configuration = fs.getAbfsStore() | ||
.getAbfsConfiguration(); | ||
|
||
String userAgentStr = getUserAgentString(configuration, false); | ||
verifyBasicInfo(userAgentStr); | ||
Assertions.assertThat(userAgentStr) | ||
.describedAs( | ||
"User-Agent string for FNS accounts on Blob endpoint should contain " | ||
+ FNS_BLOB_USER_AGENT_IDENTIFIER) | ||
.contains(FNS_BLOB_USER_AGENT_IDENTIFIER); | ||
} | ||
|
||
@Test | ||
// Test to verify that the user agent string for non-FNS-Blob accounts | ||
// does not contain the FNS identifier. | ||
public void verifyUserAgentForDFS() throws Exception { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. assumeHnsDisabled() as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For both HNS-DFS and FNS-DFS we would want to check that the string isnt added right |
||
Assume.assumeTrue(JDK_HTTP_URL_CONNECTION == httpOperationType); | ||
Assume.assumeTrue(getAbfsServiceType() == AbfsServiceType.DFS); | ||
final AzureBlobFileSystem fs = getFileSystem(getRawConfiguration()); | ||
final AbfsConfiguration configuration = fs.getAbfsStore() | ||
.getAbfsConfiguration(); | ||
|
||
String userAgentStr = getUserAgentString(configuration, false); | ||
verifyBasicInfo(userAgentStr); | ||
Assertions.assertThat(userAgentStr) | ||
.describedAs( | ||
"User-Agent string for non-FNS-Blob accounts should not contain" | ||
+ FNS_BLOB_USER_AGENT_IDENTIFIER) | ||
.doesNotContain(FNS_BLOB_USER_AGENT_IDENTIFIER); | ||
} | ||
|
||
public static AbfsClient createTestClientFromCurrentContext( | ||
AbfsClient baseAbfsClientInstance, | ||
AbfsConfiguration abfsConfig) throws IOException, URISyntaxException { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for just facing FNS as value for FNS Blob user agent? FNS user agent can be there for FNS DFS as well, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are adding the string only for FNS-Blob cases (since we wanted to check their usage only)
Initially we added "FNS-Blob" as string but then decided to shorten it to "FNS" since the endpoint we can check from the URL itself