{"action":"created","comment":{"url":"https://api.github.com/repos/DataTorrent/docs/pulls/comments/43190932","id":43190932,"diff_hunk":"@@ -0,0 +1,204 @@\n+Block Reader\n+=============\n+\n+This is a scalable operator that reads and parses blocks of data sources into records.\n+\n+##Why is it needed?\n+Block reader is needed to parallelize reading and parsing of a single data source, for example a file. Simple parallelism of reading data sources can be achieved by multiple partitions reading different source of same type (for files see [AbstractFileInputOperator](https://github.com/apache/incubator-apex-malhar/blob/devel-3/library/src/main/java/com/datatorrent/lib/io/fs/AbstractFileInputOperator.java)) but Block reader partitions can read blocks of same source in parallel and parse it for records ensuring that no record is duplicated or missed.\n+\n+##Class Diagram\n+![BlockReader class diagram](images/blockreader/classdiagram.png)\n+\n+##AbstractBlockReader\n+This is the abstract implementation that serves as the base for different types of data sources. It defines how a block metadata is processed. The flow diagram   describes the processing of a block metadata.\n+![BlockReader flow diagram](images/blockreader/flowdiagram.png)\n+\n+###Ports\n+- blocksMetadataInput: input port on which block metadata are received.\n+\n+- blocksMetadataOutput: output port on which block metadata are emitted if the port is connected. This port is useful when a downstream operator that receives records from block reader may also be interested to know the details of the corresponding blocks.\n+\n+- messages: output port on which tuples of type `com.datatorrent.lib.io.block.AbstractBlockReader.ReaderRecord`. This class encapsulates a `record` and the `blockId` of the corresponding block.\n+\n+###`readerContext`\n+This is one of the most important field in the block reader. It is of type `com.datatorrent.lib.io.block.ReaderContext` and is responsible for fetching bytes that make a record. It also lets the reader know how many total bytes were consumed which may not be equal to the total bytes in a record.\n+ ","path":"docs/operators/fs/block_reader.md","position":25,"original_position":25,"commit_id":"c9fb82f19db7a4ec0f44c4fdfea0c74f2f01b4ea","original_commit_id":"c9fb82f19db7a4ec0f44c4fdfea0c74f2f01b4ea","user":{"login":"chandnisingh","id":4690923,"avatar_url":"https://avatars.githubusercontent.com/u/4690923?v=3","gravatar_id":"","url":"https://api.github.com/users/chandnisingh","html_url":"https://github.com/chandnisingh","followers_url":"https://api.github.com/users/chandnisingh/followers","following_url":"https://api.github.com/users/chandnisingh/following{/other_user}","gists_url":"https://api.github.com/users/chandnisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/chandnisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandnisingh/subscriptions","organizations_url":"https://api.github.com/users/chandnisingh/orgs","repos_url":"https://api.github.com/users/chandnisingh/repos","events_url":"https://api.github.com/users/chandnisingh/events{/privacy}","received_events_url":"https://api.github.com/users/chandnisingh/received_events","type":"User","site_admin":false},"body":"Sorry I need a tool which has spell check. I am using MacDown which doesn't.","created_at":"2015-10-27T21:34:32Z","updated_at":"2015-10-27T21:34:32Z","html_url":"https://github.com/DataTorrent/docs/pull/3#discussion_r43190932","pull_request_url":"https://api.github.com/repos/DataTorrent/docs/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/DataTorrent/docs/pulls/comments/43190932"},"html":{"href":"https://github.com/DataTorrent/docs/pull/3#discussion_r43190932"},"pull_request":{"href":"https://api.github.com/repos/DataTorrent/docs/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/DataTorrent/docs/pulls/3","id":48830704,"html_url":"https://github.com/DataTorrent/docs/pull/3","diff_url":"https://github.com/DataTorrent/docs/pull/3.diff","patch_url":"https://github.com/DataTorrent/docs/pull/3.patch","issue_url":"https://api.github.com/repos/DataTorrent/docs/issues/3","number":3,"state":"open","locked":false,"title":"SPOI-6472: Block reader tutorial","user":{"login":"chandnisingh","id":4690923,"avatar_url":"https://avatars.githubusercontent.com/u/4690923?v=3","gravatar_id":"","url":"https://api.github.com/users/chandnisingh","html_url":"https://github.com/chandnisingh","followers_url":"https://api.github.com/users/chandnisingh/followers","following_url":"https://api.github.com/users/chandnisingh/following{/other_user}","gists_url":"https://api.github.com/users/chandnisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/chandnisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandnisingh/subscriptions","organizations_url":"https://api.github.com/users/chandnisingh/orgs","repos_url":"https://api.github.com/users/chandnisingh/repos","events_url":"https://api.github.com/users/chandnisingh/events{/privacy}","received_events_url":"https://api.github.com/users/chandnisingh/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-27T05:39:17Z","updated_at":"2015-10-27T21:34:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a198444b393bd5a30159ae0fb00b249a03413abf","assignee":{"login":"ilooner","id":8020165,"avatar_url":"https://avatars.githubusercontent.com/u/8020165?v=3","gravatar_id":"","url":"https://api.github.com/users/ilooner","html_url":"https://github.com/ilooner","followers_url":"https://api.github.com/users/ilooner/followers","following_url":"https://api.github.com/users/ilooner/following{/other_user}","gists_url":"https://api.github.com/users/ilooner/gists{/gist_id}","starred_url":"https://api.github.com/users/ilooner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ilooner/subscriptions","organizations_url":"https://api.github.com/users/ilooner/orgs","repos_url":"https://api.github.com/users/ilooner/repos","events_url":"https://api.github.com/users/ilooner/events{/privacy}","received_events_url":"https://api.github.com/users/ilooner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/DataTorrent/docs/pulls/3/commits","review_comments_url":"https://api.github.com/repos/DataTorrent/docs/pulls/3/comments","review_comment_url":"https://api.github.com/repos/DataTorrent/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataTorrent/docs/issues/3/comments","statuses_url":"https://api.github.com/repos/DataTorrent/docs/statuses/c9fb82f19db7a4ec0f44c4fdfea0c74f2f01b4ea","head":{"label":"chandnisingh:SPOI-6472","ref":"SPOI-6472","sha":"c9fb82f19db7a4ec0f44c4fdfea0c74f2f01b4ea","user":{"login":"chandnisingh","id":4690923,"avatar_url":"https://avatars.githubusercontent.com/u/4690923?v=3","gravatar_id":"","url":"https://api.github.com/users/chandnisingh","html_url":"https://github.com/chandnisingh","followers_url":"https://api.github.com/users/chandnisingh/followers","following_url":"https://api.github.com/users/chandnisingh/following{/other_user}","gists_url":"https://api.github.com/users/chandnisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/chandnisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandnisingh/subscriptions","organizations_url":"https://api.github.com/users/chandnisingh/orgs","repos_url":"https://api.github.com/users/chandnisingh/repos","events_url":"https://api.github.com/users/chandnisingh/events{/privacy}","received_events_url":"https://api.github.com/users/chandnisingh/received_events","type":"User","site_admin":false},"repo":{"id":44461758,"name":"docs","full_name":"chandnisingh/docs","owner":{"login":"chandnisingh","id":4690923,"avatar_url":"https://avatars.githubusercontent.com/u/4690923?v=3","gravatar_id":"","url":"https://api.github.com/users/chandnisingh","html_url":"https://github.com/chandnisingh","followers_url":"https://api.github.com/users/chandnisingh/followers","following_url":"https://api.github.com/users/chandnisingh/following{/other_user}","gists_url":"https://api.github.com/users/chandnisingh/gists{/gist_id}","starred_url":"https://api.github.com/users/chandnisingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandnisingh/subscriptions","organizations_url":"https://api.github.com/users/chandnisingh/orgs","repos_url":"https://api.github.com/users/chandnisingh/repos","events_url":"https://api.github.com/users/chandnisingh/events{/privacy}","received_events_url":"https://api.github.com/users/chandnisingh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chandnisingh/docs","description":"DataTorrent Product Documentation","fork":true,"url":"https://api.github.com/repos/chandnisingh/docs","forks_url":"https://api.github.com/repos/chandnisingh/docs/forks","keys_url":"https://api.github.com/repos/chandnisingh/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chandnisingh/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chandnisingh/docs/teams","hooks_url":"https://api.github.com/repos/chandnisingh/docs/hooks","issue_events_url":"https://api.github.com/repos/chandnisingh/docs/issues/events{/number}","events_url":"https://api.github.com/repos/chandnisingh/docs/events","assignees_url":"https://api.github.com/repos/chandnisingh/docs/assignees{/user}","branches_url":"https://api.github.com/repos/chandnisingh/docs/branches{/branch}","tags_url":"https://api.github.com/repos/chandnisingh/docs/tags","blobs_url":"https://api.github.com/repos/chandnisingh/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chandnisingh/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chandnisingh/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/chandnisingh/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chandnisingh/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/chandnisingh/docs/languages","stargazers_url":"https://api.github.com/repos/chandnisingh/docs/stargazers","contributors_url":"https://api.github.com/repos/chandnisingh/docs/contributors","subscribers_url":"https://api.github.com/repos/chandnisingh/docs/subscribers","subscription_url":"https://api.github.com/repos/chandnisingh/docs/subscription","commits_url":"https://api.github.com/repos/chandnisingh/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/chandnisingh/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/chandnisingh/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/chandnisingh/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/chandnisingh/docs/contents/{+path}","compare_url":"https://api.github.com/repos/chandnisingh/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chandnisingh/docs/merges","archive_url":"https://api.github.com/repos/chandnisingh/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chandnisingh/docs/downloads","issues_url":"https://api.github.com/repos/chandnisingh/docs/issues{/number}","pulls_url":"https://api.github.com/repos/chandnisingh/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/chandnisingh/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/chandnisingh/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chandnisingh/docs/labels{/name}","releases_url":"https://api.github.com/repos/chandnisingh/docs/releases{/id}","created_at":"2015-10-18T01:48:58Z","updated_at":"2015-09-23T23:13:45Z","pushed_at":"2015-10-27T05:38:36Z","git_url":"git://github.com/chandnisingh/docs.git","ssh_url":"git@github.com:chandnisingh/docs.git","clone_url":"https://github.com/chandnisingh/docs.git","svn_url":"https://github.com/chandnisingh/docs","homepage":null,"size":20356,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DataTorrent:master","ref":"master","sha":"a34d50822a09398444cb9357e2533573fcff59b7","user":{"login":"DataTorrent","id":4400063,"avatar_url":"https://avatars.githubusercontent.com/u/4400063?v=3","gravatar_id":"","url":"https://api.github.com/users/DataTorrent","html_url":"https://github.com/DataTorrent","followers_url":"https://api.github.com/users/DataTorrent/followers","following_url":"https://api.github.com/users/DataTorrent/following{/other_user}","gists_url":"https://api.github.com/users/DataTorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/DataTorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataTorrent/subscriptions","organizations_url":"https://api.github.com/users/DataTorrent/orgs","repos_url":"https://api.github.com/users/DataTorrent/repos","events_url":"https://api.github.com/users/DataTorrent/events{/privacy}","received_events_url":"https://api.github.com/users/DataTorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":43032394,"name":"docs","full_name":"DataTorrent/docs","owner":{"login":"DataTorrent","id":4400063,"avatar_url":"https://avatars.githubusercontent.com/u/4400063?v=3","gravatar_id":"","url":"https://api.github.com/users/DataTorrent","html_url":"https://github.com/DataTorrent","followers_url":"https://api.github.com/users/DataTorrent/followers","following_url":"https://api.github.com/users/DataTorrent/following{/other_user}","gists_url":"https://api.github.com/users/DataTorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/DataTorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataTorrent/subscriptions","organizations_url":"https://api.github.com/users/DataTorrent/orgs","repos_url":"https://api.github.com/users/DataTorrent/repos","events_url":"https://api.github.com/users/DataTorrent/events{/privacy}","received_events_url":"https://api.github.com/users/DataTorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DataTorrent/docs","description":"DataTorrent Product Documentation","fork":false,"url":"https://api.github.com/repos/DataTorrent/docs","forks_url":"https://api.github.com/repos/DataTorrent/docs/forks","keys_url":"https://api.github.com/repos/DataTorrent/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataTorrent/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataTorrent/docs/teams","hooks_url":"https://api.github.com/repos/DataTorrent/docs/hooks","issue_events_url":"https://api.github.com/repos/DataTorrent/docs/issues/events{/number}","events_url":"https://api.github.com/repos/DataTorrent/docs/events","assignees_url":"https://api.github.com/repos/DataTorrent/docs/assignees{/user}","branches_url":"https://api.github.com/repos/DataTorrent/docs/branches{/branch}","tags_url":"https://api.github.com/repos/DataTorrent/docs/tags","blobs_url":"https://api.github.com/repos/DataTorrent/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataTorrent/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataTorrent/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataTorrent/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataTorrent/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/DataTorrent/docs/languages","stargazers_url":"https://api.github.com/repos/DataTorrent/docs/stargazers","contributors_url":"https://api.github.com/repos/DataTorrent/docs/contributors","subscribers_url":"https://api.github.com/repos/DataTorrent/docs/subscribers","subscription_url":"https://api.github.com/repos/DataTorrent/docs/subscription","commits_url":"https://api.github.com/repos/DataTorrent/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataTorrent/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataTorrent/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataTorrent/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataTorrent/docs/contents/{+path}","compare_url":"https://api.github.com/repos/DataTorrent/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataTorrent/docs/merges","archive_url":"https://api.github.com/repos/DataTorrent/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataTorrent/docs/downloads","issues_url":"https://api.github.com/repos/DataTorrent/docs/issues{/number}","pulls_url":"https://api.github.com/repos/DataTorrent/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/DataTorrent/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/DataTorrent/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataTorrent/docs/labels{/name}","releases_url":"https://api.github.com/repos/DataTorrent/docs/releases{/id}","created_at":"2015-09-23T23:13:45Z","updated_at":"2015-09-23T23:13:45Z","pushed_at":"2015-10-27T15:46:26Z","git_url":"git://github.com/DataTorrent/docs.git","ssh_url":"git@github.com:DataTorrent/docs.git","clone_url":"https://github.com/DataTorrent/docs.git","svn_url":"https://github.com/DataTorrent/docs","homepage":null,"size":20450,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataTorrent/docs/pulls/3"},"html":{"href":"https://github.com/DataTorrent/docs/pull/3"},"issue":{"href":"https://api.github.com/repos/DataTorrent/docs/issues/3"},"comments":{"href":"https://api.github.com/repos/DataTorrent/docs/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/DataTorrent/docs/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/DataTorrent/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataTorrent/docs/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/DataTorrent/docs/statuses/c9fb82f19db7a4ec0f44c4fdfea0c74f2f01b4ea"}}}}