|
@@ -18,8 +18,13 @@
|
|
|
package org.apache.hadoop.tracing;
|
|
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
+
|
|
|
+import java.net.URI;
|
|
|
import java.util.LinkedList;
|
|
|
import org.apache.hadoop.conf.Configuration;
|
|
|
+import org.apache.hadoop.fs.FileSystem;
|
|
|
+import org.apache.hadoop.fs.LocalFileSystem;
|
|
|
+import org.apache.hadoop.fs.Path;
|
|
|
import org.apache.hadoop.tracing.SpanReceiverInfo.ConfigurationPair;
|
|
|
import org.apache.htrace.core.HTraceConfiguration;
|
|
|
import org.junit.Test;
|
|
@@ -50,4 +55,17 @@ public class TestTraceUtils {
|
|
|
HTraceConfiguration wrapped = TraceUtils.wrapHadoopConf(TEST_PREFIX, conf, extraConfig);
|
|
|
assertEquals(newValue, wrapped.get(key));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Test tracing the globber. This is a regression test for HDFS-9187.
|
|
|
+ */
|
|
|
+ @Test
|
|
|
+ public void testTracingGlobber() throws Exception {
|
|
|
+ // Bypass the normal FileSystem object creation path by just creating an
|
|
|
+ // instance of a subclass.
|
|
|
+ FileSystem fs = new LocalFileSystem();
|
|
|
+ fs.initialize(new URI("file:///"), new Configuration());
|
|
|
+ fs.globStatus(new Path("/"));
|
|
|
+ fs.close();
|
|
|
+ }
|
|
|
}
|