You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by he...@apache.org on 2021/03/08 04:20:52 UTC
[hadoop] branch trunk updated: HDFS-15384. Document
getLocatedBlocks(String src,
long start) of DFSClient only return partial blocks. Contributed by Yang
Yun.
This is an automated email from the ASF dual-hosted git repository.
hexiaoqiao pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 4a0b7f7 HDFS-15384. Document getLocatedBlocks(String src, long start) of DFSClient only return partial blocks. Contributed by Yang Yun.
4a0b7f7 is described below
commit 4a0b7f7ebe107e4124b2679a6e1b1450df66dd7e
Author: He Xiaoqiao <he...@apache.org>
AuthorDate: Mon Mar 8 12:18:46 2021 +0800
HDFS-15384. Document getLocatedBlocks(String src, long start) of DFSClient only return partial blocks. Contributed by Yang Yun.
---
.../src/main/java/org/apache/hadoop/hdfs/DFSClient.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index c2b03cd..f568308 100755
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -861,6 +861,18 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
return dfsClientConf.getRefreshReadBlockLocationsMS();
}
+ /**
+ * Get locations of the blocks of the specified file `src` from offset
+ * `start` within the prefetch size which is related to parameter
+ * `dfs.client.read.prefetch.size`. DataNode locations for each block are
+ * sorted by the proximity to the client. Please note that the prefetch size
+ * is not equal file length generally.
+ *
+ * @param src the file path.
+ * @param start starting offset.
+ * @return LocatedBlocks
+ * @throws IOException
+ */
public LocatedBlocks getLocatedBlocks(String src, long start)
throws IOException {
return getLocatedBlocks(src, start, dfsClientConf.getPrefetchSize());
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org