You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ju...@apache.org on 2014/05/30 17:24:52 UTC
svn commit: r1598631 - in
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment:
RecordId.java file/FileStore.java
Author: jukka
Date: Fri May 30 15:24:52 2014
New Revision: 1598631
URL: http://svn.apache.org/r1598631
Log:
OAK-1804: TarMK compaction
Store record ids in the journal using a format compatible with Oak 1.0
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordId.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordId.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordId.java?rev=1598631&r1=1598630&r2=1598631&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordId.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/RecordId.java Fri May 30 15:24:52 2014
@@ -96,6 +96,13 @@ public final class RecordId implements C
return String.format("%s.%04x", segmentId, offset >> RECORD_ALIGN_BITS);
}
+ /**
+ * Returns the record id string representation used in Oak 1.0.
+ */
+ public String toString10() {
+ return String.format("%s:%d", segmentId, offset);
+ }
+
@Override
public int hashCode() {
return segmentId.hashCode() ^ offset;
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java?rev=1598631&r1=1598630&r2=1598631&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/segment/file/FileStore.java Fri May 30 15:24:52 2014
@@ -344,7 +344,7 @@ public class FileStore implements Segmen
synchronized (this) {
log.debug("TarMK journal update {} -> {}", before, after);
- journalFile.writeBytes(after + " root\n");
+ journalFile.writeBytes(after.toString10() + " root\n");
journalFile.getChannel().force(false);
persistedHead.set(after);