首页 \ 问答 \ 为什么没有'hadoop fs -head'shell命令?(Why is there no 'hadoop fs -head' shell command?)

为什么没有'hadoop fs -head'shell命令?(Why is there no 'hadoop fs -head' shell command?)

在HDFS上检查文件的快速方法是使用尾部 :

~$ hadoop fs -tail /path/to/file

这显示文件中最后一千字节的数据,这是非常有用的。 但是,相反的命令head似乎不是shell命令集合的一部分。 我觉得这很奇怪。

我的假设是,由于HDFS是为非常大的文件上的非常快速的流读取而构建的,因此存在着一些面向访问的问题。 这让我犹豫着去做头脑。 有人有答案吗?


A fast method for inspecting files on HDFS is to use tail:

~$ hadoop fs -tail /path/to/file

This displays the last kilobyte of data in the file, which is extremely helpful. However, the opposite command head does not appear to be part of the shell command collections. I find this very surprising.

My hypothesis is that since HDFS is built for very fast streaming reads on very large files, there is some access-oriented issue that affects head. This makes me hesitant to do things to access the head. Does anyone have an answer?


原文:https://stackoverflow.com/questions/19778137
更新时间:2023-09-04 17:09

最满意答案

如果我们把所有这些都移到GitHub上,每个用户是否必须下载250MB,或者他们是否必须下载1GB或更多才能获得存储库的完整历史记录?

当第一次克隆时,每个用户都必须检索整个存储库。 但是,git服务器端实现会将存储库的“压缩”版本作为packfile发送 。 因此传输的数据的重量远小于1Gb。

每个连续的提取/拉取操作只会检索服务器知道的并且尚未在客户端的本地存储库中的新git对象(提交,树和Blob)。 那些也将作为packfile通过线路发送。


尽管@akonsu在说明您可以克隆存储库的浅版本时是正确的(即没有整个历史记录),但这会阻止用户与GitHub托管的主上游存储库进一步交互。

实际上, git clone文档指出: “一个浅的存储库有许多限制(你不能克隆或获取它,也不能从中推送或推入它)”


If we moved all this over to GitHub, would each user have to download the 250MBs or would they have to download 1GB or more to get the full history of the repository?

Each of the users, when cloning for the first time, would have to retrieve the whole repository. However, git server side implementation would send a "compressed" version of the repository as a packfile. So the transmitted data would weight much less than 1Gb.

Each successive fetch/pull operation would only retrieve the new git objects (Commits, Trees and Blobs) that the server knows about and that are not already on the client's local repository. Those would also be sent over the wire as a packfile.


Although @akonsu is correct when stating you can clone a shallow version of your repository (ie. without the whole history), that would prevent the user from further interacting with a GitHub hosted main upstream repository.

Indeed the git clone documentation states: "A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it)"

相关问答

更多
  • 正如回购所有者所指出的那样,这是不可能的: 目前不支持私人回购。 只有公共回购中的PITCHME才能呈现为幻灯片演示。 有关私人回购的问题#26 As has been noted by the repo owner, that is not possible: private repos are not currently supported. Only PITCHME in public repos can be rendered as slideshow presentations. Question ...
  • 通常,您创建一个密钥对,并对多个存储库使用相同的公钥。 这不是一件坏事! 如果您有任何理由使用多个密钥,可以按照此处所述进行设置: 多个SSH密钥 In general you create a single key pair and use the same public key for multiple repositories. This is not a bad thing! If you have any reason to use multiple keys you can set it up ...
  • 如果我们把所有这些都移到GitHub上,每个用户是否必须下载250MB,或者他们是否必须下载1GB或更多才能获得存储库的完整历史记录? 当第一次克隆时,每个用户都必须检索整个存储库。 但是,git服务器端实现会将存储库的“压缩”版本作为packfile发送 。 因此传输的数据的重量远小于1Gb。 每个连续的提取/拉取操作只会检索服务器知道的并且尚未在客户端的本地存储库中的新git对象(提交,树和Blob)。 那些也将作为packfile通过线路发送。 尽管@akonsu在说明您可以克隆存储库的浅版本时是正确 ...
  • 对不起,我忘了指定我只使用网络界面。 我找到了我的解决方案:只需创建一个带有子目录树的新文件,如下例所示:“maindir / subdir1 / subdir2 / file.txt”。 Github将自动创建子文件夹。 但这不是一个好的解决方案,因为它与“问题”概念无关,问题只附加在“根”文件夹中。 最后,我选择了另一个解决方案。 我使用前缀。 谢谢你的帮助。 Sorry I forgot to specify that I only use the web interface. I found my ...
  • 在https://github.com/settings/repositories页面,您应该会看到您被邀请到的存储库旁边的“离开”按钮。 At the page https://github.com/settings/repositories you should see a "Leave" button next to the repositories you have been invited to.
  • 默认情况下,接受ListOptions参数的所有命令都具有PerPage属性。 为了获取所有数据,您必须使用Page属性迭代页面,直到获得的结果数小于PerPage 。 在Go-ish伪代码中,它看起来像这样: totalResults := []Result{} for page := 0; ; page++ { results := fetch current page totalResults = append(totalResults, results) if len(results) ...
  • 使用DVCS,分支和发布(推/拉)是两个正交的概念 。 这意味着你不应该关心你的合作者正在推动哪些分支,只要他们在GitHub上推送他们自己的(分叉的)私人回购。 您是唯一能够在您的私人仓库中导入您选择的分支(通过拉取请求 )的人。 当我看到生命周期步骤(“staging”,“testing”,“QA”,“...”)时,我更喜欢为我需要的每个步骤设置一个单独的repo,以便在每个步骤中拥有尽可能多的分支那些单独的回购。 With a DVCS, branching and publication (push ...
  • 从/repositories获取所有公共存储库。 作为响应,您将获得所有者的名称以及存储库名称,然后在每个存储库上使用Get 。 在对每个存储库的响应中,字段stargazers_count会为您提供每个存储库具有的明星数量。 一些示例python代码: import requests public_repos = requests.get('https://api.github.com/repositories').json() for repo in public_repos: repo_na ...
  • 这是一个已知的gogs限制。 这个问题可以在这里跟踪。 可以通过为git存储库数据构建缓存系统来解决此问题。 This is a known limitation of gogs. The issue can be tracked here. This issue can be rectified by building a cache system for git repository data.
  • 正如您在文档中所见 : 为满足这一需求,GitHub Search API 为每次搜索提供最多1,000个结果。 所以这是一种预期的行为。 你很幸运得到1020而不是1000 :) As you can find in the documentation: To satisfy that need, the GitHub Search API provides up to 1,000 results for each search. So this is an expected behavior. You' ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。