From: <mar...@us...> - 2010-10-09 09:11:47
|
Revision: 3763 http://bigdata.svn.sourceforge.net/bigdata/?rev=3763&view=rev Author: martyncutcher Date: 2010-10-09 09:11:41 +0000 (Sat, 09 Oct 2010) Log Message: ----------- Call RootBlockCommitter directly rather than via registration and immediately free meta-rallocation blocks to support "null" commit. Modified Paths: -------------- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractJournal.java branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/RootBlockCommitter.java branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java Modified: branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractJournal.java =================================================================== --- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2010-10-09 01:36:31 UTC (rev 3762) +++ branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/AbstractJournal.java 2010-10-09 09:11:41 UTC (rev 3763) @@ -633,6 +633,8 @@ private final long initialExtent; private final long minimumExtension; + private RootBlockCommitter m_rootBlockCommitter; + /** * The maximum extent before a {@link #commit()} will {@link #overflow()}. * In practice, overflow tries to trigger before this point in order to @@ -2300,8 +2302,13 @@ return 0L; } - + /* + * Explicitly call the RootBlockCommitter + */ + rootAddrs[PREV_ROOTBLOCK] = this.m_rootBlockCommitter.handleCommit(commitTime); + + /* * Write the commit record onto the store. * * @todo Modify to log the current root block and set the address of @@ -2767,9 +2774,11 @@ setupName2AddrBTree(getRootAddr(ROOT_NAME2ADDR)); /** - * Register committer to write previous root block + * Do not register committer to write previous root block, but + * instead just create it and call explicitly when required. This + * is a workaround to allow "void" transactions. */ - setCommitter(PREV_ROOTBLOCK, new RootBlockCommitter(this)); + m_rootBlockCommitter = new RootBlockCommitter(this); /** * If the strategy is a RWStrategy, then register the delete Modified: branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/RootBlockCommitter.java =================================================================== --- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/RootBlockCommitter.java 2010-10-09 01:36:31 UTC (rev 3762) +++ branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/journal/RootBlockCommitter.java 2010-10-09 09:11:41 UTC (rev 3763) @@ -47,7 +47,9 @@ * to be stored in the CommitRecord. */ public long handleCommit(final long commitTime) { - final ByteBuffer rbv = journal.getRootBlockView().asReadOnlyBuffer(); + IRootBlockView view = journal.getRootBlockView(); + + final ByteBuffer rbv = view.asReadOnlyBuffer(); /* * FIXME There is an API issue with the RWStore which does not allow * us to pass in a read-only buffer. Write unit tests for this on Modified: branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java =================================================================== --- branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2010-10-09 01:36:31 UTC (rev 3762) +++ branches/JOURNAL_HA_BRANCH/bigdata/src/java/com/bigdata/rwstore/RWStore.java 2010-10-09 09:11:41 UTC (rev 3763) @@ -1584,7 +1584,9 @@ throw new IllegalStateException("Returned MetaBits Address not valid!"); } - free(oldMetaBits, oldMetaBitsSize); + // Call immediateFree - no need to defer freeof metaBits, this + // has to stop somewhere! + immediateFree((int) oldMetaBits, oldMetaBitsSize); // save allocation headers Iterator iter = m_commitList.iterator(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |