为什么没有'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
最满意答案
如果我们把所有这些都移到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 ...
-
github上有多个存储库(Multiple repositories on github)[2021-11-05]
通常,您创建一个密钥对,并对多个存储库使用相同的公钥。 这不是一件坏事! 如果您有任何理由使用多个密钥,可以按照此处所述进行设置: 多个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 ...
-
Github API:如何按星数排序公共存储库?(Github API: How to sort public repositories by count of stars?)[2021-09-12]
从/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' ...