|
@@ -15,15 +15,18 @@
|
|
|
# See the License for the specific language governing permissions and
|
|
|
# limitations under the License.
|
|
|
|
|
|
-if [[ "${HADOOP_SHELL_EXECNAME}" = hadoop
|
|
|
- || "${HADOOP_SHELL_EXECNAME}" = mapred ]]; then
|
|
|
- hadoop_add_subcommand "distcp" "copy file or directories recursively"
|
|
|
-fi
|
|
|
+if ! declare -f hadoop_subcommand_distcp >/dev/null 2>/dev/null; then
|
|
|
+
|
|
|
+ if [[ "${HADOOP_SHELL_EXECNAME}" = hadoop ]]; then
|
|
|
+ hadoop_add_subcommand "distcp" "copy file or directories recursively"
|
|
|
+ fi
|
|
|
+
|
|
|
+ # this can't be indented otherwise shelldocs won't get it
|
|
|
|
|
|
## @description distcp command for hadoop
|
|
|
## @audience public
|
|
|
## @stability stable
|
|
|
-## @replaceable no
|
|
|
+## @replaceable yes
|
|
|
function hadoop_subcommand_distcp
|
|
|
{
|
|
|
# shellcheck disable=SC2034
|
|
@@ -33,11 +36,27 @@ function hadoop_subcommand_distcp
|
|
|
HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_CLIENT_OPTS}"
|
|
|
}
|
|
|
|
|
|
+fi
|
|
|
+
|
|
|
+if ! declare -f mapred_subcommand_distcp >/dev/null 2>/dev/null; then
|
|
|
+
|
|
|
+ if [[ "${HADOOP_SHELL_EXECNAME}" = mapred ]]; then
|
|
|
+ hadoop_add_subcommand "distcp" "copy file or directories recursively"
|
|
|
+ fi
|
|
|
+
|
|
|
+ # this can't be indented otherwise shelldocs won't get it
|
|
|
+
|
|
|
## @description distcp command for mapred (calls hadoop)
|
|
|
## @audience public
|
|
|
## @stability stable
|
|
|
-## @replaceable no
|
|
|
+## @replaceable yes
|
|
|
function mapred_subcommand_distcp
|
|
|
{
|
|
|
- hadoop_subcommand_distcp
|
|
|
+ # shellcheck disable=SC2034
|
|
|
+ HADOOP_CLASSNAME=org.apache.hadoop.tools.DistCp
|
|
|
+ hadoop_add_to_classpath_tools hadoop-distcp
|
|
|
+ hadoop_debug "Appending HADOOP_CLIENT_OPTS onto HADOOP_OPTS"
|
|
|
+ HADOOP_OPTS="${HADOOP_OPTS} ${HADOOP_CLIENT_OPTS}"
|
|
|
}
|
|
|
+
|
|
|
+fi
|