GitHub PullRequestReviewCommentEvent at 2014-09-22 08:25:10
Repository: neo4j
Actor: tinwelint
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/neo4j/neo4j/pulls/comments/17837081","id":17837081,"diff_hunk":"@@ -0,0 +1,93 @@\n+/**\n+ * Copyright (c) 2002-2014 \"Neo Technology,\"\n+ * Network Engine for Objects in Lund AB [http://neotechnology.com]\n+ *\n+ * This file is part of Neo4j.\n+ *\n+ * Neo4j is free software: you can redistribute it and/or modify\n+ * it under the terms of the GNU General Public License as published by\n+ * the Free Software Foundation, either version 3 of the License, or\n+ * (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ * GNU General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU General Public License\n+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ */\n+package org.neo4j.kernel.impl.storemigration.legacylogs;\n+\n+import java.io.File;\n+import java.io.IOException;\n+import java.nio.ByteBuffer;\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+import org.neo4j.helpers.Pair;\n+import org.neo4j.io.fs.FileSystemAbstraction;\n+import org.neo4j.io.fs.StoreChannel;\n+import org.neo4j.kernel.impl.transaction.xaframework.PhysicalLogVersionedStoreChannel;\n+import org.neo4j.kernel.impl.transaction.xaframework.ReadAheadLogChannel;\n+import org.neo4j.kernel.impl.transaction.xaframework.ReadableLogChannel;\n+import org.neo4j.kernel.impl.transaction.xaframework.log.entry.IdentifiableLogEntry;\n+import org.neo4j.kernel.impl.transaction.xaframework.log.entry.LogEntry;\n+import org.neo4j.kernel.impl.transaction.xaframework.log.entry.LogEntryReader;\n+import org.neo4j.kernel.impl.transaction.xaframework.log.entry.LogHeader;\n+import org.neo4j.kernel.impl.transaction.xaframework.log.entry.VersionAwareLogEntryReader;\n+\n+import static org.neo4j.kernel.impl.transaction.xaframework.LogVersionBridge.NO_MORE_CHANNELS;\n+import static org.neo4j.kernel.impl.transaction.xaframework.ReadAheadLogChannel.DEFAULT_READ_AHEAD_SIZE;\n+import static org.neo4j.kernel.impl.transaction.xaframework.log.entry.LogHeaderParser.LOG_HEADER_SIZE;\n+import static org.neo4j.kernel.impl.transaction.xaframework.log.entry.LogHeaderParser.readLogHeader;\n+\n+class LegacyLogEntryReader\n+{\n+    private final FileSystemAbstraction fs;\n+    private final LogEntryReader<ReadableLogChannel> reader;\n+\n+    LegacyLogEntryReader( FileSystemAbstraction fs, LogEntryReader<ReadableLogChannel> reader )\n+    {\n+        this.fs = fs;\n+        this.reader = reader;\n+    }\n+\n+    LegacyLogEntryReader( FileSystemAbstraction fs )\n+    {\n+        this( fs, new VersionAwareLogEntryReader() );\n+    }\n+\n+    public Pair<LogHeader, ReadableLogChannel> openReadableChannel( File logFile )\n+            throws IOException\n+    {\n+        final StoreChannel rawChannel = fs.open( logFile, \"r\" );\n+        final ByteBuffer buffer = ByteBuffer.allocate( LOG_HEADER_SIZE );\n+\n+        final LogHeader header = readLogHeader( buffer, rawChannel, false );\n+\n+        final PhysicalLogVersionedStoreChannel channel =\n+                new PhysicalLogVersionedStoreChannel( rawChannel, header.logVersion, header.logFormatVersion );\n+        final ReadableLogChannel readableChannel =\n+                new ReadAheadLogChannel( channel, NO_MORE_CHANNELS, DEFAULT_READ_AHEAD_SIZE );\n+        return Pair.of( header, readableChannel );\n+    }\n+\n+    public List<IdentifiableLogEntry> readAllLogEntries( ReadableLogChannel channel ) throws IOException","path":"community/kernel/src/main/java/org/neo4j/kernel/impl/storemigration/legacylogs/LegacyLogEntryReader.java","position":76,"original_position":76,"commit_id":"09398db0ee85334280e16864a9d4f04d89096bd1","original_commit_id":"09398db0ee85334280e16864a9d4f04d89096bd1","user":{"login":"tinwelint","id":187292,"avatar_url":"https://avatars.githubusercontent.com/u/187292?v=2","gravatar_id":"a0f1eb12fa769dec410ae34685ced24d","url":"https://api.github.com/users/tinwelint","html_url":"https://github.com/tinwelint","followers_url":"https://api.github.com/users/tinwelint/followers","following_url":"https://api.github.com/users/tinwelint/following{/other_user}","gists_url":"https://api.github.com/users/tinwelint/gists{/gist_id}","starred_url":"https://api.github.com/users/tinwelint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinwelint/subscriptions","organizations_url":"https://api.github.com/users/tinwelint/orgs","repos_url":"https://api.github.com/users/tinwelint/repos","events_url":"https://api.github.com/users/tinwelint/events{/privacy}","received_events_url":"https://api.github.com/users/tinwelint/received_events","type":"User","site_admin":false},"body":"No no. The old LogExtractor did sorting and all that and kept only the interleaved parts in memory at all time. I hinted that you could have brought that thing back in to just do these legacy migrations.","created_at":"2014-09-22T08:25:10Z","updated_at":"2014-09-22T08:25:10Z","html_url":"https://github.com/neo4j/neo4j/pull/3053#discussion_r17837081","pull_request_url":"https://api.github.com/repos/neo4j/neo4j/pulls/3053","_links":{"self":{"href":"https://api.github.com/repos/neo4j/neo4j/pulls/comments/17837081"},"html":{"href":"https://github.com/neo4j/neo4j/pull/3053#discussion_r17837081"},"pull_request":{"href":"https://api.github.com/repos/neo4j/neo4j/pulls/3053"}}},"pull_request":{"url":"https://api.github.com/repos/neo4j/neo4j/pulls/3053","id":21219553,"html_url":"https://github.com/neo4j/neo4j/pull/3053","diff_url":"https://github.com/neo4j/neo4j/pull/3053.diff","patch_url":"https://github.com/neo4j/neo4j/pull/3053.patch","issue_url":"https://api.github.com/repos/neo4j/neo4j/issues/3053","number":3053,"state":"open","locked":false,"title":"[master] Migrate logs from older versions","user":{"login":"davidegrohmann","id":6573166,"avatar_url":"https://avatars.githubusercontent.com/u/6573166?v=2","gravatar_id":"04bfd323a5d6b300701df22d130b3e3c","url":"https://api.github.com/users/davidegrohmann","html_url":"https://github.com/davidegrohmann","followers_url":"https://api.github.com/users/davidegrohmann/followers","following_url":"https://api.github.com/users/davidegrohmann/following{/other_user}","gists_url":"https://api.github.com/users/davidegrohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/davidegrohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidegrohmann/subscriptions","organizations_url":"https://api.github.com/users/davidegrohmann/orgs","repos_url":"https://api.github.com/users/davidegrohmann/repos","events_url":"https://api.github.com/users/davidegrohmann/events{/privacy}","received_events_url":"https://api.github.com/users/davidegrohmann/received_events","type":"User","site_admin":false},"body":"Despite the fact that we can read older log versions at the runtime, this PR will add an extra step to the upgrade process which will be responsible to migrate older logs and order log entries. This is necessary because we must be able to read commit entries from the log files in the correct order. Indeed, entries can be mixed up in older log files but they _must_ be order by transaction id in 2.2.\r\n\r\nIntegration tests will be added in a separate PR, since it will require some kind of tool for \"mixing up\" entries in older log files.","created_at":"2014-09-15T08:54:03Z","updated_at":"2014-09-22T08:25:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bb76957b9f3dbe3e9e6e1a0451e4845662cc572","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neo4j/neo4j/pulls/3053/commits","review_comments_url":"https://api.github.com/repos/neo4j/neo4j/pulls/3053/comments","review_comment_url":"https://api.github.com/repos/neo4j/neo4j/pulls/comments/{number}","comments_url":"https://api.github.com/repos/neo4j/neo4j/issues/3053/comments","statuses_url":"https://api.github.com/repos/neo4j/neo4j/statuses/09398db0ee85334280e16864a9d4f04d89096bd1","head":{"label":"davidegrohmann:2.2-migrate-logs","ref":"2.2-migrate-logs","sha":"09398db0ee85334280e16864a9d4f04d89096bd1","user":{"login":"davidegrohmann","id":6573166,"avatar_url":"https://avatars.githubusercontent.com/u/6573166?v=2","gravatar_id":"04bfd323a5d6b300701df22d130b3e3c","url":"https://api.github.com/users/davidegrohmann","html_url":"https://github.com/davidegrohmann","followers_url":"https://api.github.com/users/davidegrohmann/followers","following_url":"https://api.github.com/users/davidegrohmann/following{/other_user}","gists_url":"https://api.github.com/users/davidegrohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/davidegrohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidegrohmann/subscriptions","organizations_url":"https://api.github.com/users/davidegrohmann/orgs","repos_url":"https://api.github.com/users/davidegrohmann/repos","events_url":"https://api.github.com/users/davidegrohmann/events{/privacy}","received_events_url":"https://api.github.com/users/davidegrohmann/received_events","type":"User","site_admin":false},"repo":{"id":16693960,"name":"neo4j","full_name":"davidegrohmann/neo4j","owner":{"login":"davidegrohmann","id":6573166,"avatar_url":"https://avatars.githubusercontent.com/u/6573166?v=2","gravatar_id":"04bfd323a5d6b300701df22d130b3e3c","url":"https://api.github.com/users/davidegrohmann","html_url":"https://github.com/davidegrohmann","followers_url":"https://api.github.com/users/davidegrohmann/followers","following_url":"https://api.github.com/users/davidegrohmann/following{/other_user}","gists_url":"https://api.github.com/users/davidegrohmann/gists{/gist_id}","starred_url":"https://api.github.com/users/davidegrohmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidegrohmann/subscriptions","organizations_url":"https://api.github.com/users/davidegrohmann/orgs","repos_url":"https://api.github.com/users/davidegrohmann/repos","events_url":"https://api.github.com/users/davidegrohmann/events{/privacy}","received_events_url":"https://api.github.com/users/davidegrohmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davidegrohmann/neo4j","description":"The World's Leading Graph Database","fork":true,"url":"https://api.github.com/repos/davidegrohmann/neo4j","forks_url":"https://api.github.com/repos/davidegrohmann/neo4j/forks","keys_url":"https://api.github.com/repos/davidegrohmann/neo4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davidegrohmann/neo4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davidegrohmann/neo4j/teams","hooks_url":"https://api.github.com/repos/davidegrohmann/neo4j/hooks","issue_events_url":"https://api.github.com/repos/davidegrohmann/neo4j/issues/events{/number}","events_url":"https://api.github.com/repos/davidegrohmann/neo4j/events","assignees_url":"https://api.github.com/repos/davidegrohmann/neo4j/assignees{/user}","branches_url":"https://api.github.com/repos/davidegrohmann/neo4j/branches{/branch}","tags_url":"https://api.github.com/repos/davidegrohmann/neo4j/tags","blobs_url":"https://api.github.com/repos/davidegrohmann/neo4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davidegrohmann/neo4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davidegrohmann/neo4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/davidegrohmann/neo4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davidegrohmann/neo4j/statuses/{sha}","languages_url":"https://api.github.com/repos/davidegrohmann/neo4j/languages","stargazers_url":"https://api.github.com/repos/davidegrohmann/neo4j/stargazers","contributors_url":"https://api.github.com/repos/davidegrohmann/neo4j/contributors","subscribers_url":"https://api.github.com/repos/davidegrohmann/neo4j/subscribers","subscription_url":"https://api.github.com/repos/davidegrohmann/neo4j/subscription","commits_url":"https://api.github.com/repos/davidegrohmann/neo4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/davidegrohmann/neo4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/davidegrohmann/neo4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/davidegrohmann/neo4j/issues/comments/{number}","contents_url":"https://api.github.com/repos/davidegrohmann/neo4j/contents/{+path}","compare_url":"https://api.github.com/repos/davidegrohmann/neo4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davidegrohmann/neo4j/merges","archive_url":"https://api.github.com/repos/davidegrohmann/neo4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davidegrohmann/neo4j/downloads","issues_url":"https://api.github.com/repos/davidegrohmann/neo4j/issues{/number}","pulls_url":"https://api.github.com/repos/davidegrohmann/neo4j/pulls{/number}","milestones_url":"https://api.github.com/repos/davidegrohmann/neo4j/milestones{/number}","notifications_url":"https://api.github.com/repos/davidegrohmann/neo4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davidegrohmann/neo4j/labels{/name}","releases_url":"https://api.github.com/repos/davidegrohmann/neo4j/releases{/id}","created_at":"2014-02-10T11:59:43Z","updated_at":"2014-06-19T09:04:32Z","pushed_at":"2014-09-21T08:29:27Z","git_url":"git://github.com/davidegrohmann/neo4j.git","ssh_url":"git@github.com:davidegrohmann/neo4j.git","clone_url":"https://github.com/davidegrohmann/neo4j.git","svn_url":"https://github.com/davidegrohmann/neo4j","homepage":"http://neo4j.org","size":154601,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"neo4j:master","ref":"master","sha":"b9c49263e802d8debb9f3a68abe864a8e4fc770b","user":{"login":"neo4j","id":201120,"avatar_url":"https://avatars.githubusercontent.com/u/201120?v=2","gravatar_id":"1ecfef76afc397d0fb30b973e9508e41","url":"https://api.github.com/users/neo4j","html_url":"https://github.com/neo4j","followers_url":"https://api.github.com/users/neo4j/followers","following_url":"https://api.github.com/users/neo4j/following{/other_user}","gists_url":"https://api.github.com/users/neo4j/gists{/gist_id}","starred_url":"https://api.github.com/users/neo4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neo4j/subscriptions","organizations_url":"https://api.github.com/users/neo4j/orgs","repos_url":"https://api.github.com/users/neo4j/repos","events_url":"https://api.github.com/users/neo4j/events{/privacy}","received_events_url":"https://api.github.com/users/neo4j/received_events","type":"Organization","site_admin":false},"repo":{"id":6650539,"name":"neo4j","full_name":"neo4j/neo4j","owner":{"login":"neo4j","id":201120,"avatar_url":"https://avatars.githubusercontent.com/u/201120?v=2","gravatar_id":"1ecfef76afc397d0fb30b973e9508e41","url":"https://api.github.com/users/neo4j","html_url":"https://github.com/neo4j","followers_url":"https://api.github.com/users/neo4j/followers","following_url":"https://api.github.com/users/neo4j/following{/other_user}","gists_url":"https://api.github.com/users/neo4j/gists{/gist_id}","starred_url":"https://api.github.com/users/neo4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neo4j/subscriptions","organizations_url":"https://api.github.com/users/neo4j/orgs","repos_url":"https://api.github.com/users/neo4j/repos","events_url":"https://api.github.com/users/neo4j/events{/privacy}","received_events_url":"https://api.github.com/users/neo4j/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neo4j/neo4j","description":"Graphs for Everyone","fork":false,"url":"https://api.github.com/repos/neo4j/neo4j","forks_url":"https://api.github.com/repos/neo4j/neo4j/forks","keys_url":"https://api.github.com/repos/neo4j/neo4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neo4j/neo4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neo4j/neo4j/teams","hooks_url":"https://api.github.com/repos/neo4j/neo4j/hooks","issue_events_url":"https://api.github.com/repos/neo4j/neo4j/issues/events{/number}","events_url":"https://api.github.com/repos/neo4j/neo4j/events","assignees_url":"https://api.github.com/repos/neo4j/neo4j/assignees{/user}","branches_url":"https://api.github.com/repos/neo4j/neo4j/branches{/branch}","tags_url":"https://api.github.com/repos/neo4j/neo4j/tags","blobs_url":"https://api.github.com/repos/neo4j/neo4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neo4j/neo4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neo4j/neo4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/neo4j/neo4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neo4j/neo4j/statuses/{sha}","languages_url":"https://api.github.com/repos/neo4j/neo4j/languages","stargazers_url":"https://api.github.com/repos/neo4j/neo4j/stargazers","contributors_url":"https://api.github.com/repos/neo4j/neo4j/contributors","subscribers_url":"https://api.github.com/repos/neo4j/neo4j/subscribers","subscription_url":"https://api.github.com/repos/neo4j/neo4j/subscription","commits_url":"https://api.github.com/repos/neo4j/neo4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/neo4j/neo4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/neo4j/neo4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/neo4j/neo4j/issues/comments/{number}","contents_url":"https://api.github.com/repos/neo4j/neo4j/contents/{+path}","compare_url":"https://api.github.com/repos/neo4j/neo4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neo4j/neo4j/merges","archive_url":"https://api.github.com/repos/neo4j/neo4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neo4j/neo4j/downloads","issues_url":"https://api.github.com/repos/neo4j/neo4j/issues{/number}","pulls_url":"https://api.github.com/repos/neo4j/neo4j/pulls{/number}","milestones_url":"https://api.github.com/repos/neo4j/neo4j/milestones{/number}","notifications_url":"https://api.github.com/repos/neo4j/neo4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neo4j/neo4j/labels{/name}","releases_url":"https://api.github.com/repos/neo4j/neo4j/releases{/id}","created_at":"2012-11-12T08:46:15Z","updated_at":"2014-09-22T08:13:48Z","pushed_at":"2014-09-22T06:54:10Z","git_url":"git://github.com/neo4j/neo4j.git","ssh_url":"git@github.com:neo4j/neo4j.git","clone_url":"https://github.com/neo4j/neo4j.git","svn_url":"https://github.com/neo4j/neo4j","homepage":"http://neo4j.org","size":349451,"stargazers_count":1094,"watchers_count":1094,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":506,"mirror_url":null,"open_issues_count":411,"forks":506,"open_issues":411,"watchers":1094,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neo4j/neo4j/pulls/3053"},"html":{"href":"https://github.com/neo4j/neo4j/pull/3053"},"issue":{"href":"https://api.github.com/repos/neo4j/neo4j/issues/3053"},"comments":{"href":"https://api.github.com/repos/neo4j/neo4j/issues/3053/comments"},"review_comments":{"href":"https://api.github.com/repos/neo4j/neo4j/pulls/3053/comments"},"review_comment":{"href":"https://api.github.com/repos/neo4j/neo4j/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/neo4j/neo4j/pulls/3053/commits"},"statuses":{"href":"https://api.github.com/repos/neo4j/neo4j/statuses/09398db0ee85334280e16864a9d4f04d89096bd1"}}}}