Skip to content

Commit 45f164a

Browse files
committed
Revert "HADOOP-17873. ABFS: Fix transient failures in ITestAbfsStreamStatistics and ITestAbfsRestOperationException (#3341)"
This reverts commit 82658a2.
1 parent e1ac10c commit 45f164a

File tree

7 files changed

+13
-51
lines changed

7 files changed

+13
-51
lines changed

hadoop-tools/hadoop-azure/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@
555555
<exclude>**/azurebfs/ITestAzureBlobFileSystemListStatus.java</exclude>
556556
<exclude>**/azurebfs/extensions/ITestAbfsDelegationTokens.java</exclude>
557557
<exclude>**/azurebfs/ITestSmallWriteOptimization.java</exclude>
558-
<exclude>**/azurebfs/ITestAbfsStreamStatistics*.java</exclude>
559558
<exclude>**/azurebfs/services/ITestReadBufferManager.java</exclude>
560559
</excludes>
561560

@@ -598,7 +597,6 @@
598597
<include>**/azurebfs/extensions/ITestAbfsDelegationTokens.java</include>
599598
<include>**/azurebfs/ITestSmallWriteOptimization.java</include>
600599
<include>**/azurebfs/services/ITestReadBufferManager.java</include>
601-
<include>**/azurebfs/ITestAbfsStreamStatistics*.java</include>
602600
</includes>
603601
</configuration>
604602
</execution>

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/oauth2/CustomTokenProviderAdapter.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.io.IOException;
2323
import java.net.URI;
2424

25-
import org.apache.hadoop.thirdparty.com.google.common.annotations.VisibleForTesting;
2625
import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions;
2726
import org.slf4j.Logger;
2827
import org.slf4j.LoggerFactory;
@@ -139,9 +138,4 @@ public String getUserAgentSuffix() {
139138
String suffix = ExtensionHelper.getUserAgentSuffix(adaptee, "");
140139
return suffix != null ? suffix : "";
141140
}
142-
143-
@VisibleForTesting
144-
protected CustomTokenProviderAdaptee getCustomTokenProviderAdaptee() {
145-
return adaptee;
146-
}
147141
}

hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsClient.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,9 +1223,4 @@ public ListenableFuture<?> submit(Runnable runnable) {
12231223
public <V> void addCallback(ListenableFuture<V> future, FutureCallback<V> callback) {
12241224
Futures.addCallback(future, callback, executorService);
12251225
}
1226-
1227-
@VisibleForTesting
1228-
protected AccessTokenProvider getTokenProvider() {
1229-
return tokenProvider;
1230-
}
12311226
}

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/AbstractAbfsIntegrationTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@
3737
import org.apache.hadoop.fs.Path;
3838
import org.apache.hadoop.fs.azurebfs.constants.FSOperationType;
3939
import org.apache.hadoop.fs.azurebfs.contracts.exceptions.AzureBlobFileSystemException;
40-
import org.apache.hadoop.fs.azurebfs.oauth2.AccessTokenProvider;
4140
import org.apache.hadoop.fs.azurebfs.security.AbfsDelegationTokenManager;
4241
import org.apache.hadoop.fs.azurebfs.services.AbfsClient;
4342
import org.apache.hadoop.fs.azurebfs.services.AbfsOutputStream;
4443
import org.apache.hadoop.fs.azurebfs.services.AuthType;
45-
import org.apache.hadoop.fs.azurebfs.services.TestAbfsClient;
4644
import org.apache.hadoop.fs.azure.AzureNativeFileSystemStore;
4745
import org.apache.hadoop.fs.azure.NativeAzureFileSystem;
4846
import org.apache.hadoop.fs.azure.metrics.AzureFileSystemInstrumentation;
@@ -243,9 +241,6 @@ public Hashtable<String, String> call() throws Exception {
243241
}
244242
}
245243

246-
public AccessTokenProvider getAccessTokenProvider(final AzureBlobFileSystem fs) {
247-
return TestAbfsClient.getAccessTokenProvider(fs.getAbfsStore().getClient());
248-
}
249244

