Update of /cvsroot/cweb/bigdata/src/java/com/bigdata/journal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6186/src/java/com/bigdata/journal Modified Files: TemporaryStore.java Name2Addr.java CommitRecordIndex.java AbstractJournal.java RootBlockView.java ReadCommittedTx.java Log Message: Added indexUUID to AbstractBTree so that each scale-out index may have a unique indentifier. Modified the BTreeMetadata class and derived classes to use Externalizable, to support explicit versioning of the metadata record, and to have private fields since they can not be final with Externalizable. Index: ReadCommittedTx.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/ReadCommittedTx.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReadCommittedTx.java 15 Mar 2007 16:11:13 -0000 1.3 --- ReadCommittedTx.java 27 Mar 2007 14:34:23 -0000 1.4 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.journal; + import java.util.UUID; + import com.bigdata.isolation.IIsolatableIndex; import com.bigdata.isolation.IIsolatedIndex; *************** *** 244,247 **** --- 246,253 ---- } + public UUID getIndexUUID() { + return getIndex().getIndexUUID(); + } + public boolean contains(byte[] key) { return getIndex().contains(key); Index: Name2Addr.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/Name2Addr.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Name2Addr.java 15 Mar 2007 16:11:12 -0000 1.7 --- Name2Addr.java 27 Mar 2007 14:34:23 -0000 1.8 *************** *** 8,11 **** --- 8,12 ---- import java.util.Locale; import java.util.Map; + import java.util.UUID; import org.CognitiveWeb.extser.LongPacker; *************** *** 70,74 **** public Name2Addr(IRawStore store) { ! super(store, DEFAULT_BRANCHING_FACTOR, ValueSerializer.INSTANCE); // this.journal = store; --- 71,76 ---- public Name2Addr(IRawStore store) { ! super(store, DEFAULT_BRANCHING_FACTOR, UUID.randomUUID(), ! ValueSerializer.INSTANCE); // this.journal = store; Index: CommitRecordIndex.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/CommitRecordIndex.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CommitRecordIndex.java 12 Mar 2007 18:06:11 -0000 1.3 --- CommitRecordIndex.java 27 Mar 2007 14:34:23 -0000 1.4 *************** *** 4,7 **** --- 4,8 ---- import java.io.DataOutputStream; import java.io.IOException; + import java.util.UUID; import org.CognitiveWeb.extser.LongPacker; *************** *** 50,54 **** public CommitRecordIndex(IRawStore store) { ! super(store, DEFAULT_BRANCHING_FACTOR, ValueSerializer.INSTANCE); } --- 51,56 ---- public CommitRecordIndex(IRawStore store) { ! super(store, DEFAULT_BRANCHING_FACTOR, UUID.randomUUID(), ! ValueSerializer.INSTANCE); } Index: AbstractJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/AbstractJournal.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractJournal.java 23 Mar 2007 20:01:26 -0000 1.6 --- AbstractJournal.java 27 Mar 2007 14:34:23 -0000 1.7 *************** *** 1536,1540 **** public IIndex registerIndex(String name) { ! return registerIndex( name, new UnisolatedBTree(this)); } --- 1536,1540 ---- public IIndex registerIndex(String name) { ! return registerIndex(name, new UnisolatedBTree(this, UUID.randomUUID())); } Index: TemporaryStore.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/TemporaryStore.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TemporaryStore.java 12 Mar 2007 18:06:11 -0000 1.8 --- TemporaryStore.java 27 Mar 2007 14:34:23 -0000 1.9 *************** *** 48,51 **** --- 48,53 ---- package com.bigdata.journal; + import java.util.UUID; + import com.bigdata.objndx.BTree; import com.bigdata.objndx.ByteArrayValueSerializer; *************** *** 110,113 **** --- 112,116 ---- return registerIndex(name, new BTree(this, BTree.DEFAULT_BRANCHING_FACTOR, + UUID.randomUUID(), ByteArrayValueSerializer.INSTANCE)); Index: RootBlockView.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/RootBlockView.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RootBlockView.java 22 Mar 2007 21:11:25 -0000 1.14 --- RootBlockView.java 27 Mar 2007 14:34:23 -0000 1.15 *************** *** 150,154 **** * are no historical {@link ICommitRecord}s (this is true when * the store is first created). ! * @param uuid * The unique journal identifier. */ --- 150,154 ---- * are no historical {@link ICommitRecord}s (this is true when * the store is first created). ! * @param segmentUUID * The unique journal identifier. */ *************** *** 392,396 **** sb.append(", commitRecordAddr="+Addr.toString(getCommitRecordAddr())); sb.append(", commitRecordIndexAddr="+Addr.toString(getCommitRecordIndexAddr())); ! sb.append(", uuid="+getUUID()); sb.append("}"); --- 392,396 ---- sb.append(", commitRecordAddr="+Addr.toString(getCommitRecordAddr())); sb.append(", commitRecordIndexAddr="+Addr.toString(getCommitRecordIndexAddr())); ! sb.append(", segmentUUID="+getUUID()); sb.append("}"); |