@@ -133,10 +133,10 @@ class SparkHadoopUtil extends Logging {
133133 * statistics are only available as of Hadoop 2.5 (see HADOOP-10688).
134134 * Returns None if the required method can't be found.
135135 */
136- private [spark] def getFSBytesReadOnThreadCallback (path : Path , conf : Configuration )
136+ private [spark] def getFSBytesReadOnThreadCallback (conf : Configuration )
137137 : Option [() => Long ] = {
138138 try {
139- val threadStats = getFileSystemThreadStatistics(path, conf)
139+ val threadStats = getFileSystemThreadStatistics(conf)
140140 val getBytesReadMethod = getFileSystemThreadStatisticsMethod(" getBytesRead" )
141141 val f = () => threadStats.map(getBytesReadMethod.invoke(_).asInstanceOf [Long ]).sum
142142 val baselineBytesRead = f()
@@ -156,10 +156,10 @@ class SparkHadoopUtil extends Logging {
156156 * statistics are only available as of Hadoop 2.5 (see HADOOP-10688).
157157 * Returns None if the required method can't be found.
158158 */
159- private [spark] def getFSBytesWrittenOnThreadCallback (path : Path , conf : Configuration )
159+ private [spark] def getFSBytesWrittenOnThreadCallback (conf : Configuration )
160160 : Option [() => Long ] = {
161161 try {
162- val threadStats = getFileSystemThreadStatistics(path, conf)
162+ val threadStats = getFileSystemThreadStatistics(conf)
163163 val getBytesWrittenMethod = getFileSystemThreadStatisticsMethod(" getBytesWritten" )
164164 val f = () => threadStats.map(getBytesWrittenMethod.invoke(_).asInstanceOf [Long ]).sum
165165 val baselineBytesWritten = f()
@@ -172,10 +172,8 @@ class SparkHadoopUtil extends Logging {
172172 }
173173 }
174174
175- private def getFileSystemThreadStatistics (path : Path , conf : Configuration ): Seq [AnyRef ] = {
176- val qualifiedPath = path.getFileSystem(conf).makeQualified(path)
177- val scheme = qualifiedPath.toUri().getScheme()
178- val stats = FileSystem .getAllStatistics().filter(_.getScheme().equals(scheme))
175+ private def getFileSystemThreadStatistics (conf : Configuration ): Seq [AnyRef ] = {
176+ val stats = FileSystem .getAllStatistics()
179177 stats.map(Utils .invoke(classOf [Statistics ], _, " getThreadStatistics" ))
180178 }
181179
0 commit comments