-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-17873. ABFS: Fix transient failures in ITestAbfsStreamStatistics and ITestAbfsRestOperationException #3341
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
Changes from 4 commits
1c28597
db02e3b
4071216
dc2f22e
b0b3aac
c78d183
5f5b332
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 |
|---|---|---|
|
|
@@ -30,30 +30,34 @@ | |
| */ | ||
| public class RetryTestTokenProvider implements CustomTokenProviderAdaptee { | ||
|
|
||
| // Need to track first token fetch otherwise will get counted as a retry too. | ||
| private static boolean isThisFirstTokenFetch = true; | ||
| public static int reTryCount = 0; | ||
| private static final Logger LOG = LoggerFactory.getLogger( | ||
| RetryTestTokenProvider.class); | ||
|
|
||
| private static final Logger LOG = LoggerFactory | ||
| .getLogger(RetryTestTokenProvider.class); | ||
| // Need to track first token fetch otherwise will get counted as a retry too. | ||
| private boolean isThisFirstTokenFetch = true; | ||
| private int retryCount = 0; | ||
|
|
||
| @Override | ||
| public void initialize(Configuration configuration, String accountName) | ||
| throws IOException { | ||
|
|
||
| } | ||
|
|
||
| public static void ResetStatusToFirstTokenFetch() { | ||
| /** | ||
| * Clear earlier retry details and reset RetryTestTokenProvider instance to | ||
| * state of first access token fetch call | ||
|
||
| */ | ||
| public void resetStatusToFirstTokenFetch() { | ||
steveloughran marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| isThisFirstTokenFetch = true; | ||
| reTryCount = 0; | ||
| retryCount = 0; | ||
| } | ||
|
|
||
| @Override | ||
| public String getAccessToken() throws IOException { | ||
| if (isThisFirstTokenFetch) { | ||
| isThisFirstTokenFetch = false; | ||
| } else { | ||
| reTryCount++; | ||
| retryCount++; | ||
| } | ||
|
|
||
| LOG.debug("RetryTestTokenProvider: Throw an exception in fetching tokens"); | ||
|
|
@@ -64,4 +68,13 @@ public String getAccessToken() throws IOException { | |
| public Date getExpiryTime() { | ||
| return new Date(); | ||
| } | ||
|
|
||
| public static RetryTestTokenProvider getCurrentRetryTestProviderInstance( | ||
| AccessTokenProvider customTokenProvider) { | ||
| return (RetryTestTokenProvider) ((CustomTokenProviderAdapter) customTokenProvider).getCustomTokenProviderAdaptee(); | ||
| } | ||
|
|
||
| public int getRetryCount() { | ||
| return retryCount; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.