From: Bryan T. <tho...@us...> - 2007-11-30 21:54:13
|
Update of /cvsroot/cweb/generic-native/src/java/org/CognitiveWeb/generic/core In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv29240/src/java/org/CognitiveWeb/generic/core Modified Files: LinkSetIndex.java AbstractBTree.java Log Message: Work on the bigdata-GOM integration. Index: AbstractBTree.java =================================================================== RCS file: /cvsroot/cweb/generic-native/src/java/org/CognitiveWeb/generic/core/AbstractBTree.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AbstractBTree.java 15 Jun 2006 15:46:50 -0000 1.5 --- AbstractBTree.java 30 Nov 2007 21:54:08 -0000 1.6 *************** *** 48,51 **** --- 48,53 ---- import java.io.IOException; + import java.io.ObjectInput; + import java.io.ObjectOutput; import java.util.Comparator; import java.util.Iterator; *************** *** 92,118 **** } - // /** - // * Constructor. - // * - // * @param om - // * The object manager. - // * @param nativeBTreeId - // * The configured persistent jdbm b+tree object. - // * @param coercer - // * @param successor - // * @param comparator - // */ - // - // public AbstractBTree(ObjectManager om, long nativeBTreeId, Coercer coercer, Successor successor, Comparator comparator ) { - // super( om ); - // if (nativeBTreeId == 0L) { - // throw new IllegalArgumentException(); - // } - // _nativeBTreeId = nativeBTreeId; - // _coercer = coercer; - // _successor = successor; - // _comparator = comparator; - // } - /** * Constructor clusters the new object with the <i>container</i>. --- 94,97 ---- *************** *** 179,189 **** * <p> * The {@link Comparator} that imposes the natural ordering inherent in the ! * data type for the coerced keys. * </p> * <p> ! * This must be a {@link Comparator} for {@link ICompositeKey}s iff the ! * index supports duplicate external keys. Such comparators wrap the basic ! * comparator for the data type and a total ordering on the index using the ! * object identifier of the indexed objects to break ties. * </p> */ --- 158,171 ---- * <p> * The {@link Comparator} that imposes the natural ordering inherent in the ! * data type for the coerced keys and <code>null</code> iff the index does ! * not use an application defined comparator (eg, the keys are always ! * byte[]s). * </p> * <p> ! * When non-<code>null</code> this must be a {@link Comparator} for ! * {@link ICompositeKey}s iff the index supports duplicate external keys. ! * Such comparators wrap the basic comparator for the data type and a total ! * ordering on the index using the object identifier of the indexed objects ! * to break ties. * </p> */ *************** *** 325,330 **** * @return A composite key. */ ! ! abstract public ICompositeKey newCompositeKey( Object coercedKey, long oid ); /** --- 307,311 ---- * @return A composite key. */ ! abstract public Object newCompositeKey( Object coercedKey, long oid ); /** *************** *** 343,347 **** return sb.toString(); } ! /** * <p> --- 324,365 ---- return sb.toString(); } ! ! //************************************************************ ! //********************* Externalizable *********************** ! //************************************************************ ! ! /** ! * <p> ! * This class has NO persistent state - concrete classes MUST extend this ! * method to write out any additional persistent state. ! * </p> ! */ ! public void writeExternal(ObjectOutput out) throws IOException { ! ! super.writeExternal(out); ! ! out.writeLong(_nativeBTreeId); ! out.writeObject(_coercer); ! out.writeObject(_successor); ! out.writeObject(_comparator); ! ! } ! ! /** ! * This class has NO persistent state - concrete classes MUST extend this ! * method to read in any additional persistent state. ! */ ! public void readExternal(ObjectInput in) throws IOException, ! ClassNotFoundException { ! ! super.readExternal(in); ! ! _nativeBTreeId = in.readLong(); ! _coercer = (Coercer) in.readObject(); ! _successor = (Successor) in.readObject(); ! _comparator = (Comparator) in.readObject(); ! ! } ! /** * <p> Index: LinkSetIndex.java =================================================================== RCS file: /cvsroot/cweb/generic-native/src/java/org/CognitiveWeb/generic/core/LinkSetIndex.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** LinkSetIndex.java 15 Jun 2006 15:46:50 -0000 1.17 --- LinkSetIndex.java 30 Nov 2007 21:54:08 -0000 1.18 *************** *** 2584,2594 **** try { ! final Object fromKey = coerce(key); ! final Object toKey = getBTree().getSuccessor().successor(fromKey); ! itr = getBTree().iterator(this,getInternalKey(false,fromKey, null), ! getInternalKey(false,toKey, null), true // resolve values. ); } --- 2584,2600 ---- try { ! final Object fromKey = coerce(key); ! final Object toKey = getBTree().getSuccessor().successor(fromKey); ! itr = getBTree().iterator(this, ! getInternalKey(false/* coerce */, fromKey, null/* what */), ! getInternalKey(false/* coerce */, toKey, null/* what */), ! true // resolve values. ); + // itr = getBTree().iterator(this, + // getInternalKey(false,fromKey, null), + // getInternalKey(false,toKey, null), true // resolve values. + // ); } *************** *** 2596,2602 **** catch (NoSuccessorException ex) { ! // Note: Since there is no possible successor to this ! // value, we just return the tail of the map. ! itr = (ILinkSetIndexIterator) getTail(key); --- 2602,2612 ---- catch (NoSuccessorException ex) { ! /* ! * Note: Since there is no possible successor to this value, we just ! * return the tail of the map. ! */ ! ! log.warn("No successor: key="+key); ! itr = (ILinkSetIndexIterator) getTail(key); *************** *** 2641,2646 **** return getBTree().iterator(this, ! getInternalKey(false,fromKey, null), ! getInternalKey(false,toKey, null), true // resolve values. ); --- 2651,2656 ---- return getBTree().iterator(this, ! getInternalKey(false/* coerce */, fromKey, null/* what */), ! getInternalKey(false/* coerce */, toKey, null/* what */), true // resolve values. ); |