From: <tho...@us...> - 2013-10-29 12:09:56
|
Revision: 7490 http://bigdata.svn.sourceforge.net/bigdata/?rev=7490&view=rev Author: thompsonbry Date: 2013-10-29 12:09:49 +0000 (Tue, 29 Oct 2013) Log Message: ----------- added the file name into the error messages. javadoc update on class. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/ha/halog/HALogReader.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/ha/halog/HALogReader.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/ha/halog/HALogReader.java 2013-10-29 12:07:08 UTC (rev 7489) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/ha/halog/HALogReader.java 2013-10-29 12:09:49 UTC (rev 7490) @@ -37,6 +37,7 @@ import org.apache.log4j.Logger; +import com.bigdata.ha.msg.IHAMessage; import com.bigdata.ha.msg.IHAWriteMessage; import com.bigdata.io.DirectBufferPool; import com.bigdata.io.FileChannelUtility; @@ -50,17 +51,13 @@ /** * Given an HALog file can be used to replay the file and can provide a readable - * dump of the content. + * dump of the content. When replaying, the current position is compared to the + * EOF to determine whether more data can be read. The called should call + * {@link IHALogReader#hasMoreBuffers()} and if so read the next associated + * buffer and process with the returned {@link IHAMessage}. If + * {@link IHALogReader#hasMoreBuffers()} is false, then the committing + * {@link IRootBlockView} should be used to commit the replayed transaction. * - * When replaying, the current position is compared to the EOF to determine - * whether more data can be read. - * - * The called should call hasMoreBuffers() and if so read the next associated - * buffer and process with the returned IHAMessage. - * - * If hasMoreBuffers() is false, then the committing rootBlock should be used to - * commit the replayed transaction. - * * @author Martyn Cutcher */ public class HALogReader implements IHALogReader { @@ -121,17 +118,19 @@ */ magic = m_raf.readInt(); } catch (IOException ex) { - throw new RuntimeException( - "Can not read magic. Is file locked by another process?", - ex); + throw new RuntimeException( + "Can not read magic. Is file locked by another process? file=" + + file, ex); } - if (magic != HALogWriter.MAGIC) - throw new RuntimeException("Bad HALog magic: expected=" - + HALogWriter.MAGIC + ", actual=" + magic); + if (magic != HALogWriter.MAGIC) + throw new RuntimeException("Bad HALog magic: file=" + file + + ", expected=" + HALogWriter.MAGIC + ", actual=" + + magic); version = m_raf.readInt(); if (version != HALogWriter.VERSION1) - throw new RuntimeException("Bad HALog version: expected=" - + HALogWriter.VERSION1 + ", actual=" + version); + throw new RuntimeException("Bad HALog version: file=" + file + + ", expected=" + HALogWriter.VERSION1 + ", actual=" + + version); final RootBlockUtility tmp = new RootBlockUtility(reopener, file, true/* validateChecksum */, false/* alternateRootBlock */, @@ -151,8 +150,9 @@ * Counters are inconsistent with either an empty log file or a * single transaction scope. */ - throw new IllegalStateException("Incompatible rootblocks: cc0=" - + cc0 + ", cc1=" + cc1); + throw new IllegalStateException( + "Incompatible rootblocks: file=" + file + ", cc0=" + + cc0 + ", cc1=" + cc1); } m_channel.position(HALogWriter.headerSize0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |