File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
hadoop-tools/hadoop-azure/src
main/java/org/apache/hadoop/fs/azurebfs/services
test/java/org/apache/hadoop/fs/azurebfs/services Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 131
131
public abstract class AbfsClient implements Closeable {
132
132
public static final Logger LOG = LoggerFactory .getLogger (AbfsClient .class );
133
133
public static final String HUNDRED_CONTINUE_USER_AGENT = SINGLE_WHITE_SPACE + HUNDRED_CONTINUE + SEMICOLON ;
134
+ public static final String ABFS_CLIENT_TIMER_THREAD_NAME = "abfs-timer-client" ;
134
135
135
136
private final URL baseUrl ;
136
137
private final SharedKeyCredentials sharedKeyCredentials ;
@@ -260,7 +261,7 @@ private AbfsClient(final URL baseUrl,
260
261
}
261
262
if (isMetricCollectionEnabled ) {
262
263
this .timer = new Timer (
263
- "abfs-timer-client" , true );
264
+ ABFS_CLIENT_TIMER_THREAD_NAME , true );
264
265
timer .schedule (new TimerTaskImpl (),
265
266
metricIdlePeriod ,
266
267
metricIdlePeriod );
@@ -1598,7 +1599,7 @@ KeepAliveCache getKeepAliveCache() {
1598
1599
}
1599
1600
1600
1601
@ VisibleForTesting
1601
- Timer getTimer () {
1602
+ protected Timer getTimer () {
1602
1603
return timer ;
1603
1604
}
1604
1605
Original file line number Diff line number Diff line change 35
35
import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_METRIC_ACCOUNT_KEY ;
36
36
import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_METRIC_ACCOUNT_NAME ;
37
37
import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_METRIC_FORMAT ;
38
+ import static org .apache .hadoop .fs .azurebfs .services .AbfsClient .ABFS_CLIENT_TIMER_THREAD_NAME ;
38
39
39
40
public class TestAbfsClient {
40
41
private static final String ACCOUNT_NAME = "bogusAccountName.dfs.core.windows.net" ;
@@ -61,7 +62,7 @@ public void testTimerNotInitialize() throws Exception {
61
62
.isNull ();
62
63
63
64
// Check if a thread with the name "abfs-timer-client" exists
64
- Assertions .assertThat (isThreadRunning ("abfs-timer-client" ))
65
+ Assertions .assertThat (isThreadRunning (ABFS_CLIENT_TIMER_THREAD_NAME ))
65
66
.describedAs ("Expected thread 'abfs-timer-client' not found" )
66
67
.isEqualTo (false );
67
68
client .close ();
@@ -91,7 +92,7 @@ public void testTimerInitialize() throws Exception {
91
92
.isNotNull ();
92
93
93
94
// Check if a thread with the name "abfs-timer-client" exists
94
- Assertions .assertThat (isThreadRunning ("abfs-timer-client" ))
95
+ Assertions .assertThat (isThreadRunning (ABFS_CLIENT_TIMER_THREAD_NAME ))
95
96
.describedAs ("Expected thread 'abfs-timer-client' not found" )
96
97
.isEqualTo (true );
97
98
client .close ();
You can’t perform that action at this time.
0 commit comments