|
From: Bryan T. <tho...@us...> - 2007-03-29 17:01:38
|
Update of /cvsroot/cweb/bigdata/src/java/com/bigdata/journal In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16125/src/java/com/bigdata/journal Modified Files: IJournal.java ResourceManager.java AbstractBufferStrategy.java RootBlockView.java AbstractJournal.java Log Message: Fixed bug in overflow handling for triple store. Added DataService UUID[] to partition metadata. Index: RootBlockView.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/RootBlockView.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RootBlockView.java 27 Mar 2007 14:34:23 -0000 1.15 --- RootBlockView.java 29 Mar 2007 17:01:33 -0000 1.16 *************** *** 392,396 **** sb.append(", commitRecordAddr="+Addr.toString(getCommitRecordAddr())); sb.append(", commitRecordIndexAddr="+Addr.toString(getCommitRecordIndexAddr())); ! sb.append(", segmentUUID="+getUUID()); sb.append("}"); --- 392,396 ---- sb.append(", commitRecordAddr="+Addr.toString(getCommitRecordAddr())); sb.append(", commitRecordIndexAddr="+Addr.toString(getCommitRecordIndexAddr())); ! sb.append(", uuid="+getUUID()); sb.append("}"); Index: ResourceManager.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/ResourceManager.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceManager.java 15 Mar 2007 16:11:12 -0000 1.1 --- ResourceManager.java 29 Mar 2007 17:01:33 -0000 1.2 *************** *** 218,222 **** * extension metadata record at this time. this means that we can not * aggregate events for index segments for a given named index at this ! * time. */ static public void openIndexSegment(String name, String filename, long nbytes) { --- 218,222 ---- * extension metadata record at this time. this means that we can not * aggregate events for index segments for a given named index at this ! * time (actually, we can aggregate them by the indexUUID). */ static public void openIndexSegment(String name, String filename, long nbytes) { Index: AbstractJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/AbstractJournal.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AbstractJournal.java 27 Mar 2007 17:11:41 -0000 1.8 --- AbstractJournal.java 29 Mar 2007 17:01:33 -0000 1.9 *************** *** 308,312 **** public AbstractJournal(Properties properties) { - // int segmentId; long initialExtent = Options.DEFAULT_INITIAL_EXTENT; long maximumExtent = Options.DEFAULT_MAXIMUM_EXTENT; --- 308,311 ---- *************** *** 337,345 **** val = properties.getProperty(Options.BUFFER_MODE); ! if (val == null) val = BufferMode.Direct.toString(); BufferMode bufferMode = BufferMode.parse(val); /* * "useDirectBuffers" --- 336,349 ---- val = properties.getProperty(Options.BUFFER_MODE); ! if (val == null) { ! val = BufferMode.Direct.toString(); + + } BufferMode bufferMode = BufferMode.parse(val); + System.err.println(Options.BUFFER_MODE+"="+bufferMode); + /* * "useDirectBuffers" *************** *** 410,414 **** throw new RuntimeException("The '" + Options.MAXIMUM_EXTENT ! + "' is less than the initial extent."); } --- 414,419 ---- throw new RuntimeException("The '" + Options.MAXIMUM_EXTENT ! + "' (" + maximumExtent ! + ") is less than the initial extent ("+initialExtent+")."); } *************** *** 1154,1160 **** final int nextOffset = _bufferStrategy.getNextOffset(); ! if (nextOffset > .9 * maximumExtent) { ! overflow(); } --- 1159,1185 ---- final int nextOffset = _bufferStrategy.getNextOffset(); ! /* ! * Choose maximum of the target maximum extent and the current user ! * data extent so that we do not re-trigger overflow immediately if ! * the buffer has been extended beyond the target maximum extent. ! * Among other things this lets you run the buffer up to a ! * relatively large extent (if you use a disk-only mode since you ! * will run out of memory if you use a fully buffered mode). ! */ ! final long limit = Math.max(maximumExtent, _bufferStrategy ! .getUserExtent()); ! ! if (nextOffset > .9 * limit) { ! if( overflow() ) { ! ! /* ! * Someone handled the overflow event by opening a new ! * journal to absorb further writes. ! */ ! ResourceManager.overflowJournal(getFile() == null ? null ! : getFile().toString(), size()); ! ! } } *************** *** 1168,1179 **** /** * Note: This implementation does not handle overflow of the journal. The ! * journal capacity will simply be extended until the available resources ! * are exhausted. */ ! public void overflow() { ! ! ResourceManager.overflowJournal(getFile() == null ? null : getFile() ! .toString(), size()); } --- 1193,1206 ---- /** * Note: This implementation does not handle overflow of the journal. The ! * journal capacity will simply be extended by {@link #write(ByteBuffer)} ! * until the available resources are exhausted. ! * ! * @return This implementation returns <code>false</code> since it does ! * NOT open a new journal. */ ! public boolean overflow() { + return false; + } *************** *** 1624,1628 **** // report event. ! ResourceManager.openUnisolatedBTree(name); } --- 1651,1655 ---- // report event. ! ResourceManager.dropUnisolatedBTree(name); } Index: AbstractBufferStrategy.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/AbstractBufferStrategy.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AbstractBufferStrategy.java 27 Mar 2007 17:11:41 -0000 1.14 --- AbstractBufferStrategy.java 29 Mar 2007 17:01:33 -0000 1.15 *************** *** 131,135 **** * operation should be retried. */ ! public boolean overflow(int needed) { final long userExtent = getUserExtent(); --- 131,135 ---- * operation should be retried. */ ! final public boolean overflow(int needed) { final long userExtent = getUserExtent(); Index: IJournal.java =================================================================== RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/journal/IJournal.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IJournal.java 15 Mar 2007 16:11:12 -0000 1.10 --- IJournal.java 29 Mar 2007 17:01:32 -0000 1.11 *************** *** 83,88 **** * event is not handled then the journal will automatically extent itself * until it either runs out of address space (int32) or other resources. */ ! public void overflow(); /** --- 83,92 ---- * event is not handled then the journal will automatically extent itself * until it either runs out of address space (int32) or other resources. + * + * @return true iff the overflow event was handled (e.g., if a new journal + * was created to absorb subsequent writes). if a new journal is NOT + * opened then this method should return false. */ ! public boolean overflow(); /** |