Still more BTree cleaning.
git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_btree_updates_next@611 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/BTreeFieldPrefixNSMLeafFrame.java b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/BTreeFieldPrefixNSMLeafFrame.java
index ead9feb..9710b61 100644
--- a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/BTreeFieldPrefixNSMLeafFrame.java
+++ b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/frames/BTreeFieldPrefixNSMLeafFrame.java
@@ -715,10 +715,10 @@
return slotManager.getSlotSize();
}
- @Override
- public void setPageTupleFieldCount(int fieldCount) {
- frameTuple.setFieldCount(fieldCount);
- }
+ //@Override
+ //public void setPageTupleFieldCount(int fieldCount) {
+ // frameTuple.setFieldCount(fieldCount);
+ //}
public ITreeIndexTupleWriter getTupleWriter() {
return tupleWriter;
diff --git a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java
index 1b909bb..112fcca 100644
--- a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java
+++ b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTree.java
@@ -29,6 +29,7 @@
import edu.uci.ics.hyracks.storage.am.btree.frames.BTreeNSMInteriorFrame;
import edu.uci.ics.hyracks.storage.am.common.api.IFreePageManager;
import edu.uci.ics.hyracks.storage.am.common.api.IIndexBulkLoadContext;
+import edu.uci.ics.hyracks.storage.am.common.api.IIndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndex;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexCursor;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexFrame;
@@ -40,7 +41,6 @@
import edu.uci.ics.hyracks.storage.am.common.frames.FrameOpSpaceStatus;
import edu.uci.ics.hyracks.storage.am.common.impls.TreeDiskOrderScanCursor;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.MultiComparator;
import edu.uci.ics.hyracks.storage.common.buffercache.IBufferCache;
import edu.uci.ics.hyracks.storage.common.buffercache.ICachedPage;
@@ -56,7 +56,6 @@
private final static int rootPage = 1;
private boolean created = false;
- private boolean loaded = false;
private final IFreePageManager freePageManager;
private final IBufferCache bufferCache;
@@ -95,7 +94,7 @@
@Override
public void open(int fileId) {
- this.fileId = fileId;
+ this.fileId = fileId;
}
@Override
@@ -115,7 +114,7 @@
@Override
public void diskOrderScan(ITreeIndexCursor icursor, ITreeIndexFrame leafFrame, ITreeIndexMetaDataFrame metaFrame,
- IndexOpContext ictx) throws HyracksDataException {
+ IIndexOpContext ictx) throws HyracksDataException {
TreeDiskOrderScanCursor cursor = (TreeDiskOrderScanCursor) icursor;
BTreeOpContext ctx = (BTreeOpContext) ictx;
ctx.reset();
@@ -246,7 +245,7 @@
}
}
- private void insertUpdateOrDelete(ITupleReference tuple, IndexOpContext ictx) throws HyracksDataException, TreeIndexException {
+ private void insertUpdateOrDelete(ITupleReference tuple, IIndexOpContext ictx) throws HyracksDataException, TreeIndexException {
BTreeOpContext ctx = (BTreeOpContext) ictx;
ctx.reset();
ctx.pred.setLowKeyComparator(cmp);
@@ -284,12 +283,12 @@
}
@Override
- public void insert(ITupleReference tuple, IndexOpContext ictx) throws HyracksDataException, TreeIndexException {
+ public void insert(ITupleReference tuple, IIndexOpContext ictx) throws HyracksDataException, TreeIndexException {
insertUpdateOrDelete(tuple, ictx);
}
@Override
- public void update(ITupleReference tuple, IndexOpContext ictx) throws HyracksDataException, TreeIndexException {
+ public void update(ITupleReference tuple, IIndexOpContext ictx) throws HyracksDataException, TreeIndexException {
// Updating a tuple's key necessitates deleting the old entry, and inserting the new entry.
// This call only allows updating of non-key fields.
// The user of the BTree is responsible for dealing with non-key updates (i.e., doing a delete + insert).
@@ -300,13 +299,13 @@
}
@Override
- public void delete(ITupleReference tuple, IndexOpContext ictx) throws HyracksDataException, TreeIndexException {
+ public void delete(ITupleReference tuple, IIndexOpContext ictx) throws HyracksDataException, TreeIndexException {
insertUpdateOrDelete(tuple, ictx);
}
private void insertLeaf(ICachedPage node, int pageId, ITupleReference tuple, BTreeOpContext ctx) throws Exception {
ctx.leafFrame.setPage(node);
- ctx.leafFrame.setPageTupleFieldCount(cmp.getFieldCount());
+ //ctx.leafFrame.setPageTupleFieldCount(cmp.getFieldCount());
int targetTupleIndex = ctx.leafFrame.findInsertTupleIndex(tuple, cmp);
FrameOpSpaceStatus spaceStatus = ctx.leafFrame.hasSpaceInsert(tuple, cmp);
switch (spaceStatus) {
@@ -363,7 +362,7 @@
IBTreeLeafFrame rightFrame = (IBTreeLeafFrame) leafFrameFactory.createFrame();
rightFrame.setPage(rightNode);
rightFrame.initBuffer((byte) 0);
- rightFrame.setPageTupleFieldCount(cmp.getFieldCount());
+ //rightFrame.setPageTupleFieldCount(cmp.getFieldCount());
int ret = ctx.leafFrame.split(rightFrame, tuple, cmp, ctx.splitKey);
@@ -417,7 +416,7 @@
private void updateLeaf(ICachedPage node, int pageId, ITupleReference tuple, BTreeOpContext ctx) throws Exception {
ctx.leafFrame.setPage(node);
- ctx.leafFrame.setPageTupleFieldCount(cmp.getFieldCount());
+ //ctx.leafFrame.setPageTupleFieldCount(cmp.getFieldCount());
int oldTupleIndex = ctx.leafFrame.findUpdateTupleIndex(tuple, cmp);
FrameOpSpaceStatus spaceStatus = ctx.leafFrame.hasSpaceUpdate(tuple, oldTupleIndex, cmp);
switch (spaceStatus) {
@@ -463,7 +462,6 @@
private void insertInterior(ICachedPage node, int pageId, ITupleReference tuple, BTreeOpContext ctx)
throws Exception {
ctx.interiorFrame.setPage(node);
- ctx.interiorFrame.setPageTupleFieldCount(cmp.getKeyFieldCount());
int targetTupleIndex = ctx.interiorFrame.findInsertTupleIndex(tuple, cmp);
FrameOpSpaceStatus spaceStatus = ctx.interiorFrame.hasSpaceInsert(tuple, cmp);
switch (spaceStatus) {
@@ -475,7 +473,6 @@
ITreeIndexFrame rightFrame = interiorFrameFactory.createFrame();
rightFrame.setPage(rightNode);
rightFrame.initBuffer((byte) ctx.interiorFrame.getLevel());
- rightFrame.setPageTupleFieldCount(cmp.getKeyFieldCount());
// instead of creating a new split key, use the existing
// splitKey
int ret = ctx.interiorFrame.split(rightFrame, ctx.splitKey.getTuple(), cmp, ctx.splitKey);
@@ -923,12 +920,14 @@
// assumes btree has been created and opened
@Override
public IIndexBulkLoadContext beginBulkLoad(float fillFactor, ITreeIndexFrame leafFrame,
- ITreeIndexFrame interiorFrame, ITreeIndexMetaDataFrame metaFrame) throws HyracksDataException {
- if (loaded) {
- throw new HyracksDataException("Trying to bulk-load BTree but BTree has already been loaded.");
- }
- BulkLoadContext ctx = new BulkLoadContext(fillFactor, (IBTreeLeafFrame) leafFrame,
- (IBTreeInteriorFrame) interiorFrame, metaFrame);
+ ITreeIndexFrame interiorFrame, ITreeIndexMetaDataFrame metaFrame) throws TreeIndexException, HyracksDataException {
+
+ if (!isEmptyTree((IBTreeLeafFrame)leafFrame)) {
+ throw new BTreeException("Trying to Bulk-load a non-empty BTree.");
+ }
+
+ BulkLoadContext ctx = new BulkLoadContext(fillFactor, (IBTreeLeafFrame)leafFrame,
+ (IBTreeInteriorFrame)interiorFrame, metaFrame);
ctx.nodeFrontiers.get(0).lastTuple.setFieldCount(cmp.getFieldCount());
ctx.splitKey.getTuple().setFieldCount(cmp.getKeyFieldCount());
return ctx;
@@ -1008,7 +1007,6 @@
bufferCache.unpin(ctx.nodeFrontiers.get(i).page);
}
}
- loaded = true;
}
@Override
@@ -1059,6 +1057,22 @@
}
}
+ public boolean isEmptyTree(IBTreeLeafFrame leafFrame) throws HyracksDataException {
+ ICachedPage rootNode = bufferCache.pin(BufferedFileHandle.getDiskPageId(fileId, rootPage), false);
+ rootNode.acquireReadLatch();
+ try {
+ leafFrame.setPage(rootNode);
+ if (leafFrame.getLevel() == 0 && leafFrame.getTupleCount() == 0) {
+ return true;
+ } else {
+ return false;
+ }
+ } finally {
+ rootNode.releaseReadLatch();
+ bufferCache.unpin(rootNode);
+ }
+ }
+
@SuppressWarnings("rawtypes")
public String printTree(IBTreeLeafFrame leafFrame, IBTreeInteriorFrame interiorFrame, ISerializerDeserializer[] fieldSerdes)
throws Exception {
diff --git a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOpContext.java b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOpContext.java
index 3929433..376bb6f 100644
--- a/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOpContext.java
+++ b/hyracks-storage-am-btree/src/main/java/edu/uci/ics/hyracks/storage/am/btree/impls/BTreeOpContext.java
@@ -19,11 +19,11 @@
import edu.uci.ics.hyracks.storage.am.btree.api.IBTreeLeafFrame;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexCursor;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.common.api.IIndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IntArrayList;
-public final class BTreeOpContext implements IndexOpContext {
+public final class BTreeOpContext implements IIndexOpContext {
public IndexOp op;
public final IBTreeLeafFrame leafFrame;
public final IBTreeInteriorFrame interiorFrame;
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/IIndexOpContext.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/IIndexOpContext.java
new file mode 100644
index 0000000..280ef38
--- /dev/null
+++ b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/IIndexOpContext.java
@@ -0,0 +1,5 @@
+package edu.uci.ics.hyracks.storage.am.common.api;
+
+public interface IIndexOpContext {
+ void reset();
+}
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndex.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndex.java
index 4916da2..8ca7679 100644
--- a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndex.java
+++ b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndex.java
@@ -18,7 +18,6 @@
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
public interface ITreeIndex {
// init:
@@ -32,16 +31,16 @@
// operations:
- public void insert(ITupleReference tuple, IndexOpContext ictx)
+ public void insert(ITupleReference tuple, IIndexOpContext ictx)
throws HyracksDataException, TreeIndexException;
- public void update(ITupleReference tuple, IndexOpContext ictx)
+ public void update(ITupleReference tuple, IIndexOpContext ictx)
throws HyracksDataException, TreeIndexException;
- public void delete(ITupleReference tuple, IndexOpContext ictx)
+ public void delete(ITupleReference tuple, IIndexOpContext ictx)
throws HyracksDataException, TreeIndexException;
- public IndexOpContext createOpContext(IndexOp op,
+ public IIndexOpContext createOpContext(IndexOp op,
ITreeIndexFrame leafFrame, ITreeIndexFrame interiorFrame,
ITreeIndexMetaDataFrame metaFrame);
@@ -49,7 +48,7 @@
public IIndexBulkLoadContext beginBulkLoad(float fillFactor,
ITreeIndexFrame leafFrame, ITreeIndexFrame interiorFrame,
- ITreeIndexMetaDataFrame metaFrame) throws HyracksDataException;
+ ITreeIndexMetaDataFrame metaFrame) throws TreeIndexException, HyracksDataException;
public void bulkLoadAddTuple(IIndexBulkLoadContext ictx,
ITupleReference tuple) throws HyracksDataException;
@@ -60,7 +59,7 @@
// search:
public void diskOrderScan(ITreeIndexCursor icursor,
ITreeIndexFrame leafFrame, ITreeIndexMetaDataFrame metaFrame,
- IndexOpContext ictx) throws HyracksDataException;
+ IIndexOpContext ictx) throws HyracksDataException;
// utility:
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndexFrame.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndexFrame.java
index f360ffe..29ee967 100644
--- a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndexFrame.java
+++ b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/api/ITreeIndexFrame.java
@@ -25,12 +25,6 @@
import edu.uci.ics.hyracks.storage.common.buffercache.ICachedPage;
public interface ITreeIndexFrame {
- public void setPage(ICachedPage page);
-
- public ICachedPage getPage();
-
- public ByteBuffer getBuffer();
-
public int findInsertTupleIndex(ITupleReference tuple, MultiComparator cmp) throws TreeIndexException;
public void insert(ITupleReference tuple, MultiComparator cmp, int tupleIndex);
@@ -65,6 +59,12 @@
public int getPageLsn();
+ public void setPage(ICachedPage page);
+
+ public ICachedPage getPage();
+
+ public ByteBuffer getBuffer();
+
// for debugging
public void printHeader();
@@ -88,15 +88,13 @@
public void setLevel(byte level);
- public boolean getSmFlag(); // structure modification flag
+ // structure modification flag
+ public boolean getSmFlag();
public void setSmFlag(boolean smFlag);
public int getSlotSize();
- // TODO: should be removed after new tuple format
- public void setPageTupleFieldCount(int fieldCount);
-
// for debugging
public int getFreeSpaceOff();
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexDiskOrderScanOperatorNodePushable.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexDiskOrderScanOperatorNodePushable.java
index 0b22148..61250d9 100644
--- a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexDiskOrderScanOperatorNodePushable.java
+++ b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexDiskOrderScanOperatorNodePushable.java
@@ -27,9 +27,9 @@
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexCursor;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexFrame;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.common.api.IIndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.frames.LIFOMetaDataFrame;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
public class TreeIndexDiskOrderScanOperatorNodePushable extends
AbstractUnaryOutputSourceOperatorNodePushable {
@@ -52,7 +52,7 @@
.createDiskOrderScanCursor(cursorFrame);
ITreeIndexMetaDataFrame metaFrame = new LIFOMetaDataFrame();
- IndexOpContext diskOrderScanOpCtx = treeIndexOpHelper
+ IIndexOpContext diskOrderScanOpCtx = treeIndexOpHelper
.getTreeIndex()
.createOpContext(IndexOp.DISKORDERSCAN, cursorFrame, null, null);
try {
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexInsertUpdateDeleteOperatorNodePushable.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexInsertUpdateDeleteOperatorNodePushable.java
index cc49998..5716371 100644
--- a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexInsertUpdateDeleteOperatorNodePushable.java
+++ b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/dataflow/TreeIndexInsertUpdateDeleteOperatorNodePushable.java
@@ -24,9 +24,9 @@
import edu.uci.ics.hyracks.dataflow.common.comm.util.FrameUtils;
import edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryInputUnaryOutputOperatorNodePushable;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndex;
+import edu.uci.ics.hyracks.storage.am.common.api.IIndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.frames.LIFOMetaDataFrame;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
public class TreeIndexInsertUpdateDeleteOperatorNodePushable extends
AbstractUnaryInputUnaryOutputOperatorNodePushable {
@@ -36,7 +36,7 @@
private final IndexOp op;
private final PermutingFrameTupleReference tuple = new PermutingFrameTupleReference();
private ByteBuffer writeBuffer;
- private IndexOpContext opCtx;
+ private IIndexOpContext opCtx;
public TreeIndexInsertUpdateDeleteOperatorNodePushable(
AbstractTreeIndexOperatorDescriptor opDesc,
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/frames/TreeIndexNSMFrame.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/frames/TreeIndexNSMFrame.java
index 910db84..6c02bbe 100644
--- a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/frames/TreeIndexNSMFrame.java
+++ b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/frames/TreeIndexNSMFrame.java
@@ -324,11 +324,6 @@
}
@Override
- public void setPageTupleFieldCount(int fieldCount) {
- frameTuple.setFieldCount(fieldCount);
- }
-
- @Override
public ITreeIndexTupleWriter getTupleWriter() {
return tupleWriter;
}
diff --git a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/ophelpers/IndexOpContext.java b/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/ophelpers/IndexOpContext.java
deleted file mode 100644
index 9122174..0000000
--- a/hyracks-storage-am-common/src/main/java/edu/uci/ics/hyracks/storage/am/common/ophelpers/IndexOpContext.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package edu.uci.ics.hyracks.storage.am.common.ophelpers;
-
-public interface IndexOpContext {
- void reset();
-}
diff --git a/hyracks-storage-am-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/invertedindex/impls/InvertedIndex.java b/hyracks-storage-am-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/invertedindex/impls/InvertedIndex.java
index 9eab110..3a44032 100644
--- a/hyracks-storage-am-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/invertedindex/impls/InvertedIndex.java
+++ b/hyracks-storage-am-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/invertedindex/impls/InvertedIndex.java
@@ -32,6 +32,7 @@
import edu.uci.ics.hyracks.storage.am.btree.impls.RangePredicate;
import edu.uci.ics.hyracks.storage.am.common.api.IIndexBulkLoadContext;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexCursor;
+import edu.uci.ics.hyracks.storage.am.common.api.TreeIndexException;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.MultiComparator;
import edu.uci.ics.hyracks.storage.am.invertedindex.api.IInvertedListBuilder;
import edu.uci.ics.hyracks.storage.am.invertedindex.api.IInvertedListCursor;
@@ -74,7 +75,7 @@
}
public BulkLoadContext beginBulkLoad(IInvertedListBuilder invListBuilder, int hyracksFrameSize,
- float btreeFillFactor) throws HyracksDataException {
+ float btreeFillFactor) throws HyracksDataException, TreeIndexException {
BulkLoadContext ctx = new BulkLoadContext(invListBuilder, hyracksFrameSize, btreeFillFactor);
ctx.init(rootPageId, fileId);
return ctx;
@@ -260,7 +261,7 @@
this.btreeFillFactor = btreeFillFactor;
}
- public void init(int startPageId, int fileId) throws HyracksDataException {
+ public void init(int startPageId, int fileId) throws HyracksDataException, TreeIndexException {
btreeBulkLoadCtx = btree.beginBulkLoad(BTree.DEFAULT_FILL_FACTOR,
btree.getLeafFrameFactory().createFrame(), btree.getInteriorFrameFactory().createFrame(), btree
.getFreePageManager().getMetaDataFrameFactory().createFrame());
diff --git a/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTree.java b/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTree.java
index 97eefe0..d0afcc7 100644
--- a/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTree.java
+++ b/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTree.java
@@ -31,11 +31,11 @@
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexFrame;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexFrameFactory;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.common.api.IIndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.api.IndexType;
import edu.uci.ics.hyracks.storage.am.common.frames.FrameOpSpaceStatus;
import edu.uci.ics.hyracks.storage.am.common.impls.TreeDiskOrderScanCursor;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.MultiComparator;
import edu.uci.ics.hyracks.storage.am.rtree.api.IRTreeFrame;
import edu.uci.ics.hyracks.storage.am.rtree.api.IRTreeInteriorFrame;
@@ -246,7 +246,7 @@
}
@Override
- public void insert(ITupleReference tuple, IndexOpContext ictx) throws Exception {
+ public void insert(ITupleReference tuple, IIndexOpContext ictx) throws Exception {
RTreeOpContext ctx = (RTreeOpContext) ictx;
ctx.reset();
ctx.setTuple(tuple);
@@ -638,7 +638,7 @@
}
@Override
- public void delete(ITupleReference tuple, IndexOpContext ictx) throws Exception {
+ public void delete(ITupleReference tuple, IIndexOpContext ictx) throws Exception {
RTreeOpContext ctx = (RTreeOpContext) ictx;
ctx.reset();
ctx.setTuple(tuple);
@@ -870,7 +870,7 @@
}
@Override
- public void update(ITupleReference tuple, IndexOpContext ictx) throws Exception {
+ public void update(ITupleReference tuple, IIndexOpContext ictx) throws Exception {
throw new Exception("RTree Update not implemented.");
}
@@ -912,7 +912,7 @@
@Override
public void diskOrderScan(ITreeIndexCursor icursor, ITreeIndexFrame leafFrame, ITreeIndexMetaDataFrame metaFrame,
- IndexOpContext ictx) throws HyracksDataException {
+ IIndexOpContext ictx) throws HyracksDataException {
TreeDiskOrderScanCursor cursor = (TreeDiskOrderScanCursor) icursor;
RTreeOpContext ctx = (RTreeOpContext) ictx;
ctx.reset();
diff --git a/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTreeOpContext.java b/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTreeOpContext.java
index fc57019..8e68ffd 100644
--- a/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTreeOpContext.java
+++ b/hyracks-storage-am-rtree/src/main/java/edu/uci/ics/hyracks/storage/am/rtree/impls/RTreeOpContext.java
@@ -18,12 +18,12 @@
import edu.uci.ics.hyracks.dataflow.common.data.accessors.ITupleReference;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexCursor;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.common.api.IIndexOpContext;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
-import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOpContext;
import edu.uci.ics.hyracks.storage.am.rtree.api.IRTreeInteriorFrame;
import edu.uci.ics.hyracks.storage.am.rtree.api.IRTreeLeafFrame;
-public final class RTreeOpContext implements IndexOpContext {
+public final class RTreeOpContext implements IIndexOpContext {
public final IndexOp op;
public final IRTreeInteriorFrame interiorFrame;
public final IRTreeLeafFrame leafFrame;
diff --git a/hyracks-tests/hyracks-storage-am-btree-test/src/test/java/edu/uci/ics/hyracks/storage/am/btree/util/BTreeTestUtils.java b/hyracks-tests/hyracks-storage-am-btree-test/src/test/java/edu/uci/ics/hyracks/storage/am/btree/util/BTreeTestUtils.java
index 4e5644f..7929db1 100644
--- a/hyracks-tests/hyracks-storage-am-btree-test/src/test/java/edu/uci/ics/hyracks/storage/am/btree/util/BTreeTestUtils.java
+++ b/hyracks-tests/hyracks-storage-am-btree-test/src/test/java/edu/uci/ics/hyracks/storage/am/btree/util/BTreeTestUtils.java
@@ -34,6 +34,7 @@
import edu.uci.ics.hyracks.storage.am.common.api.IIndexBulkLoadContext;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexCursor;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrame;
+import edu.uci.ics.hyracks.storage.am.common.api.TreeIndexException;
import edu.uci.ics.hyracks.storage.am.common.impls.TreeDiskOrderScanCursor;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.IndexOp;
import edu.uci.ics.hyracks.storage.am.common.ophelpers.MultiComparator;
@@ -388,7 +389,7 @@
bulkLoadCheckTuples(testCtx, numTuples);
}
- private static void bulkLoadCheckTuples(BTreeTestContext testCtx, int numTuples) throws HyracksDataException {
+ private static void bulkLoadCheckTuples(BTreeTestContext testCtx, int numTuples) throws HyracksDataException, TreeIndexException {
int numFields = testCtx.getFieldCount();
ArrayTupleBuilder tupleBuilder = new ArrayTupleBuilder(numFields);
ArrayTupleReference tuple = new ArrayTupleReference();
diff --git a/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchPerfTest.java b/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchPerfTest.java
index 4ef8855..e6dba19 100644
--- a/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchPerfTest.java
+++ b/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchPerfTest.java
@@ -27,6 +27,7 @@
import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
import edu.uci.ics.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
import edu.uci.ics.hyracks.storage.am.btree.impls.BTree;
+import edu.uci.ics.hyracks.storage.am.common.api.TreeIndexException;
import edu.uci.ics.hyracks.storage.am.invertedindex.api.IInvertedIndexSearchModifier;
import edu.uci.ics.hyracks.storage.am.invertedindex.api.IInvertedListBuilder;
import edu.uci.ics.hyracks.storage.am.invertedindex.impls.FixedSizeElementInvertedListBuilder;
@@ -65,7 +66,7 @@
loadData();
}
- public void loadData() throws HyracksDataException {
+ public void loadData() throws HyracksDataException, TreeIndexException {
tokens.add("compilers");
tokens.add("computer");
tokens.add("databases");
diff --git a/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchTest.java b/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchTest.java
index c87ce9b..91fb924 100644
--- a/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchTest.java
+++ b/hyracks-tests/hyracks-storage-am-invertedindex-test/src/test/java/edu/uci/ics/hyracks/storage/am/invertedindex/SearchTest.java
@@ -14,6 +14,7 @@
import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
import edu.uci.ics.hyracks.dataflow.common.data.marshalling.UTF8StringSerializerDeserializer;
import edu.uci.ics.hyracks.storage.am.btree.impls.BTree;
+import edu.uci.ics.hyracks.storage.am.common.api.TreeIndexException;
import edu.uci.ics.hyracks.storage.am.invertedindex.api.IInvertedIndexSearchModifier;
import edu.uci.ics.hyracks.storage.am.invertedindex.api.IInvertedListBuilder;
import edu.uci.ics.hyracks.storage.am.invertedindex.impls.FixedSizeElementInvertedListBuilder;
@@ -112,7 +113,7 @@
}
}
- public void loadData() throws IOException {
+ public void loadData() throws IOException, TreeIndexException {
List<TokenIdPair> pairs = new ArrayList<TokenIdPair>();
// generate pairs for subsequent sorting and bulk-loading
int id = 0;