{"action":"created","comment":{"url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/comments/204405886","pull_request_review_id":139478959,"id":204405886,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDQwNTg4Ng==","diff_hunk":"@@ -0,0 +1,133 @@\n+/*\n+ * Copyright 2017 EMBL - European Bioinformatics Institute\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package uk.ac.ebi.eva.accession.dbsnp.configuration;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.springframework.batch.core.ExitStatus;\n+import org.springframework.batch.core.StepExecution;\n+import org.springframework.batch.core.listener.StepListenerSupport;\n+import org.springframework.batch.core.scope.context.ChunkContext;\n+import org.springframework.beans.factory.annotation.Qualifier;\n+import org.springframework.context.annotation.Bean;\n+import org.springframework.context.annotation.Configuration;\n+\n+import uk.ac.ebi.eva.accession.core.io.FastaSequenceReader;\n+import uk.ac.ebi.eva.accession.dbsnp.model.SubSnpNoHgvs;\n+import uk.ac.ebi.eva.accession.dbsnp.parameters.InputParameters;\n+import uk.ac.ebi.eva.accession.dbsnp.persistence.DbsnpVariantsWrapper;\n+\n+import java.util.List;\n+\n+import static uk.ac.ebi.eva.accession.dbsnp.configuration.BeanNames.ASSEMBLY_CHECK_STEP_LISTENER;\n+import static uk.ac.ebi.eva.accession.dbsnp.configuration.BeanNames.IMPORT_DBSNP_VARIANTS_PROGRESS_LISTENER;\n+\n+@Configuration\n+public class ListenersConfiguration {\n+\n+    private static final Logger logger = LoggerFactory.getLogger(ListenersConfiguration.class);\n+\n+    @Bean(ASSEMBLY_CHECK_STEP_LISTENER)\n+    StepListenerSupport assemblyCheckStepListener(FastaSequenceReader fastaSequenceReader) {\n+        return new StepListenerSupport() {\n+            @Override\n+            public ExitStatus afterStep(StepExecution stepExecution) {\n+                try {\n+                    logger.debug(\"Closing FASTA file reader used for assembly check\");\n+                    fastaSequenceReader.close();\n+                } catch (Exception e) {\n+                    logger.warn(\"Error closing FASTA file reader used for assembly check: {}\", e.getMessage());\n+                }\n+                return stepExecution.getExitStatus();\n+            }\n+        };\n+    }\n+\n+    @Bean(IMPORT_DBSNP_VARIANTS_PROGRESS_LISTENER)\n+    public StepListenerSupport<SubSnpNoHgvs, DbsnpVariantsWrapper> importDbsnpVariantsProgressListener(\n+            InputParameters parameters) {\n+        return new GenericProgressListener<>(parameters.getChunkSize());\n+    }\n+\n+    private static class GenericProgressListener<I, O> extends StepListenerSupport<I, O> {\n+\n+        private static final Logger logger = LoggerFactory.getLogger(GenericProgressListener.class);\n+\n+        private long chunkSize;\n+\n+        private long numItemsRead;\n+\n+        public GenericProgressListener(long chunkSize) {\n+            this.chunkSize = chunkSize;\n+            this.numItemsRead = 0;\n+        }\n+\n+        @Override\n+        public void beforeStep(StepExecution stepExecution) {\n+            logger.debug(\"Starting a step\");\n+        }\n+\n+        @Override\n+        public void beforeChunk(ChunkContext context) {\n+            logger.debug(\"Starting a chunk\");\n+        }\n+\n+        @Override\n+        public void beforeRead() {\n+            if (numItemsRead % chunkSize == 0) {\n+                logger.debug(\"About to read item {}\", numItemsRead);\n+            }\n+            numItemsRead++;\n+        }\n+\n+        @Override\n+        public void afterRead(I itemRead) {\n+            if (numItemsRead % chunkSize == 0) {\n+                logger.debug(\"Read {} items\", numItemsRead);","path":"eva-accession-import/src/main/java/uk/ac/ebi/eva/accession/dbsnp/configuration/ListenersConfiguration.java","position":99,"original_position":99,"commit_id":"c44dc99df5080d41acb59ef9f24891e4caeddfbf","original_commit_id":"c44dc99df5080d41acb59ef9f24891e4caeddfbf","user":{"login":"pabarcgar","id":2338089,"node_id":"MDQ6VXNlcjIzMzgwODk=","avatar_url":"https://avatars1.githubusercontent.com/u/2338089?v=4","gravatar_id":"","url":"https://api.github.com/users/pabarcgar","html_url":"https://github.com/pabarcgar","followers_url":"https://api.github.com/users/pabarcgar/followers","following_url":"https://api.github.com/users/pabarcgar/following{/other_user}","gists_url":"https://api.github.com/users/pabarcgar/gists{/gist_id}","starred_url":"https://api.github.com/users/pabarcgar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pabarcgar/subscriptions","organizations_url":"https://api.github.com/users/pabarcgar/orgs","repos_url":"https://api.github.com/users/pabarcgar/repos","events_url":"https://api.github.com/users/pabarcgar/events{/privacy}","received_events_url":"https://api.github.com/users/pabarcgar/received_events","type":"User","site_admin":false},"body":"We can leave it in debug for now, and update it to trace if we see too much noise debugging.","created_at":"2018-07-23T13:46:07Z","updated_at":"2018-07-23T13:46:07Z","html_url":"https://github.com/EBIvariation/eva-accession/pull/34#discussion_r204405886","pull_request_url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/comments/204405886"},"html":{"href":"https://github.com/EBIvariation/eva-accession/pull/34#discussion_r204405886"},"pull_request":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34"}},"in_reply_to_id":204386587},"pull_request":{"url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34","id":201858318,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxODU4MzE4","html_url":"https://github.com/EBIvariation/eva-accession/pull/34","diff_url":"https://github.com/EBIvariation/eva-accession/pull/34.diff","patch_url":"https://github.com/EBIvariation/eva-accession/pull/34.patch","issue_url":"https://api.github.com/repos/EBIvariation/eva-accession/issues/34","number":34,"state":"open","locked":false,"title":"EVA-1285 Create Spring Batch job for storing dbSNP variants into accessioning service","user":{"login":"jmmut","id":4750555,"node_id":"MDQ6VXNlcjQ3NTA1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/4750555?v=4","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"body":"scaffold the job and step to have more perspective on how the processors and writers are going to be used.\r\n\r\nNote: there are some commits from #33 because they are not in develop yet, you can ignore those if you review this PR\r\n\r\nprocesses present as of this PR: \r\n- [x] 9 forward strand\r\n- [x] 5 alleles match (ref is included in alleles list)\r\n- [x] 2 assembly check\r\n- [ ] 3 variant instantiation (only ss is instantiated)\r\n- [ ] 1 classification \r\n- [ ] 4 normalize (trim \"-\" and spaces) and 4.1 renormalize (context base)\r\n- [ ] 7 store rs\r\n- [ ] 6 store ss\r\n- [ ] 8 decluster","created_at":"2018-07-17T08:15:43Z","updated_at":"2018-07-23T13:46:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"48c61d7466e833fc7137187c2358f5a9ae7b8c5b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34/commits","review_comments_url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34/comments","review_comment_url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/comments{/number}","comments_url":"https://api.github.com/repos/EBIvariation/eva-accession/issues/34/comments","statuses_url":"https://api.github.com/repos/EBIvariation/eva-accession/statuses/c44dc99df5080d41acb59ef9f24891e4caeddfbf","head":{"label":"jmmut:feature/import-step","ref":"feature/import-step","sha":"c44dc99df5080d41acb59ef9f24891e4caeddfbf","user":{"login":"jmmut","id":4750555,"node_id":"MDQ6VXNlcjQ3NTA1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/4750555?v=4","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"repo":{"id":126814091,"node_id":"MDEwOlJlcG9zaXRvcnkxMjY4MTQwOTE=","name":"eva-accession","full_name":"jmmut/eva-accession","owner":{"login":"jmmut","id":4750555,"node_id":"MDQ6VXNlcjQ3NTA1NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/4750555?v=4","gravatar_id":"","url":"https://api.github.com/users/jmmut","html_url":"https://github.com/jmmut","followers_url":"https://api.github.com/users/jmmut/followers","following_url":"https://api.github.com/users/jmmut/following{/other_user}","gists_url":"https://api.github.com/users/jmmut/gists{/gist_id}","starred_url":"https://api.github.com/users/jmmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmmut/subscriptions","organizations_url":"https://api.github.com/users/jmmut/orgs","repos_url":"https://api.github.com/users/jmmut/repos","events_url":"https://api.github.com/users/jmmut/events{/privacy}","received_events_url":"https://api.github.com/users/jmmut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmmut/eva-accession","description":"EVA non-human variant accessioning service","fork":true,"url":"https://api.github.com/repos/jmmut/eva-accession","forks_url":"https://api.github.com/repos/jmmut/eva-accession/forks","keys_url":"https://api.github.com/repos/jmmut/eva-accession/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmmut/eva-accession/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmmut/eva-accession/teams","hooks_url":"https://api.github.com/repos/jmmut/eva-accession/hooks","issue_events_url":"https://api.github.com/repos/jmmut/eva-accession/issues/events{/number}","events_url":"https://api.github.com/repos/jmmut/eva-accession/events","assignees_url":"https://api.github.com/repos/jmmut/eva-accession/assignees{/user}","branches_url":"https://api.github.com/repos/jmmut/eva-accession/branches{/branch}","tags_url":"https://api.github.com/repos/jmmut/eva-accession/tags","blobs_url":"https://api.github.com/repos/jmmut/eva-accession/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmmut/eva-accession/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmmut/eva-accession/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmmut/eva-accession/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmmut/eva-accession/statuses/{sha}","languages_url":"https://api.github.com/repos/jmmut/eva-accession/languages","stargazers_url":"https://api.github.com/repos/jmmut/eva-accession/stargazers","contributors_url":"https://api.github.com/repos/jmmut/eva-accession/contributors","subscribers_url":"https://api.github.com/repos/jmmut/eva-accession/subscribers","subscription_url":"https://api.github.com/repos/jmmut/eva-accession/subscription","commits_url":"https://api.github.com/repos/jmmut/eva-accession/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmmut/eva-accession/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmmut/eva-accession/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmmut/eva-accession/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmmut/eva-accession/contents/{+path}","compare_url":"https://api.github.com/repos/jmmut/eva-accession/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmmut/eva-accession/merges","archive_url":"https://api.github.com/repos/jmmut/eva-accession/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmmut/eva-accession/downloads","issues_url":"https://api.github.com/repos/jmmut/eva-accession/issues{/number}","pulls_url":"https://api.github.com/repos/jmmut/eva-accession/pulls{/number}","milestones_url":"https://api.github.com/repos/jmmut/eva-accession/milestones{/number}","notifications_url":"https://api.github.com/repos/jmmut/eva-accession/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmmut/eva-accession/labels{/name}","releases_url":"https://api.github.com/repos/jmmut/eva-accession/releases{/id}","deployments_url":"https://api.github.com/repos/jmmut/eva-accession/deployments","created_at":"2018-03-26T10:44:40Z","updated_at":"2018-07-02T15:55:36Z","pushed_at":"2018-07-23T11:16:33Z","git_url":"git://github.com/jmmut/eva-accession.git","ssh_url":"git@github.com:jmmut/eva-accession.git","clone_url":"https://github.com/jmmut/eva-accession.git","svn_url":"https://github.com/jmmut/eva-accession","homepage":null,"size":2712,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"EBIvariation:develop","ref":"develop","sha":"347f67214988837662867064c5849d1fe7ff8262","user":{"login":"EBIvariation","id":6419333,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0MTkzMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6419333?v=4","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"repo":{"id":123308623,"node_id":"MDEwOlJlcG9zaXRvcnkxMjMzMDg2MjM=","name":"eva-accession","full_name":"EBIvariation/eva-accession","owner":{"login":"EBIvariation","id":6419333,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0MTkzMzM=","avatar_url":"https://avatars1.githubusercontent.com/u/6419333?v=4","gravatar_id":"","url":"https://api.github.com/users/EBIvariation","html_url":"https://github.com/EBIvariation","followers_url":"https://api.github.com/users/EBIvariation/followers","following_url":"https://api.github.com/users/EBIvariation/following{/other_user}","gists_url":"https://api.github.com/users/EBIvariation/gists{/gist_id}","starred_url":"https://api.github.com/users/EBIvariation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EBIvariation/subscriptions","organizations_url":"https://api.github.com/users/EBIvariation/orgs","repos_url":"https://api.github.com/users/EBIvariation/repos","events_url":"https://api.github.com/users/EBIvariation/events{/privacy}","received_events_url":"https://api.github.com/users/EBIvariation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/EBIvariation/eva-accession","description":"EVA non-human variant accessioning service","fork":false,"url":"https://api.github.com/repos/EBIvariation/eva-accession","forks_url":"https://api.github.com/repos/EBIvariation/eva-accession/forks","keys_url":"https://api.github.com/repos/EBIvariation/eva-accession/keys{/key_id}","collaborators_url":"https://api.github.com/repos/EBIvariation/eva-accession/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/EBIvariation/eva-accession/teams","hooks_url":"https://api.github.com/repos/EBIvariation/eva-accession/hooks","issue_events_url":"https://api.github.com/repos/EBIvariation/eva-accession/issues/events{/number}","events_url":"https://api.github.com/repos/EBIvariation/eva-accession/events","assignees_url":"https://api.github.com/repos/EBIvariation/eva-accession/assignees{/user}","branches_url":"https://api.github.com/repos/EBIvariation/eva-accession/branches{/branch}","tags_url":"https://api.github.com/repos/EBIvariation/eva-accession/tags","blobs_url":"https://api.github.com/repos/EBIvariation/eva-accession/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/EBIvariation/eva-accession/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/EBIvariation/eva-accession/git/refs{/sha}","trees_url":"https://api.github.com/repos/EBIvariation/eva-accession/git/trees{/sha}","statuses_url":"https://api.github.com/repos/EBIvariation/eva-accession/statuses/{sha}","languages_url":"https://api.github.com/repos/EBIvariation/eva-accession/languages","stargazers_url":"https://api.github.com/repos/EBIvariation/eva-accession/stargazers","contributors_url":"https://api.github.com/repos/EBIvariation/eva-accession/contributors","subscribers_url":"https://api.github.com/repos/EBIvariation/eva-accession/subscribers","subscription_url":"https://api.github.com/repos/EBIvariation/eva-accession/subscription","commits_url":"https://api.github.com/repos/EBIvariation/eva-accession/commits{/sha}","git_commits_url":"https://api.github.com/repos/EBIvariation/eva-accession/git/commits{/sha}","comments_url":"https://api.github.com/repos/EBIvariation/eva-accession/comments{/number}","issue_comment_url":"https://api.github.com/repos/EBIvariation/eva-accession/issues/comments{/number}","contents_url":"https://api.github.com/repos/EBIvariation/eva-accession/contents/{+path}","compare_url":"https://api.github.com/repos/EBIvariation/eva-accession/compare/{base}...{head}","merges_url":"https://api.github.com/repos/EBIvariation/eva-accession/merges","archive_url":"https://api.github.com/repos/EBIvariation/eva-accession/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/EBIvariation/eva-accession/downloads","issues_url":"https://api.github.com/repos/EBIvariation/eva-accession/issues{/number}","pulls_url":"https://api.github.com/repos/EBIvariation/eva-accession/pulls{/number}","milestones_url":"https://api.github.com/repos/EBIvariation/eva-accession/milestones{/number}","notifications_url":"https://api.github.com/repos/EBIvariation/eva-accession/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/EBIvariation/eva-accession/labels{/name}","releases_url":"https://api.github.com/repos/EBIvariation/eva-accession/releases{/id}","deployments_url":"https://api.github.com/repos/EBIvariation/eva-accession/deployments","created_at":"2018-02-28T16:05:21Z","updated_at":"2018-06-20T12:15:12Z","pushed_at":"2018-07-23T12:26:34Z","git_url":"git://github.com/EBIvariation/eva-accession.git","ssh_url":"git@github.com:EBIvariation/eva-accession.git","clone_url":"https://github.com/EBIvariation/eva-accession.git","svn_url":"https://github.com/EBIvariation/eva-accession","homepage":null,"size":2302,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":6,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34"},"html":{"href":"https://github.com/EBIvariation/eva-accession/pull/34"},"issue":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/issues/34"},"comments":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/EBIvariation/eva-accession/statuses/c44dc99df5080d41acb59ef9f24891e4caeddfbf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"pabarcgar"}}