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 131131public abstract class AbfsClient implements Closeable {
132132 public static final Logger LOG = LoggerFactory .getLogger (AbfsClient .class );
133133 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" ;
134135
135136 private final URL baseUrl ;
136137 private final SharedKeyCredentials sharedKeyCredentials ;
@@ -260,7 +261,7 @@ private AbfsClient(final URL baseUrl,
260261 }
261262 if (isMetricCollectionEnabled ) {
262263 this .timer = new Timer (
263- "abfs-timer-client" , true );
264+ ABFS_CLIENT_TIMER_THREAD_NAME , true );
264265 timer .schedule (new TimerTaskImpl (),
265266 metricIdlePeriod ,
266267 metricIdlePeriod );
@@ -1598,7 +1599,7 @@ KeepAliveCache getKeepAliveCache() {
15981599 }
15991600
16001601 @ VisibleForTesting
1601- Timer getTimer () {
1602+ protected Timer getTimer () {
16021603 return timer ;
16031604 }
16041605
Original file line number Diff line number Diff line change 3535import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_METRIC_ACCOUNT_KEY ;
3636import static org .apache .hadoop .fs .azurebfs .constants .ConfigurationKeys .FS_AZURE_METRIC_ACCOUNT_NAME ;
3737import 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 ;
3839
3940public class TestAbfsClient {
4041 private static final String ACCOUNT_NAME = "bogusAccountName.dfs.core.windows.net" ;
@@ -61,7 +62,7 @@ public void testTimerNotInitialize() throws Exception {
6162 .isNull ();
6263
6364 // 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 ))
6566 .describedAs ("Expected thread 'abfs-timer-client' not found" )
6667 .isEqualTo (false );
6768 client .close ();
@@ -91,7 +92,7 @@ public void testTimerInitialize() throws Exception {
9192 .isNotNull ();
9293
9394 // 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 ))
9596 .describedAs ("Expected thread 'abfs-timer-client' not found" )
9697 .isEqualTo (true );
9798 client .close ();
You can’t perform that action at this time.
0 commit comments