Added update operation to TreeIndexInsertUpdateDeleteOperatorNodePushable.
git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_btree_updates_next@669 123451ca-8445-de46-9d55-352943316053
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 34951bf..0ae513b 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
@@ -84,23 +84,28 @@
case INSERT: {
treeIndex.insert(tuple, opCtx);
- }
break;
+ }
+ case UPDATE: {
+ treeIndex.update(tuple, opCtx);
+ break;
+ }
+
case DELETE: {
treeIndex.delete(tuple, opCtx);
- }
break;
-
+ }
+
default: {
throw new HyracksDataException("Unsupported operation "
+ op + " in tree index InsertUpdateDelete operator");
}
}
-
+ } catch (HyracksDataException e) {
+ throw e;
} catch (Exception e) {
- e.printStackTrace();
throw new HyracksDataException(e);
}
}
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 09d3dd4..8e7a43b 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
@@ -410,7 +410,7 @@
public static void deleteTuples(BTreeTestContext testCtx, int numTuples, Random rnd) throws Exception {
ArrayTupleBuilder deleteTupleBuilder = new ArrayTupleBuilder(testCtx.btree.getMultiComparator().getKeyFieldCount());
ArrayTupleReference deleteTuple = new ArrayTupleReference();
- int numCheckTuples = testCtx.checkTuples.size();
+ int numCheckTuples = testCtx.checkTuples.size();
testCtx.opCtx.reset(IndexOp.DELETE);
// Copy CheckTuple references into array, so we can randomly pick from there.
CheckTuple[] checkTuples = new CheckTuple[numCheckTuples];