{"action":"created","comment":{"url":"https://api.github.com/repos/apache/accumulo/pulls/comments/77917975","id":77917975,"diff_hunk":"@@ -0,0 +1,387 @@\n+/*\n+ * Licensed to the Apache Software Foundation (ASF) under one or more\n+ * contributor license agreements.  See the NOTICE file distributed with\n+ * this work for additional information regarding copyright ownership.\n+ * The ASF licenses this file to You under the Apache License, Version 2.0\n+ * (the \"License\"); you may not use this file except in compliance with\n+ * 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, 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 org.apache.accumulo.core.file.rfile;\n+\n+import java.io.File;\n+import java.io.IOException;\n+import java.io.PrintWriter;\n+import java.io.StringWriter;\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.Collections;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+import java.util.Random;\n+import java.util.concurrent.LinkedBlockingQueue;\n+import java.util.concurrent.ThreadPoolExecutor;\n+import java.util.concurrent.TimeUnit;\n+import org.apache.accumulo.core.conf.AccumuloConfiguration;\n+import org.apache.accumulo.core.data.ArrayByteSequence;\n+import org.apache.accumulo.core.data.ByteSequence;\n+import org.apache.accumulo.core.data.Key;\n+import org.apache.accumulo.core.data.Range;\n+import org.apache.accumulo.core.data.Value;\n+import org.apache.accumulo.core.file.FileSKVIterator;\n+import org.apache.accumulo.core.file.blockfile.impl.CachableBlockFile;\n+import org.apache.accumulo.core.file.rfile.RFile.Reader;\n+import org.apache.accumulo.core.iterators.SortedKeyValueIterator;\n+import org.apache.accumulo.core.iterators.system.ColumnFamilySkippingIterator;\n+import org.apache.accumulo.core.util.CachedConfiguration;\n+import org.apache.accumulo.core.util.NamingThreadFactory;\n+import org.apache.commons.lang3.mutable.MutableInt;\n+import org.apache.hadoop.conf.Configuration;\n+import org.apache.hadoop.fs.FSDataInputStream;\n+import org.apache.hadoop.fs.FSDataOutputStream;\n+import org.apache.hadoop.fs.FileSystem;\n+import org.apache.hadoop.fs.Path;\n+import org.apache.log4j.Level;\n+import org.apache.log4j.Logger;\n+import org.junit.Rule;\n+import org.junit.Test;\n+import org.junit.rules.TemporaryFolder;\n+\n+import static org.junit.Assert.assertEquals;\n+import static org.junit.Assert.assertFalse;\n+import static org.junit.Assert.assertTrue;\n+\n+public class MultiThreadedRFileTest {\n+\n+  private static final Collection<ByteSequence> EMPTY_COL_FAMS = new ArrayList<ByteSequence>();\n+\n+  @Rule\n+  public TemporaryFolder tempFolder = new TemporaryFolder(new File(System.getProperty(\"user.dir\") + \"/target\"));\n+\n+  static {\n+    Logger.getLogger(org.apache.hadoop.io.compress.CodecPool.class).setLevel(Level.OFF);\n+    Logger.getLogger(org.apache.hadoop.util.NativeCodeLoader.class).setLevel(Level.OFF);\n+  }\n+\n+  private static void checkIndex(Reader reader) throws IOException {\n+    FileSKVIterator indexIter = reader.getIndex();\n+\n+    if (indexIter.hasTop()) {\n+      Key lastKey = new Key(indexIter.getTopKey());\n+\n+      if (reader.getFirstKey().compareTo(lastKey) > 0)\n+        throw new RuntimeException(\"First key out of order \" + reader.getFirstKey() + \" \" + lastKey);\n+\n+      indexIter.next();\n+\n+      while (indexIter.hasTop()) {\n+        if (lastKey.compareTo(indexIter.getTopKey()) > 0)\n+          throw new RuntimeException(\"Indext out of order \" + lastKey + \" \" + indexIter.getTopKey());\n+\n+        lastKey = new Key(indexIter.getTopKey());\n+        indexIter.next();\n+\n+      }\n+\n+      if (!reader.getLastKey().equals(lastKey)) {\n+        throw new RuntimeException(\"Last key out of order \" + reader.getLastKey() + \" \" + lastKey);\n+      }\n+    }\n+  }\n+\n+  public static class TestRFile {","path":"core/src/test/java/org/apache/accumulo/core/file/rfile/MultiThreadedRFileTest.java","position":100,"original_position":100,"commit_id":"9038d8b3a36e7189fbdedfbbb950c7b1f43b2b7d","original_commit_id":"5957c2234e9c577ef65c1e0fb44c7c25874059e0","user":{"login":"phrocker","id":1781585,"avatar_url":"https://avatars.githubusercontent.com/u/1781585?v=3","gravatar_id":"","url":"https://api.github.com/users/phrocker","html_url":"https://github.com/phrocker","followers_url":"https://api.github.com/users/phrocker/followers","following_url":"https://api.github.com/users/phrocker/following{/other_user}","gists_url":"https://api.github.com/users/phrocker/gists{/gist_id}","starred_url":"https://api.github.com/users/phrocker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phrocker/subscriptions","organizations_url":"https://api.github.com/users/phrocker/orgs","repos_url":"https://api.github.com/users/phrocker/repos","events_url":"https://api.github.com/users/phrocker/events{/privacy}","received_events_url":"https://api.github.com/users/phrocker/received_events","type":"User","site_admin":false},"body":"Is MultiThreadedRFileTest expected to fail in 1.7 without the other changes??","created_at":"2016-09-07T22:43:24Z","updated_at":"2016-09-07T22:43:24Z","html_url":"https://github.com/apache/accumulo/pull/134#discussion_r77917975","pull_request_url":"https://api.github.com/repos/apache/accumulo/pulls/134","_links":{"self":{"href":"https://api.github.com/repos/apache/accumulo/pulls/comments/77917975"},"html":{"href":"https://github.com/apache/accumulo/pull/134#discussion_r77917975"},"pull_request":{"href":"https://api.github.com/repos/apache/accumulo/pulls/134"}}},"pull_request":{"url":"https://api.github.com/repos/apache/accumulo/pulls/134","id":79062968,"html_url":"https://github.com/apache/accumulo/pull/134","diff_url":"https://github.com/apache/accumulo/pull/134.diff","patch_url":"https://github.com/apache/accumulo/pull/134.patch","issue_url":"https://api.github.com/repos/apache/accumulo/issues/134","number":134,"state":"open","locked":false,"title":"ACCUMULO-4391 Source deepcopies cannot be used safely in separate threads in tserver","user":{"login":"ivakegg","id":347158,"avatar_url":"https://avatars.githubusercontent.com/u/347158?v=3","gravatar_id":"","url":"https://api.github.com/users/ivakegg","html_url":"https://github.com/ivakegg","followers_url":"https://api.github.com/users/ivakegg/followers","following_url":"https://api.github.com/users/ivakegg/following{/other_user}","gists_url":"https://api.github.com/users/ivakegg/gists{/gist_id}","starred_url":"https://api.github.com/users/ivakegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivakegg/subscriptions","organizations_url":"https://api.github.com/users/ivakegg/orgs","repos_url":"https://api.github.com/users/ivakegg/repos","events_url":"https://api.github.com/users/ivakegg/events{/privacy}","received_events_url":"https://api.github.com/users/ivakegg/received_events","type":"User","site_admin":false},"body":"Added synchronization around the available() call in the BoundedRangeFileInputStream to allow RFile.Reader deepcopies to be usable in separate threads.","created_at":"2016-07-27T17:18:04Z","updated_at":"2016-09-07T22:43:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16a9c16f23f0dc8b1a32ce3bf7f102f02d47cdb3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/accumulo/pulls/134/commits","review_comments_url":"https://api.github.com/repos/apache/accumulo/pulls/134/comments","review_comment_url":"https://api.github.com/repos/apache/accumulo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/accumulo/issues/134/comments","statuses_url":"https://api.github.com/repos/apache/accumulo/statuses/9038d8b3a36e7189fbdedfbbb950c7b1f43b2b7d","head":{"label":"ivakegg:1.6","ref":"1.6","sha":"9038d8b3a36e7189fbdedfbbb950c7b1f43b2b7d","user":{"login":"ivakegg","id":347158,"avatar_url":"https://avatars.githubusercontent.com/u/347158?v=3","gravatar_id":"","url":"https://api.github.com/users/ivakegg","html_url":"https://github.com/ivakegg","followers_url":"https://api.github.com/users/ivakegg/followers","following_url":"https://api.github.com/users/ivakegg/following{/other_user}","gists_url":"https://api.github.com/users/ivakegg/gists{/gist_id}","starred_url":"https://api.github.com/users/ivakegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivakegg/subscriptions","organizations_url":"https://api.github.com/users/ivakegg/orgs","repos_url":"https://api.github.com/users/ivakegg/repos","events_url":"https://api.github.com/users/ivakegg/events{/privacy}","received_events_url":"https://api.github.com/users/ivakegg/received_events","type":"User","site_admin":false},"repo":{"id":55323367,"name":"accumulo","full_name":"ivakegg/accumulo","owner":{"login":"ivakegg","id":347158,"avatar_url":"https://avatars.githubusercontent.com/u/347158?v=3","gravatar_id":"","url":"https://api.github.com/users/ivakegg","html_url":"https://github.com/ivakegg","followers_url":"https://api.github.com/users/ivakegg/followers","following_url":"https://api.github.com/users/ivakegg/following{/other_user}","gists_url":"https://api.github.com/users/ivakegg/gists{/gist_id}","starred_url":"https://api.github.com/users/ivakegg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivakegg/subscriptions","organizations_url":"https://api.github.com/users/ivakegg/orgs","repos_url":"https://api.github.com/users/ivakegg/repos","events_url":"https://api.github.com/users/ivakegg/events{/privacy}","received_events_url":"https://api.github.com/users/ivakegg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ivakegg/accumulo","description":"Mirror of Apache Accumulo","fork":true,"url":"https://api.github.com/repos/ivakegg/accumulo","forks_url":"https://api.github.com/repos/ivakegg/accumulo/forks","keys_url":"https://api.github.com/repos/ivakegg/accumulo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivakegg/accumulo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivakegg/accumulo/teams","hooks_url":"https://api.github.com/repos/ivakegg/accumulo/hooks","issue_events_url":"https://api.github.com/repos/ivakegg/accumulo/issues/events{/number}","events_url":"https://api.github.com/repos/ivakegg/accumulo/events","assignees_url":"https://api.github.com/repos/ivakegg/accumulo/assignees{/user}","branches_url":"https://api.github.com/repos/ivakegg/accumulo/branches{/branch}","tags_url":"https://api.github.com/repos/ivakegg/accumulo/tags","blobs_url":"https://api.github.com/repos/ivakegg/accumulo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivakegg/accumulo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivakegg/accumulo/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivakegg/accumulo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivakegg/accumulo/statuses/{sha}","languages_url":"https://api.github.com/repos/ivakegg/accumulo/languages","stargazers_url":"https://api.github.com/repos/ivakegg/accumulo/stargazers","contributors_url":"https://api.github.com/repos/ivakegg/accumulo/contributors","subscribers_url":"https://api.github.com/repos/ivakegg/accumulo/subscribers","subscription_url":"https://api.github.com/repos/ivakegg/accumulo/subscription","commits_url":"https://api.github.com/repos/ivakegg/accumulo/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivakegg/accumulo/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivakegg/accumulo/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivakegg/accumulo/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivakegg/accumulo/contents/{+path}","compare_url":"https://api.github.com/repos/ivakegg/accumulo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivakegg/accumulo/merges","archive_url":"https://api.github.com/repos/ivakegg/accumulo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivakegg/accumulo/downloads","issues_url":"https://api.github.com/repos/ivakegg/accumulo/issues{/number}","pulls_url":"https://api.github.com/repos/ivakegg/accumulo/pulls{/number}","milestones_url":"https://api.github.com/repos/ivakegg/accumulo/milestones{/number}","notifications_url":"https://api.github.com/repos/ivakegg/accumulo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivakegg/accumulo/labels{/name}","releases_url":"https://api.github.com/repos/ivakegg/accumulo/releases{/id}","deployments_url":"https://api.github.com/repos/ivakegg/accumulo/deployments","created_at":"2016-04-03T00:58:24Z","updated_at":"2016-04-03T00:58:31Z","pushed_at":"2016-08-04T04:05:22Z","git_url":"git://github.com/ivakegg/accumulo.git","ssh_url":"git@github.com:ivakegg/accumulo.git","clone_url":"https://github.com/ivakegg/accumulo.git","svn_url":"https://github.com/ivakegg/accumulo","homepage":"","size":56975,"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:1.6","ref":"1.6","sha":"dcc5dffc8ee9badddac85b714ca28123b528b264","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":2524488,"name":"accumulo","full_name":"apache/accumulo","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/accumulo","description":"Mirror of Apache Accumulo","fork":false,"url":"https://api.github.com/repos/apache/accumulo","forks_url":"https://api.github.com/repos/apache/accumulo/forks","keys_url":"https://api.github.com/repos/apache/accumulo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/accumulo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/accumulo/teams","hooks_url":"https://api.github.com/repos/apache/accumulo/hooks","issue_events_url":"https://api.github.com/repos/apache/accumulo/issues/events{/number}","events_url":"https://api.github.com/repos/apache/accumulo/events","assignees_url":"https://api.github.com/repos/apache/accumulo/assignees{/user}","branches_url":"https://api.github.com/repos/apache/accumulo/branches{/branch}","tags_url":"https://api.github.com/repos/apache/accumulo/tags","blobs_url":"https://api.github.com/repos/apache/accumulo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/accumulo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/accumulo/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/accumulo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/accumulo/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/accumulo/languages","stargazers_url":"https://api.github.com/repos/apache/accumulo/stargazers","contributors_url":"https://api.github.com/repos/apache/accumulo/contributors","subscribers_url":"https://api.github.com/repos/apache/accumulo/subscribers","subscription_url":"https://api.github.com/repos/apache/accumulo/subscription","commits_url":"https://api.github.com/repos/apache/accumulo/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/accumulo/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/accumulo/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/accumulo/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/accumulo/contents/{+path}","compare_url":"https://api.github.com/repos/apache/accumulo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/accumulo/merges","archive_url":"https://api.github.com/repos/apache/accumulo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/accumulo/downloads","issues_url":"https://api.github.com/repos/apache/accumulo/issues{/number}","pulls_url":"https://api.github.com/repos/apache/accumulo/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/accumulo/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/accumulo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/accumulo/labels{/name}","releases_url":"https://api.github.com/repos/apache/accumulo/releases{/id}","deployments_url":"https://api.github.com/repos/apache/accumulo/deployments","created_at":"2011-10-06T07:00:09Z","updated_at":"2016-09-07T08:52:34Z","pushed_at":"2016-09-07T22:22:54Z","git_url":"git://github.com/apache/accumulo.git","ssh_url":"git@github.com:apache/accumulo.git","clone_url":"https://github.com/apache/accumulo.git","svn_url":"https://github.com/apache/accumulo","homepage":"","size":69398,"stargazers_count":245,"watchers_count":245,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":130,"mirror_url":"git://git.apache.org/accumulo.git","open_issues_count":6,"forks":130,"open_issues":6,"watchers":245,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/accumulo/pulls/134"},"html":{"href":"https://github.com/apache/accumulo/pull/134"},"issue":{"href":"https://api.github.com/repos/apache/accumulo/issues/134"},"comments":{"href":"https://api.github.com/repos/apache/accumulo/issues/134/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/accumulo/pulls/134/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/accumulo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/accumulo/pulls/134/commits"},"statuses":{"href":"https://api.github.com/repos/apache/accumulo/statuses/9038d8b3a36e7189fbdedfbbb950c7b1f43b2b7d"}}}}
{"actor":{"display_login":"phrocker"}}