首页 \ 问答 \ 用于在HDFS上存储文件的命令(Command to store File on HDFS)

用于在HDFS上存储文件的命令(Command to store File on HDFS)

介绍

已经安装并运行了Hadoop NameNode和三个DataNode。 下一步是向HDFS提供文件。 已执行以下命令:

hadoop fs -copyFromLocal ubuntu-14.04-desktop-amd64.iso
copyFromLocal: `.': No such file or directory

hadoop fs -put ubuntu-14.04-desktop-amd64.iso
put: `.': No such file or directory

没有成功。

需要发出哪个命令才能在HDFS上存储文件?


Introduction

A Hadoop NameNode and three DataNodes have been installed and are running. The next step is to provide a File to HDFS. The following commands have been executed:

hadoop fs -copyFromLocal ubuntu-14.04-desktop-amd64.iso
copyFromLocal: `.': No such file or directory

and

hadoop fs -put ubuntu-14.04-desktop-amd64.iso
put: `.': No such file or directory

without succes.

Question

Which command needs to be issued in order to store a file on HDFS?


原文:https://stackoverflow.com/questions/24062440
更新时间:2022-10-11 22:10

最满意答案

与C ++标准库容器(例如std::vector )不同,Qt容器要求值类型是默认可构造的。

也就是说,你的类型LibraryRecord也必须有一个默认的构造函数(你所显示的构造函数,它需要参数,不是默认的构造函数)。


Unlike the C++ Standard Library containers (e.g. std::vector), the Qt containers require that the value type be default constructible.

That is, your type LibraryRecord must also have a default constructor (the constructor that you show, which requires arguments, is not a default constructor).

相关问答

更多
  • 在评论中很难对代码进行格式化,因此我将其添加为一个答案,即使它可能无法解决您的问题。 无论如何,它对于评论的结果也相当长。 要解决未定义的行为,并确保不需要进行任何额外的分配,可以预先分配向量中的元素数量。 当您调用resize(0) ,您已经这样做了,但不是设置真正需要的大小,而是将大小设置为零,将矢量设置为空。 我会建议像这样的东西: 按照Richard Critten的建议,首先使用std::unique_ptr : QVector < QVector < std::unique_ptr
  • 这个问题的答案来自另一个SO问题 。 问题是我没有创建类的实例,而是在NULL对象上调用代码。 更多细节 The answer to this question came from another SO Question. The problem was I was not creating an instance of the class and the code was getting called on a NULL object. More Details
  • 这是因为它们在C ++ 11标准中的定义方式。 第23.3.6.1段规定了其签字: template void emplace_back(Args&&... args); void push_back(const T& x); void push_back(T&& x); 虽然push_back()的可用重载参数没有任何volatile限定,但emplace_back()函数模板的参数可以使用任何cv emplace_back()绑定到lvalues。 但是,emplace ...
  • 这里: float turtleScale = 20; Point turtlePos = Point(300./turtleScale,200./turtleScale); LinePoint* lp = new LinePoint(turtlePos,BLACK); vector lines; ...你使用初始化,但是这个: lines.push_back(lp); ...是一个声明! 它必须生活在一个功能:) int main() { lines.push_bac ...
  • 与C ++标准库容器(例如std::vector )不同,Qt容器要求值类型是默认可构造的。 也就是说,你的类型LibraryRecord也必须有一个默认的构造函数(你所显示的构造函数,它需要参数,不是默认的构造函数)。 Unlike the C++ Standard Library containers (e.g. std::vector), the Qt containers require that the value type be default constructible. That is, y ...
  • 这个问题来自vector和list之间的内部实现的差异。 首先, list是双向链表,因此list可以增长而不需要原始元素的副本。 但是vector是动态分配的数组。 如果vector容量已满,则vector分配具有更大大小的新数组( 数组加倍 ),并将元素从旧数组复制到新数组。 下面的代码段显示了断言发生的原因。 (也许) #include #include #include class Texture { public: Texture() ...
  • 答案比思想更简单...问题是,在For循环中Bin的计算中出现了错误的值。 它不应该添加ori[k] ,而应该是ori[k]的乘法。 那里的错误导致bin值为52.但是temphist指向的数组的长度是38。 对于所有有类似错误的人,我真的推荐使用GuardMalloc或Valgrind来调试Malloc错误。 Answer is simpler as thought... The Problem was, that in the calculation of Bin in the For-loop the ...
  • 你无法修改x2的原因是它被声明为const ,正如@dasblinkenlight所指出的那样。 @songyuanyao的注释是正确的,因为访问迭代器引用的对象,但没有完全回答这个问题,因为它没有说为什么 set迭代器只允许const访问。 这样做的原因是,正如您所知, std::set是一个有序容器,其结构是通过使用(默认情况下) operator <来比较条目来确定的。 这意味着有一个容器不变量,这样如果一个项目在std::set中的另一个项目b之前,那么它就是!(b < a) 。 我这样说是因为这也 ...
  • 当push_back进入向量时,如果向量需要分配更多内存,则无效对其中元素的所有引用。 在你的情况下, itr在push_back之后变为无效。 一种解决方案是将集合添加到单独的列表(向量),然后在for循环后立即将它们全部附加: vector > add; for (int ctr = 0; ctr < list.size(); ctr++) { for (set::iterator itr = list[ctr].begin(); itr != list[ctr].e ...
  • 不需要您的默认构造函数。 成员将由编译器生成的默认构造函数默认构造。 即使你有自己的构造函数,也不需要默认构造任何非POD成员。 POD成员是普通的旧数据类型,如int或bool[5] 。 任何类或结构都将默认为您构建,因此无需显式执行。 不需要复制构造函数。 编译器会为您生成一个。 赋值运算符和析构函数也是如此。 这是使用正确设计的C ++类的好处。 您只需使用它们,编译器就会为您生成所有样板代码。 如果你提供三个中的 任何一个:析构函数,复制构造函数,赋值运算符,你必须提供所有这三个 。 使用C ++ ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)