{"action":"created","issue":{"url":"https://api.github.com/repos/cerndb/hdfs-metadata/issues/2","repository_url":"https://api.github.com/repos/cerndb/hdfs-metadata","labels_url":"https://api.github.com/repos/cerndb/hdfs-metadata/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/cerndb/hdfs-metadata/issues/2/comments","events_url":"https://api.github.com/repos/cerndb/hdfs-metadata/issues/2/events","html_url":"https://github.com/cerndb/hdfs-metadata/issues/2","id":225598335,"number":2,"title":"How to find small files(size smaller than block size)?","user":{"login":"jiangshouzhuang","id":19518068,"avatar_url":"https://avatars3.githubusercontent.com/u/19518068?v=3","gravatar_id":"","url":"https://api.github.com/users/jiangshouzhuang","html_url":"https://github.com/jiangshouzhuang","followers_url":"https://api.github.com/users/jiangshouzhuang/followers","following_url":"https://api.github.com/users/jiangshouzhuang/following{/other_user}","gists_url":"https://api.github.com/users/jiangshouzhuang/gists{/gist_id}","starred_url":"https://api.github.com/users/jiangshouzhuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiangshouzhuang/subscriptions","organizations_url":"https://api.github.com/users/jiangshouzhuang/orgs","repos_url":"https://api.github.com/users/jiangshouzhuang/repos","events_url":"https://api.github.com/users/jiangshouzhuang/events{/privacy}","received_events_url":"https://api.github.com/users/jiangshouzhuang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-02T06:04:43Z","updated_at":"2017-05-02T07:53:46Z","closed_at":null,"body":"I think the hdfs-metadata project is great. It show us a detailed view of meta data information about data blocks and replicas stored into HDFS.\r\nBut in my project, I want to find the small files(size smaller than block size) on HDFS, What can I do, please give me a hand, thank you!"},"comment":{"url":"https://api.github.com/repos/cerndb/hdfs-metadata/issues/comments/298537079","html_url":"https://github.com/cerndb/hdfs-metadata/issues/2#issuecomment-298537079","issue_url":"https://api.github.com/repos/cerndb/hdfs-metadata/issues/2","id":298537079,"user":{"login":"dlanza1","id":9514662,"avatar_url":"https://avatars3.githubusercontent.com/u/9514662?v=3","gravatar_id":"","url":"https://api.github.com/users/dlanza1","html_url":"https://github.com/dlanza1","followers_url":"https://api.github.com/users/dlanza1/followers","following_url":"https://api.github.com/users/dlanza1/following{/other_user}","gists_url":"https://api.github.com/users/dlanza1/gists{/gist_id}","starred_url":"https://api.github.com/users/dlanza1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlanza1/subscriptions","organizations_url":"https://api.github.com/users/dlanza1/orgs","repos_url":"https://api.github.com/users/dlanza1/repos","events_url":"https://api.github.com/users/dlanza1/events{/privacy}","received_events_url":"https://api.github.com/users/dlanza1/received_events","type":"User","site_admin":false},"created_at":"2017-05-02T07:53:46Z","updated_at":"2017-05-02T07:53:46Z","body":"Hi @jiangshouzhuang ,\r\n\r\nYou would need to go through all files looping similarly as I am doing here: https://github.com/cerndb/hdfs-metadata/blob/master/src/main/java/ch/cern/db/hdfs/DistributedFileSystemMetadata.java#L174\r\n\r\nYou would need to compare file size with block size checking if file size is smaller.\r\n\r\nIf main class extends Configured and implements Tool, you could get configured default block size from getConf() method. Block size can be different per file, you can get configured block size of each file once you get its FileStatus.\r\n\r\nHope it helps."}}
{"actor":{"display_login":"dlanza1"}}