250245
public void loadConfiguredFileSystem() throws Exception {
251246
// disable auto-creation of filesystem

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAbfsRestOperationException.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,18 @@ public void testWithDifferentCustomTokenFetchRetry(int numOfRetries) throws Exce
111111
final AzureBlobFileSystem fs1 =
112112
(AzureBlobFileSystem) FileSystem.newInstance(fs.getUri(),
113113
config);
114-
RetryTestTokenProvider retryTestTokenProvider
115-
= RetryTestTokenProvider.getCurrentRetryTestProviderInstance(
116-
getAccessTokenProvider(fs1));
117-
retryTestTokenProvider.resetStatusToFirstTokenFetch();
114+
RetryTestTokenProvider.ResetStatusToFirstTokenFetch();
118115

119116
intercept(Exception.class,
120117
()-> {
121118
fs1.getFileStatus(new Path("/"));
122119
});
123120

124121
// Number of retries done should be as configured
125-
Assert.assertEquals(
126-
"Number of token fetch retries done does not match with fs.azure"
127-
+ ".custom.token.fetch.retry.count configured", numOfRetries,
128-
retryTestTokenProvider.getRetryCount());
122+
Assert.assertTrue(
123+
"Number of token fetch retries (" + RetryTestTokenProvider.reTryCount
124+
+ ") done, does not match with fs.azure.custom.token.fetch.retry.count configured (" + numOfRetries
125+
+ ")", RetryTestTokenProvider.reTryCount == numOfRetries);
129126
}
130127

131128
@Test

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/oauth2/RetryTestTokenProvider.java

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,30 @@
3030
*/
3131
public class RetryTestTokenProvider implements CustomTokenProviderAdaptee {
3232

33-
private static final Logger LOG = LoggerFactory.getLogger(
34-
RetryTestTokenProvider.class);
35-
3633
// Need to track first token fetch otherwise will get counted as a retry too.
37-
private boolean isThisFirstTokenFetch = true;
38-
private int retryCount = 0;
34+
private static boolean isThisFirstTokenFetch = true;
35+
public static int reTryCount = 0;
36+
37+
private static final Logger LOG = LoggerFactory
38+
.getLogger(RetryTestTokenProvider.class);
3939

4040
@Override
4141
public void initialize(Configuration configuration, String accountName)
4242
throws IOException {
4343

4444
}
4545

46-
/**
47-
* Clear earlier retry details and reset RetryTestTokenProvider instance to
48-
* state of first access token fetch call.
49-
*/
50-
public void resetStatusToFirstTokenFetch() {
46+
public static void ResetStatusToFirstTokenFetch() {
5147
isThisFirstTokenFetch = true;
52-
retryCount = 0;
48+
reTryCount = 0;
5349
}
5450

5551
@Override
5652
public String getAccessToken() throws IOException {
5753
if (isThisFirstTokenFetch) {
5854
isThisFirstTokenFetch = false;
5955
} else {
60-
retryCount++;
56+
reTryCount++;
6157
}
6258

6359
LOG.debug("RetryTestTokenProvider: Throw an exception in fetching tokens");
@@ -68,13 +64,4 @@ public String getAccessToken() throws IOException {
6864
public Date getExpiryTime() {
6965
return new Date();
7066
}
71-
72-
public static RetryTestTokenProvider getCurrentRetryTestProviderInstance(
73-
AccessTokenProvider customTokenProvider) {
74-
return (RetryTestTokenProvider) ((CustomTokenProviderAdapter) customTokenProvider).getCustomTokenProviderAdaptee();
75-
}
76-
77-
public int getRetryCount() {
78-
return retryCount;
79-
}
8067
}

hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/TestAbfsClient.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,4 @@ public static AbfsRestOperation getRestOp(AbfsRestOperationType type,
395395
url,
396396
requestHeaders);
397397
}
398-
399-
public static AccessTokenProvider getAccessTokenProvider(AbfsClient client) {
400-
return client.getTokenProvider();
401-
}
402398
}

0 commit comments

Comments
 (0)