{"action":"created","comment":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/38170785","id":38170785,"diff_hunk":"@@ -710,15 +951,109 @@ public final VoltTableRow fetchRow(int index) {\n      */\n     public final void add(VoltTableRow row) {\n         assert(verifyTableInvariants());\n-        final Object[] values = new Object[m_colCount];\n-        for (int i = 0; i < m_colCount; i++) {\n-            try {\n-                values[i] = row.get(i, getColumnType(i));\n-            } catch (Exception e) {\n-                e.printStackTrace();\n+        if (m_readOnly) {\n+            throw new IllegalStateException(\"Table is read-only. Make a copy before changing.\");\n+        }\n+        if (m_colCount == 0) {\n+            throw new IllegalStateException(\"Table has no columns defined\");\n+        }\n+        if (row.getColumnCount() != m_colCount) {\n+            throw new IllegalArgumentException(row.getColumnCount() + \" arguments but table has \" + m_colCount + \" columns\");\n+        }\n+\n+        // memoize the start of this row in case we roll back\n+        final int pos = m_buffer.position();\n+\n+        try {\n+            // Allow the buffer to grow to max capacity\n+            m_buffer.limit(m_buffer.capacity());\n+\n+            byte[] inboundSchemaString = row.getSchemaString();\n+            byte[] mySchemaString = getSchemaString();\n+\n+            // The way this works is that when two schema strings are found to have\n+            // the same value, the target table's reference is pointed at the source\n+            // table's reference. This allows the copying of multiple rows from one\n+            // table to another to only do a deep comparison once, and to do reference\n+            // equivalence checks for subsequent rows.\n+            boolean canDoRawCopy = (inboundSchemaString == mySchemaString) ||\n+                    Arrays.equals(inboundSchemaString, mySchemaString);","path":"src/frontend/org/voltdb/VoltTable.java","position":291,"original_position":291,"commit_id":"90c10f337f69bb9430d7773b15714a070883f896","original_commit_id":"90c10f337f69bb9430d7773b15714a070883f896","user":{"login":"jhugg","id":634609,"avatar_url":"https://avatars.githubusercontent.com/u/634609?v=3","gravatar_id":"","url":"https://api.github.com/users/jhugg","html_url":"https://github.com/jhugg","followers_url":"https://api.github.com/users/jhugg/followers","following_url":"https://api.github.com/users/jhugg/following{/other_user}","gists_url":"https://api.github.com/users/jhugg/gists{/gist_id}","starred_url":"https://api.github.com/users/jhugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhugg/subscriptions","organizations_url":"https://api.github.com/users/jhugg/orgs","repos_url":"https://api.github.com/users/jhugg/repos","events_url":"https://api.github.com/users/jhugg/events{/privacy}","received_events_url":"https://api.github.com/users/jhugg/received_events","type":"User","site_admin":false},"body":"Not sure I mind this being explicit?","created_at":"2015-08-28T04:47:14Z","updated_at":"2015-08-28T04:47:14Z","html_url":"https://github.com/VoltDB/voltdb/pull/2743#discussion_r38170785","pull_request_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743","_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments/38170785"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/2743#discussion_r38170785"},"pull_request":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743"}}},"pull_request":{"url":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743","id":43334637,"html_url":"https://github.com/VoltDB/voltdb/pull/2743","diff_url":"https://github.com/VoltDB/voltdb/pull/2743.diff","patch_url":"https://github.com/VoltDB/voltdb/pull/2743.patch","issue_url":"https://api.github.com/repos/VoltDB/voltdb/issues/2743","number":2743,"state":"open","locked":false,"title":"Eng 8824 Speed up java restore times","user":{"login":"jhugg","id":634609,"avatar_url":"https://avatars.githubusercontent.com/u/634609?v=3","gravatar_id":"","url":"https://api.github.com/users/jhugg","html_url":"https://github.com/jhugg","followers_url":"https://api.github.com/users/jhugg/followers","following_url":"https://api.github.com/users/jhugg/following{/other_user}","gists_url":"https://api.github.com/users/jhugg/gists{/gist_id}","starred_url":"https://api.github.com/users/jhugg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhugg/subscriptions","organizations_url":"https://api.github.com/users/jhugg/orgs","repos_url":"https://api.github.com/users/jhugg/repos","events_url":"https://api.github.com/users/jhugg/events{/privacy}","received_events_url":"https://api.github.com/users/jhugg/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-25T20:47:54Z","updated_at":"2015-08-28T04:47:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f18977167f1f1d585aca2b90809d7b5a229776a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743/commits","review_comments_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743/comments","review_comment_url":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/issues/2743/comments","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/90c10f337f69bb9430d7773b15714a070883f896","head":{"label":"VoltDB:ENG-8824-javarestore-hugg","ref":"ENG-8824-javarestore-hugg","sha":"90c10f337f69bb9430d7773b15714a070883f896","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","created_at":"2011-09-23T18:46:12Z","updated_at":"2015-08-27T02:34:09Z","pushed_at":"2015-08-28T03:24:36Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":888974,"stargazers_count":617,"watchers_count":617,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":180,"mirror_url":null,"open_issues_count":43,"forks":180,"open_issues":43,"watchers":617,"default_branch":"master"}},"base":{"label":"VoltDB:master","ref":"master","sha":"daa33f60a5667be00d2805547c253ac51b14872d","user":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"repo":{"id":2445970,"name":"voltdb","full_name":"VoltDB/voltdb","owner":{"login":"VoltDB","id":703910,"avatar_url":"https://avatars.githubusercontent.com/u/703910?v=3","gravatar_id":"","url":"https://api.github.com/users/VoltDB","html_url":"https://github.com/VoltDB","followers_url":"https://api.github.com/users/VoltDB/followers","following_url":"https://api.github.com/users/VoltDB/following{/other_user}","gists_url":"https://api.github.com/users/VoltDB/gists{/gist_id}","starred_url":"https://api.github.com/users/VoltDB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VoltDB/subscriptions","organizations_url":"https://api.github.com/users/VoltDB/orgs","repos_url":"https://api.github.com/users/VoltDB/repos","events_url":"https://api.github.com/users/VoltDB/events{/privacy}","received_events_url":"https://api.github.com/users/VoltDB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VoltDB/voltdb","description":"VoltDB","fork":false,"url":"https://api.github.com/repos/VoltDB/voltdb","forks_url":"https://api.github.com/repos/VoltDB/voltdb/forks","keys_url":"https://api.github.com/repos/VoltDB/voltdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VoltDB/voltdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VoltDB/voltdb/teams","hooks_url":"https://api.github.com/repos/VoltDB/voltdb/hooks","issue_events_url":"https://api.github.com/repos/VoltDB/voltdb/issues/events{/number}","events_url":"https://api.github.com/repos/VoltDB/voltdb/events","assignees_url":"https://api.github.com/repos/VoltDB/voltdb/assignees{/user}","branches_url":"https://api.github.com/repos/VoltDB/voltdb/branches{/branch}","tags_url":"https://api.github.com/repos/VoltDB/voltdb/tags","blobs_url":"https://api.github.com/repos/VoltDB/voltdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VoltDB/voltdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VoltDB/voltdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/VoltDB/voltdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VoltDB/voltdb/statuses/{sha}","languages_url":"https://api.github.com/repos/VoltDB/voltdb/languages","stargazers_url":"https://api.github.com/repos/VoltDB/voltdb/stargazers","contributors_url":"https://api.github.com/repos/VoltDB/voltdb/contributors","subscribers_url":"https://api.github.com/repos/VoltDB/voltdb/subscribers","subscription_url":"https://api.github.com/repos/VoltDB/voltdb/subscription","commits_url":"https://api.github.com/repos/VoltDB/voltdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/VoltDB/voltdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/VoltDB/voltdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/VoltDB/voltdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/VoltDB/voltdb/contents/{+path}","compare_url":"https://api.github.com/repos/VoltDB/voltdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VoltDB/voltdb/merges","archive_url":"https://api.github.com/repos/VoltDB/voltdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VoltDB/voltdb/downloads","issues_url":"https://api.github.com/repos/VoltDB/voltdb/issues{/number}","pulls_url":"https://api.github.com/repos/VoltDB/voltdb/pulls{/number}","milestones_url":"https://api.github.com/repos/VoltDB/voltdb/milestones{/number}","notifications_url":"https://api.github.com/repos/VoltDB/voltdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VoltDB/voltdb/labels{/name}","releases_url":"https://api.github.com/repos/VoltDB/voltdb/releases{/id}","created_at":"2011-09-23T18:46:12Z","updated_at":"2015-08-27T02:34:09Z","pushed_at":"2015-08-28T03:24:36Z","git_url":"git://github.com/VoltDB/voltdb.git","ssh_url":"git@github.com:VoltDB/voltdb.git","clone_url":"https://github.com/VoltDB/voltdb.git","svn_url":"https://github.com/VoltDB/voltdb","homepage":"http://community.voltdb.com/","size":888974,"stargazers_count":617,"watchers_count":617,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":180,"mirror_url":null,"open_issues_count":43,"forks":180,"open_issues":43,"watchers":617,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743"},"html":{"href":"https://github.com/VoltDB/voltdb/pull/2743"},"issue":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/2743"},"comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/issues/2743/comments"},"review_comments":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743/comments"},"review_comment":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/VoltDB/voltdb/pulls/2743/commits"},"statuses":{"href":"https://api.github.com/repos/VoltDB/voltdb/statuses/90c10f337f69bb9430d7773b15714a070883f896"}}}}