{"action":"created","comment":{"url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/comments/57761540","id":57761540,"diff_hunk":"@@ -0,0 +1,159 @@\n+/**\n+ * Licensed to the Apache Software Foundation (ASF) under one\n+ * or more contributor license agreements.  See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership.  The ASF licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License.  You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+package com.datatorrent.contrib.avro;\n+\n+import java.io.IOException;\n+import java.io.InputStream;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import org.apache.avro.AvroRuntimeException;\n+import org.apache.avro.file.DataFileStream;\n+import org.apache.avro.generic.GenericDatumReader;\n+import org.apache.avro.generic.GenericRecord;\n+import org.apache.avro.io.DatumReader;\n+import org.apache.hadoop.classification.InterfaceStability;\n+import org.apache.hadoop.fs.Path;\n+\n+import com.datatorrent.api.AutoMetric;\n+import com.datatorrent.api.DefaultOutputPort;\n+import com.datatorrent.api.annotation.OutputPortFieldAnnotation;\n+import com.datatorrent.lib.io.fs.AbstractFileInputOperator;\n+\n+/**\n+ * <p>\n+ * Avro File Input Operator\n+ * </p>\n+ * A specific implementation of the AbstractFileInputOperator to read Avro\n+ * container files.<br>\n+ * No need to provide schema,its inferred from the file<br>\n+ * Users can add the {@link IdempotentStorageManager.FSIdempotentStorageManager}\n+ * to ensure exactly once semantics with a HDFS backed WAL.\n+ * \n+ * @displayName AvroFileInputOperator\n+ * @category Input\n+ * @tags fs, file,avro, input operator\n+ * @since 3.3.0\n+ */\n+@InterfaceStability.Evolving\n+public class AvroFileInputOperator extends AbstractFileInputOperator<GenericRecord>\n+{\n+\n+  private transient long offset = 0L;\n+\n+  @AutoMetric\n+  int recordCnt = 0;\n+\n+  @AutoMetric\n+  int errorCnt = 0;\n+\n+  private transient DataFileStream<GenericRecord> avroDataStream;\n+  private transient GenericRecord record = null;\n+\n+  public final transient DefaultOutputPort<GenericRecord> output = new DefaultOutputPort<GenericRecord>();","path":"contrib/src/main/java/com/datatorrent/contrib/avro/AvroFileInputOperator.java","position":70,"original_position":70,"commit_id":"9a6bfa71fbc9d653a6d0012d6ac54b59dd11fae2","original_commit_id":"9a6bfa71fbc9d653a6d0012d6ac54b59dd11fae2","user":{"login":"chinmaykolhatkar","id":12393897,"avatar_url":"https://avatars.githubusercontent.com/u/12393897?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmaykolhatkar","html_url":"https://github.com/chinmaykolhatkar","followers_url":"https://api.github.com/users/chinmaykolhatkar/followers","following_url":"https://api.github.com/users/chinmaykolhatkar/following{/other_user}","gists_url":"https://api.github.com/users/chinmaykolhatkar/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmaykolhatkar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmaykolhatkar/subscriptions","organizations_url":"https://api.github.com/users/chinmaykolhatkar/orgs","repos_url":"https://api.github.com/users/chinmaykolhatkar/repos","events_url":"https://api.github.com/users/chinmaykolhatkar/events{/privacy}","received_events_url":"https://api.github.com/users/chinmaykolhatkar/received_events","type":"User","site_admin":false},"body":"Is it possible to utilize output port from AbstractFileInputOperator class instead of creating a new one?","created_at":"2016-03-29T17:13:39Z","updated_at":"2016-03-29T17:13:39Z","html_url":"https://github.com/apache/incubator-apex-malhar/pull/211#discussion_r57761540","pull_request_url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/comments/57761540"},"html":{"href":"https://github.com/apache/incubator-apex-malhar/pull/211#discussion_r57761540"},"pull_request":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211","id":62916528,"html_url":"https://github.com/apache/incubator-apex-malhar/pull/211","diff_url":"https://github.com/apache/incubator-apex-malhar/pull/211.diff","patch_url":"https://github.com/apache/incubator-apex-malhar/pull/211.patch","issue_url":"https://api.github.com/repos/apache/incubator-apex-malhar/issues/211","number":211,"state":"open","locked":false,"title":"APEXMALHAR-2011-2012 Avro to Pojo & Pojo to Avro converter","user":{"login":"devtagare","id":7666415,"avatar_url":"https://avatars.githubusercontent.com/u/7666415?v=3","gravatar_id":"","url":"https://api.github.com/users/devtagare","html_url":"https://github.com/devtagare","followers_url":"https://api.github.com/users/devtagare/followers","following_url":"https://api.github.com/users/devtagare/following{/other_user}","gists_url":"https://api.github.com/users/devtagare/gists{/gist_id}","starred_url":"https://api.github.com/users/devtagare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtagare/subscriptions","organizations_url":"https://api.github.com/users/devtagare/orgs","repos_url":"https://api.github.com/users/devtagare/repos","events_url":"https://api.github.com/users/devtagare/events{/privacy}","received_events_url":"https://api.github.com/users/devtagare/received_events","type":"User","site_admin":false},"body":"Please review changes for Avro to Pojo conversion & back.\r\n\r\nThanks,\r\nDev","created_at":"2016-03-15T14:43:21Z","updated_at":"2016-03-29T17:13:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5ac1cdebce13fe677057fe5d0f2ca7f1b7f9e77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211/commits","review_comments_url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211/comments","review_comment_url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/incubator-apex-malhar/issues/211/comments","statuses_url":"https://api.github.com/repos/apache/incubator-apex-malhar/statuses/9a6bfa71fbc9d653a6d0012d6ac54b59dd11fae2","head":{"label":"devtagare:APEXMALHAR-2011-2012","ref":"APEXMALHAR-2011-2012","sha":"9a6bfa71fbc9d653a6d0012d6ac54b59dd11fae2","user":{"login":"devtagare","id":7666415,"avatar_url":"https://avatars.githubusercontent.com/u/7666415?v=3","gravatar_id":"","url":"https://api.github.com/users/devtagare","html_url":"https://github.com/devtagare","followers_url":"https://api.github.com/users/devtagare/followers","following_url":"https://api.github.com/users/devtagare/following{/other_user}","gists_url":"https://api.github.com/users/devtagare/gists{/gist_id}","starred_url":"https://api.github.com/users/devtagare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtagare/subscriptions","organizations_url":"https://api.github.com/users/devtagare/orgs","repos_url":"https://api.github.com/users/devtagare/repos","events_url":"https://api.github.com/users/devtagare/events{/privacy}","received_events_url":"https://api.github.com/users/devtagare/received_events","type":"User","site_admin":false},"repo":{"id":53950635,"name":"incubator-apex-malhar","full_name":"devtagare/incubator-apex-malhar","owner":{"login":"devtagare","id":7666415,"avatar_url":"https://avatars.githubusercontent.com/u/7666415?v=3","gravatar_id":"","url":"https://api.github.com/users/devtagare","html_url":"https://github.com/devtagare","followers_url":"https://api.github.com/users/devtagare/followers","following_url":"https://api.github.com/users/devtagare/following{/other_user}","gists_url":"https://api.github.com/users/devtagare/gists{/gist_id}","starred_url":"https://api.github.com/users/devtagare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtagare/subscriptions","organizations_url":"https://api.github.com/users/devtagare/orgs","repos_url":"https://api.github.com/users/devtagare/repos","events_url":"https://api.github.com/users/devtagare/events{/privacy}","received_events_url":"https://api.github.com/users/devtagare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devtagare/incubator-apex-malhar","description":"Mirror of Apache Apex malhar (Incubating)","fork":true,"url":"https://api.github.com/repos/devtagare/incubator-apex-malhar","forks_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/forks","keys_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/teams","hooks_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/hooks","issue_events_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/issues/events{/number}","events_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/events","assignees_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/assignees{/user}","branches_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/branches{/branch}","tags_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/tags","blobs_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/git/refs{/sha}","trees_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/statuses/{sha}","languages_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/languages","stargazers_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/stargazers","contributors_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/contributors","subscribers_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/subscribers","subscription_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/subscription","commits_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/commits{/sha}","git_commits_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/git/commits{/sha}","comments_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/comments{/number}","issue_comment_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/issues/comments{/number}","contents_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/contents/{+path}","compare_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/merges","archive_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/downloads","issues_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/issues{/number}","pulls_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/pulls{/number}","milestones_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/milestones{/number}","notifications_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/labels{/name}","releases_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/releases{/id}","deployments_url":"https://api.github.com/repos/devtagare/incubator-apex-malhar/deployments","created_at":"2016-03-15T14:20:54Z","updated_at":"2016-03-15T14:20:59Z","pushed_at":"2016-03-24T23:11:10Z","git_url":"git://github.com/devtagare/incubator-apex-malhar.git","ssh_url":"git@github.com:devtagare/incubator-apex-malhar.git","clone_url":"https://github.com/devtagare/incubator-apex-malhar.git","svn_url":"https://github.com/devtagare/incubator-apex-malhar","homepage":null,"size":84387,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"264f629c13a6a93fadaba367ac9404bfa0edecee","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":41348334,"name":"incubator-apex-malhar","full_name":"apache/incubator-apex-malhar","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/incubator-apex-malhar","description":"Mirror of Apache Apex malhar (Incubating)","fork":false,"url":"https://api.github.com/repos/apache/incubator-apex-malhar","forks_url":"https://api.github.com/repos/apache/incubator-apex-malhar/forks","keys_url":"https://api.github.com/repos/apache/incubator-apex-malhar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/incubator-apex-malhar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/incubator-apex-malhar/teams","hooks_url":"https://api.github.com/repos/apache/incubator-apex-malhar/hooks","issue_events_url":"https://api.github.com/repos/apache/incubator-apex-malhar/issues/events{/number}","events_url":"https://api.github.com/repos/apache/incubator-apex-malhar/events","assignees_url":"https://api.github.com/repos/apache/incubator-apex-malhar/assignees{/user}","branches_url":"https://api.github.com/repos/apache/incubator-apex-malhar/branches{/branch}","tags_url":"https://api.github.com/repos/apache/incubator-apex-malhar/tags","blobs_url":"https://api.github.com/repos/apache/incubator-apex-malhar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/incubator-apex-malhar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/incubator-apex-malhar/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/incubator-apex-malhar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/incubator-apex-malhar/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/incubator-apex-malhar/languages","stargazers_url":"https://api.github.com/repos/apache/incubator-apex-malhar/stargazers","contributors_url":"https://api.github.com/repos/apache/incubator-apex-malhar/contributors","subscribers_url":"https://api.github.com/repos/apache/incubator-apex-malhar/subscribers","subscription_url":"https://api.github.com/repos/apache/incubator-apex-malhar/subscription","commits_url":"https://api.github.com/repos/apache/incubator-apex-malhar/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/incubator-apex-malhar/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/incubator-apex-malhar/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/incubator-apex-malhar/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/incubator-apex-malhar/contents/{+path}","compare_url":"https://api.github.com/repos/apache/incubator-apex-malhar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/incubator-apex-malhar/merges","archive_url":"https://api.github.com/repos/apache/incubator-apex-malhar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/incubator-apex-malhar/downloads","issues_url":"https://api.github.com/repos/apache/incubator-apex-malhar/issues{/number}","pulls_url":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/incubator-apex-malhar/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/incubator-apex-malhar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/incubator-apex-malhar/labels{/name}","releases_url":"https://api.github.com/repos/apache/incubator-apex-malhar/releases{/id}","deployments_url":"https://api.github.com/repos/apache/incubator-apex-malhar/deployments","created_at":"2015-08-25T07:00:05Z","updated_at":"2016-03-21T13:47:59Z","pushed_at":"2016-03-29T12:42:15Z","git_url":"git://github.com/apache/incubator-apex-malhar.git","ssh_url":"git@github.com:apache/incubator-apex-malhar.git","clone_url":"https://github.com/apache/incubator-apex-malhar.git","svn_url":"https://github.com/apache/incubator-apex-malhar","homepage":null,"size":95161,"stargazers_count":26,"watchers_count":26,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":58,"mirror_url":"git://git.apache.org/incubator-apex-malhar.git","open_issues_count":23,"forks":58,"open_issues":23,"watchers":26,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211"},"html":{"href":"https://github.com/apache/incubator-apex-malhar/pull/211"},"issue":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/issues/211"},"comments":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/apache/incubator-apex-malhar/statuses/9a6bfa71fbc9d653a6d0012d6ac54b59dd11fae2"}}}}