|
@@ -67,6 +67,9 @@ import org.apache.hadoop.util.Progressable;
|
|
|
import org.apache.hadoop.util.ReflectionUtils;
|
|
|
import org.apache.hadoop.util.ShutdownHookManager;
|
|
|
import org.apache.hadoop.util.StringUtils;
|
|
|
+import org.apache.htrace.Span;
|
|
|
+import org.apache.htrace.Trace;
|
|
|
+import org.apache.htrace.TraceScope;
|
|
|
|
|
|
import com.google.common.annotations.VisibleForTesting;
|
|
|
|
|
@@ -2676,10 +2679,19 @@ public abstract class FileSystem extends Configured implements Closeable {
|
|
|
|
|
|
private static FileSystem createFileSystem(URI uri, Configuration conf
|
|
|
) throws IOException {
|
|
|
- Class<?> clazz = getFileSystemClass(uri.getScheme(), conf);
|
|
|
- FileSystem fs = (FileSystem)ReflectionUtils.newInstance(clazz, conf);
|
|
|
- fs.initialize(uri, conf);
|
|
|
- return fs;
|
|
|
+ TraceScope scope = Trace.startSpan("FileSystem#createFileSystem");
|
|
|
+ Span span = scope.getSpan();
|
|
|
+ if (span != null) {
|
|
|
+ span.addKVAnnotation("scheme", uri.getScheme());
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ Class<?> clazz = getFileSystemClass(uri.getScheme(), conf);
|
|
|
+ FileSystem fs = (FileSystem)ReflectionUtils.newInstance(clazz, conf);
|
|
|
+ fs.initialize(uri, conf);
|
|
|
+ return fs;
|
|
|
+ } finally {
|
|
|
+ scope.close();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/** Caching FileSystem objects */
|