From: Bryan T. <tho...@us...> - 2007-03-29 17:01:51
|
Update of /cvsroot/cweb/bigdata-rdf/src/java/com/bigdata/rdf In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16595/src/java/com/bigdata/rdf Modified Files: TripleStore.java RdfKeyBuilder.java Log Message: Fixed bug in overflow handling for triple store. Added DataService UUID[] to partition metadata. Index: RdfKeyBuilder.java =================================================================== RCS file: /cvsroot/cweb/bigdata-rdf/src/java/com/bigdata/rdf/RdfKeyBuilder.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RdfKeyBuilder.java 27 Mar 2007 14:35:08 -0000 1.8 --- RdfKeyBuilder.java 29 Mar 2007 17:01:47 -0000 1.9 *************** *** 177,180 **** --- 177,181 ---- keyBuilder.reset().append(CODE_LIT); + return appendString(text).getKey(); *************** *** 186,190 **** --- 187,193 ---- keyBuilder.reset().append(CODE_LCL); + appendString(languageCode).appendNul(); + return appendString(text).getKey(); *************** *** 209,212 **** --- 212,216 ---- keyBuilder.reset().append(CODE_DTL); + appendString(datatype).appendNul(); *************** *** 241,244 **** --- 245,252 ---- } + /** + * The key corresponding to the start of the literals section of the + * terms index. + */ public byte[] litStartKey() { *************** *** 247,250 **** --- 255,262 ---- } + /** + * The key corresponding to the first key after the literals section of the + * terms index. + */ public byte[] litEndKey() { Index: TripleStore.java =================================================================== RCS file: /cvsroot/cweb/bigdata-rdf/src/java/com/bigdata/rdf/TripleStore.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** TripleStore.java 27 Mar 2007 17:11:48 -0000 1.25 --- TripleStore.java 29 Mar 2007 17:01:47 -0000 1.26 *************** *** 202,206 **** * @version $Id$ */ ! public class TripleStore extends MasterJournal { /** --- 202,206 ---- * @version $Id$ */ ! public class TripleStore extends /*Master*/Journal { /** *************** *** 1066,1073 **** } ! public void overflow() { ! ! System.err.println("*** Overflow *** "); // the current state. final long counter = getCounter().getCounter(); --- 1066,1097 ---- } ! // /** ! // * FIXME The logic here should be triggered IFF the journal actually ! // * overflows (that is, iff a new journal is opened and the old journal ! // * becomes read-only). ! // * <p> ! // */ ! // public boolean overflow() { ! // ! // // invoke the base behavior on the super class. ! // boolean ret = super.overflow(); ! // ! // return ret; ! // ! // } + /** + * @todo The commit is required to make the new counter restart safe by + * placing an address for it into its root slot. + * <p> + * rather than having multiple commits during overflow, we should + * create a method to which control is handed before and after the + * overflow event processing in the base class which provides the + * opportunity for such maintenance events. we could then just setup + * the new counter and let the overflow handle the commit. + * + */ + protected Object willOverflow() { + // the current state. final long counter = getCounter().getCounter(); *************** *** 1080,1086 **** ndx_osp = null; this.counter = null; ! // invoke the base behavior on the super class. ! super.overflow(); // create a new counter that will be persisted on the new slave journal. --- 1104,1115 ---- ndx_osp = null; this.counter = null; + + return counter; + + } + + protected void didOverflow(Object state) { ! final long counter = (Long)state; // create a new counter that will be persisted on the new slave journal. *************** *** 1090,1102 **** setCommitter( ROOT_COUNTER, this.counter ); - /* - * @todo this commit is required to make the new counter restart safe by - * placing an address for it into its root slot. rather than having - * multiple commits during overflow, we should create a method to which - * control is handed before and after the overflow event processing in - * the base class which provides the opportunity for such maintenance - * events. we could then just setup the new counter and let the overflow - * handle the commit. - */ commit(); --- 1119,1122 ---- |