{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments/29174426","id":29174426,"diff_hunk":"@@ -581,55 +520,52 @@ public PerTileBarcodeExtractor(\n         }\n \n         // These methods return the results of the extraction\n-        public synchronized Map<String, BarcodeMetric> getMetrics() {\n+        public Map<String, BarcodeMetric> getMetrics() {\n             return this.metrics;\n         }\n \n-        public synchronized BarcodeMetric getNoMatchMetric() {\n+        public BarcodeMetric getNoMatchMetric() {\n             return this.noMatch;\n         }\n \n-        public synchronized Exception getException() {\n+        public Exception getException() {\n             return this.exception;\n         }\n \n         /**\n          * run method which extracts barcodes and accumulates metrics for an entire tile\n          */\n-        synchronized public void run() {\n+        public void run() {\n             try {\n                 LOG.info(\"Extracting barcodes for tile \" + tile);\n \n-                //Sometimes makeDataProvider takes a while waiting for slow file IO, for each tile the needed set of files\n-                //is non-overlapping sets of files so make the  data providers in the individual threads for PerTileBarcodeExtractors\n-                //so they are not all waiting for each others file operations\n-\n                 //Most likely we have SKIPS in our read structure since we replace all template reads with skips in the input data structure\n                 //(see customCommnandLineValidation), therefore we must use the outputReadStructure to index into the output cluster data\n-                final int[] barcodeIndices = outputReadStructure.barcodes.getIndices();\n-                final BufferedWriter writer = openFileForBufferedWriting(barcodeFile);\n-                final byte barcodeSubsequences[][] = new byte[barcodeIndices.length][];\n-                final byte qualityScores[][] = usingQualityScores ? new byte[barcodeIndices.length][] : null;\n-                while (provider.hasNext()) {\n-                    // Extract the barcode from the cluster and write it to the file for the tile\n-                    final ClusterData cluster = provider.next();\n-                    for (int i = 0; i < barcodeIndices.length; i++) {\n-                        barcodeSubsequences[i] = cluster.getRead(barcodeIndices[i]).getBases();\n-                        if (usingQualityScores) qualityScores[i] = cluster.getRead(barcodeIndices[i]).getQualities();\n-                    }\n-                    final boolean passingFilter = cluster.isPf();\n-                    final BarcodeMatch match = findBestBarcodeAndUpdateMetrics(barcodeSubsequences, qualityScores, passingFilter, metrics, noMatch);\n-\n-                    final String yOrN = (match.matched ? \"Y\" : \"N\");\n-\n-                    for (final byte[] bc : barcodeSubsequences) {\n-                        writer.write(bytesToString(bc));\n+                try (final BufferedWriter writer = openFileForBufferedWriting(barcodeFile)) {\n+                    final int[] barcodeIndices = outputReadStructure.barcodes.getIndices();\n+                    final byte barcodeSubsequences[][] = new byte[barcodeIndices.length][];\n+                    final byte qualityScores[][] = usingQualityScores ? new byte[barcodeIndices.length][] : null;\n+                    while (provider.hasNext()) {\n+                        // Extract the barcode from the cluster and write it to the file for the tile\n+                        final ClusterData cluster = provider.next();\n+                        for (int i = 0; i < barcodeIndices.length; i++) {\n+                            barcodeSubsequences[i] = cluster.getRead(barcodeIndices[i]).getBases();\n+                            if (usingQualityScores)\n+                                qualityScores[i] = cluster.getRead(barcodeIndices[i]).getQualities();\n+                        }\n+                        final boolean passingFilter = cluster.isPf();\n+                        final BarcodeMatch match = findBestBarcodeAndUpdateMetrics(barcodeSubsequences, qualityScores, passingFilter, metrics, noMatch);\n+\n+                        final String yOrN = (match.matched ? \"Y\" : \"N\");\n+\n+                        for (final byte[] bc : barcodeSubsequences) {\n+                            writer.write(bytesToString(bc));\n+                        }\n+                        writer.write(\"\\t\" + yOrN + \"\\t\" + match.barcode + \"\\t\" + valueOf(match.mismatches) +","path":"src/main/java/org/broadinstitute/hellbender/tools/picard/illumina/ExtractIlluminaBarcodes.java","position":303,"original_position":303,"commit_id":"91b0f5f5541572884175b8e88515bbbece17454b","original_commit_id":"91b0f5f5541572884175b8e88515bbbece17454b","user":{"login":"lbergelson","id":4700332,"avatar_url":"https://avatars.githubusercontent.com/u/4700332?v=3","gravatar_id":"","url":"https://api.github.com/users/lbergelson","html_url":"https://github.com/lbergelson","followers_url":"https://api.github.com/users/lbergelson/followers","following_url":"https://api.github.com/users/lbergelson/following{/other_user}","gists_url":"https://api.github.com/users/lbergelson/gists{/gist_id}","starred_url":"https://api.github.com/users/lbergelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbergelson/subscriptions","organizations_url":"https://api.github.com/users/lbergelson/orgs","repos_url":"https://api.github.com/users/lbergelson/repos","events_url":"https://api.github.com/users/lbergelson/events{/privacy}","received_events_url":"https://api.github.com/users/lbergelson/received_events","type":"User","site_admin":false},"body":"Wouldn't it avoid the creation of all the intermediate strings \"\\t\", \"\\tY\", \"\\tY\\t\" etc?  I actually don't know what the performance of String.formate is vs a bunch of concats, might not be any better.  Just ignore, it's probably not a performance bottleneck.","created_at":"2015-04-27T18:17:44Z","updated_at":"2015-04-27T18:17:44Z","html_url":"https://github.com/broadinstitute/hellbender/pull/448#discussion_r29174426","pull_request_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments/29174426"},"html":{"href":"https://github.com/broadinstitute/hellbender/pull/448#discussion_r29174426"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448","id":34095363,"html_url":"https://github.com/broadinstitute/hellbender/pull/448","diff_url":"https://github.com/broadinstitute/hellbender/pull/448.diff","patch_url":"https://github.com/broadinstitute/hellbender/pull/448.patch","issue_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/448","number":448,"state":"open","locked":false,"title":"remove multithreading from ExtractIlluminaBarcodes","user":{"login":"akiezun","id":1993519,"avatar_url":"https://avatars.githubusercontent.com/u/1993519?v=3","gravatar_id":"","url":"https://api.github.com/users/akiezun","html_url":"https://github.com/akiezun","followers_url":"https://api.github.com/users/akiezun/followers","following_url":"https://api.github.com/users/akiezun/following{/other_user}","gists_url":"https://api.github.com/users/akiezun/gists{/gist_id}","starred_url":"https://api.github.com/users/akiezun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akiezun/subscriptions","organizations_url":"https://api.github.com/users/akiezun/orgs","repos_url":"https://api.github.com/users/akiezun/repos","events_url":"https://api.github.com/users/akiezun/events{/privacy}","received_events_url":"https://api.github.com/users/akiezun/received_events","type":"User","site_admin":false},"body":"i removed multithreading, we're not doing it.","created_at":"2015-04-24T23:50:26Z","updated_at":"2015-04-27T18:17:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"15ae0df695a4de7bbb82c678eb60e40ee882b652","assignee":{"login":"akiezun","id":1993519,"avatar_url":"https://avatars.githubusercontent.com/u/1993519?v=3","gravatar_id":"","url":"https://api.github.com/users/akiezun","html_url":"https://github.com/akiezun","followers_url":"https://api.github.com/users/akiezun/followers","following_url":"https://api.github.com/users/akiezun/following{/other_user}","gists_url":"https://api.github.com/users/akiezun/gists{/gist_id}","starred_url":"https://api.github.com/users/akiezun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akiezun/subscriptions","organizations_url":"https://api.github.com/users/akiezun/orgs","repos_url":"https://api.github.com/users/akiezun/repos","events_url":"https://api.github.com/users/akiezun/events{/privacy}","received_events_url":"https://api.github.com/users/akiezun/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/448/comments","statuses_url":"https://api.github.com/repos/broadinstitute/hellbender/statuses/91b0f5f5541572884175b8e88515bbbece17454b","head":{"label":"broadinstitute:ak_remove_multiThreading_from_ExtractIlluminaBarcodes","ref":"ak_remove_multiThreading_from_ExtractIlluminaBarcodes","sha":"91b0f5f5541572884175b8e88515bbbece17454b","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":27452807,"name":"hellbender","full_name":"broadinstitute/hellbender","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/hellbender","description":"GATK4 development","fork":false,"url":"https://api.github.com/repos/broadinstitute/hellbender","forks_url":"https://api.github.com/repos/broadinstitute/hellbender/forks","keys_url":"https://api.github.com/repos/broadinstitute/hellbender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/hellbender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/hellbender/teams","hooks_url":"https://api.github.com/repos/broadinstitute/hellbender/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/hellbender/events","assignees_url":"https://api.github.com/repos/broadinstitute/hellbender/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/hellbender/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/hellbender/tags","blobs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/hellbender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/hellbender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/hellbender/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/hellbender/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/hellbender/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/hellbender/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/hellbender/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/hellbender/subscription","commits_url":"https://api.github.com/repos/broadinstitute/hellbender/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/hellbender/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/hellbender/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/hellbender/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/hellbender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/hellbender/merges","archive_url":"https://api.github.com/repos/broadinstitute/hellbender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/hellbender/downloads","issues_url":"https://api.github.com/repos/broadinstitute/hellbender/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/hellbender/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/hellbender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/hellbender/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/hellbender/releases{/id}","created_at":"2014-12-02T20:50:36Z","updated_at":"2015-04-27T01:58:26Z","pushed_at":"2015-04-27T17:36:46Z","git_url":"git://github.com/broadinstitute/hellbender.git","ssh_url":"git@github.com:broadinstitute/hellbender.git","clone_url":"https://github.com/broadinstitute/hellbender.git","svn_url":"https://github.com/broadinstitute/hellbender","homepage":"","size":29213,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":203,"forks":2,"open_issues":203,"watchers":3,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"a75b706c98c542ded89a771b93b1c3df78ba7f6a","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":27452807,"name":"hellbender","full_name":"broadinstitute/hellbender","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/hellbender","description":"GATK4 development","fork":false,"url":"https://api.github.com/repos/broadinstitute/hellbender","forks_url":"https://api.github.com/repos/broadinstitute/hellbender/forks","keys_url":"https://api.github.com/repos/broadinstitute/hellbender/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/hellbender/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/hellbender/teams","hooks_url":"https://api.github.com/repos/broadinstitute/hellbender/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/hellbender/events","assignees_url":"https://api.github.com/repos/broadinstitute/hellbender/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/hellbender/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/hellbender/tags","blobs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/hellbender/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/hellbender/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/hellbender/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/hellbender/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/hellbender/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/hellbender/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/hellbender/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/hellbender/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/hellbender/subscription","commits_url":"https://api.github.com/repos/broadinstitute/hellbender/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/hellbender/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/hellbender/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/hellbender/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/hellbender/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/hellbender/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/hellbender/merges","archive_url":"https://api.github.com/repos/broadinstitute/hellbender/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/hellbender/downloads","issues_url":"https://api.github.com/repos/broadinstitute/hellbender/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/hellbender/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/hellbender/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/hellbender/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/hellbender/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/hellbender/releases{/id}","created_at":"2014-12-02T20:50:36Z","updated_at":"2015-04-27T01:58:26Z","pushed_at":"2015-04-27T17:36:46Z","git_url":"git://github.com/broadinstitute/hellbender.git","ssh_url":"git@github.com:broadinstitute/hellbender.git","clone_url":"https://github.com/broadinstitute/hellbender.git","svn_url":"https://github.com/broadinstitute/hellbender","homepage":"","size":29213,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":203,"forks":2,"open_issues":203,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448"},"html":{"href":"https://github.com/broadinstitute/hellbender/pull/448"},"issue":{"href":"https://api.github.com/repos/broadinstitute/hellbender/issues/448"},"comments":{"href":"https://api.github.com/repos/broadinstitute/hellbender/issues/448/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/hellbender/pulls/448/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/hellbender/statuses/91b0f5f5541572884175b8e88515bbbece17454b"}}}}