From aa92072b54e308e74b082329bedef49af3d79e16 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Mon, 11 Feb 2013 21:10:23 +0000 Subject: [PATCH] HDFS-4453. Make a simple doc to describe the usage and design of the shortcircuit read feature. Contributed by Colin Patrick McCabe. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-347@1444963 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop-hdfs/CHANGES.HDFS-347.txt | 2 + .../site/apt/ShortCircuitLocalReads.apt.vm | 68 +++++++++++++++++++ hadoop-project/src/site/site.xml | 2 + 3 files changed, 72 insertions(+) create mode 100644 hadoop-hdfs-project/hadoop-hdfs/src/site/apt/ShortCircuitLocalReads.apt.vm diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt index 37c93d9589c..5be58b3f013 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-347.txt @@ -43,3 +43,5 @@ HDFS-4440. Avoid annoying log message when dfs.domain.socket.path is not set. (C HDFS-4473. Don't create domain socket unless we need it. (Colin Patrick McCabe via atm) HDFS-4485. DN should chmod socket path a+w. (Colin Patrick McCabe via atm) + +HDFS-4453. Make a simple doc to describe the usage and design of the shortcircuit read feature. (Colin Patrick McCabe via atm) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/ShortCircuitLocalReads.apt.vm b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/ShortCircuitLocalReads.apt.vm new file mode 100644 index 00000000000..6792f156b38 --- /dev/null +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/ShortCircuitLocalReads.apt.vm @@ -0,0 +1,68 @@ + +~~ Licensed under the Apache License, Version 2.0 (the "License"); +~~ you may not use this file except in compliance with the License. +~~ You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, software +~~ distributed under the License is distributed on an "AS IS" BASIS, +~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~~ See the License for the specific language governing permissions and +~~ limitations under the License. See accompanying LICENSE file. + + --- + Hadoop Distributed File System-${project.version} - Short-Circuit Local Reads + --- + --- + ${maven.build.timestamp} + +HDFS Short-Circuit Local Reads + + \[ {{{./index.html}Go Back}} \] + +%{toc|section=1|fromDepth=0} + +* {Background} + + In <<>>, reads normally go through the <<>>. Thus, when the + client asks the <<>> to read a file, the <<>> reads that + file off of the disk and sends the data to the client over a TCP socket. + So-called "short-circuit" reads bypass the <<>>, allowing the client + to read the file directly. Obviously, this is only possible in cases where + the client is co-located with the data. Short-circuit reads provide a + substantial performance boost to many applications. + +* {Configuration} + + To configure short-circuit local reads, you will need to enable + <<>>. See + {{{../hadoop-common/NativeLibraries.html}Native + Libraries}} for details on enabling this library. + + Short-circuit reads make use of a UNIX domain socket. This is a special path + in the filesystem that allows the client and the DataNodes to communicate. + You will need to set a path to this socket. The DataNode needs to be able to + create this path. On the other hand, it should not be possible for any user + except the hdfs user or root to create this path. For this reason, paths + under <<>> or <<>> are often used. + + Short-circuit local reads need to be configured on both the <<>> + and the client. + +* {Example Configuration} + + Here is an example configuration. + +---- + + + dfs.client.read.shortcircuit + true + + + dfs.domain.socket.path + /var/lib/hadoop-hdfs/dn_socket + + +---- diff --git a/hadoop-project/src/site/site.xml b/hadoop-project/src/site/site.xml index 2cfe2e8c456..31620b90eff 100644 --- a/hadoop-project/src/site/site.xml +++ b/hadoop-project/src/site/site.xml @@ -61,6 +61,8 @@ +