Hadoop разница между пут и копировать из локального - PullRequest
0 голосов
/ 12 сентября 2018

CopyFromLocal будет загружать данные из локальной файловой системы.

Do put будет загружать данные из любого fs, например.Местный фс, амазон с3 или только из местного фс ???

Ответы [ 2 ]

0 голосов
/ 12 сентября 2018

Они идентичны (согласно extends Put, плюс никакие другие методы или условные обозначения в противном случае). И на этот ответ у этого класса CopyCommands.java не было новых коммитов с 2014 года.

  public static class CopyFromLocal extends Put {
        public static final String NAME = "copyFromLocal";
        public static final String USAGE = Put.USAGE;
        public static final String DESCRIPTION = "Identical to the -put command.";
  }

Пожалуйста, кто-нибудь даст все имена файловых систем, которые могут получать / помещать данные, используя команду "hadoop fs-put"

Любая Файловая система, совместимая с Hadoop (HCFS) поддерживается с помощью команд hadoop fs. * HD7 поддерживается только hdfs dfs

0 голосов
/ 12 сентября 2018

Пожалуйста, найдите использование обеих команд.

put
=======
Usage: hadoop fs -put [-f] [-p] [-l] [-d] [ - | <localsrc1> .. ]. <dst>

Copy single src, or multiple srcs from local file system to the destination file system. Also reads input from stdin and writes to destination file system if the source is set to “-”

Copying fails if the file already exists, unless the -f flag is given.

Options:

-p : Preserves access and modification times, ownership and the permissions. (assuming the permissions can be propagated across filesystems)
-f : Overwrites the destination if it already exists.
-l : Allow DataNode to lazily persist the file to disk, Forces a replication factor of 1. This flag will result in reduced durability. Use with care.
-d : Skip creation of temporary file with the suffix ._COPYING_.
Examples:

hadoop fs -put localfile /user/hadoop/hadoopfile
hadoop fs -put -f localfile1 localfile2 /user/hadoop/hadoopdir
hadoop fs -put -d localfile hdfs://nn.example.com/hadoop/hadoopfile
hadoop fs -put - hdfs://nn.example.com/hadoop/hadoopfile Reads the input from stdin.
Exit Code:

Returns 0 on success and -1 on error.

copyFromLocal
=============

Usage: hadoop fs -copyFromLocal <localsrc> URI

Similar to the fs -put command, except that the source is restricted to a local file reference.

Options:

-p : Preserves access and modification times, ownership and the permissions. (assuming the permissions can be propagated across filesystems)
-f : Overwrites the destination if it already exists.
-l : Allow DataNode to lazily persist the file to disk, Forces a replication factor of 1. This flag will result in reduced durability. Use with care.
-d : Skip creation of temporary file with the suffix ._COPYING_.
...