Update of /cvsroot/cweb/bigdata/src/java/com/bigdata/isolation
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7688/src/java/com/bigdata/isolation
Modified Files:
UnisolatedBTree.java
Log Message:
Added support for filtering and resolving on EntryIterator and worked through most of the test suite for UnsisolatedBTree.
Index: UnisolatedBTree.java
===================================================================
RCS file: /cvsroot/cweb/bigdata/src/java/com/bigdata/isolation/UnisolatedBTree.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** UnisolatedBTree.java 15 Feb 2007 01:34:22 -0000 1.2
--- UnisolatedBTree.java 15 Feb 2007 14:23:50 -0000 1.3
***************
*** 57,60 ****
--- 57,61 ----
import com.bigdata.objndx.IEntryIterator;
import com.bigdata.objndx.ISimpleBTree;
+ import com.bigdata.objndx.EntryIterator.EntryFilter;
import com.bigdata.rawstore.IRawStore;
***************
*** 339,352 ****
}
! @Override
public IEntryIterator rangeIterator(byte[] fromKey, byte[] toKey) {
! // TODO Auto-generated method stub
! return super.rangeIterator(fromKey, toKey);
}
- @Override
public IEntryIterator entryIterator() {
! // TODO Auto-generated method stub
! return super.entryIterator();
}
--- 340,385 ----
}
! /**
! * Visits only the non-deleted entries in the key range.
! */
public IEntryIterator rangeIterator(byte[] fromKey, byte[] toKey) {
!
! return root.rangeIterator(fromKey, toKey, DeletedEntryFilter.INSTANCE);
!
}
public IEntryIterator entryIterator() {
!
! return root.rangeIterator(null, null, DeletedEntryFilter.INSTANCE);
!
! }
!
! /**
! * A filter that hides deleted entries.
! *
! * @author <a href="mailto:tho...@us...">Bryan Thompson</a>
! * @version $Id$
! */
! public static class DeletedEntryFilter extends EntryFilter {
!
! static public final transient EntryFilter INSTANCE = new DeletedEntryFilter();
!
! private static final long serialVersionUID = 2783761261078831116L;
!
! public boolean isValid(Object value) {
!
! return ! ((Value)value).deleted;
!
! }
!
! /**
! * Resolve the {@link Value} to its {@link Value#datum}.
! */
! public Object resolve(Object value) {
!
! return ((Value)value).datum;
!
! }
!
}
|