From 121886bc0c92389610408e3b415abb992ad8a212 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Wed, 4 May 2011 00:20:02 +0000 Subject: Add support for Query controller and timeouts; remove vestigial support for interrupts. --- .../com/amazon/carbonado/repo/map/MapStorage.java | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src/main/java/com/amazon/carbonado/repo/map') diff --git a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java index c84d8e3..c9c17b6 100644 --- a/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/map/MapStorage.java @@ -47,6 +47,7 @@ import com.amazon.carbonado.Trigger; import com.amazon.carbonado.capability.IndexInfo; import com.amazon.carbonado.cursor.ArraySortBuffer; +import com.amazon.carbonado.cursor.ControllerCursor; import com.amazon.carbonado.cursor.EmptyCursor; import com.amazon.carbonado.cursor.FilteredCursor; import com.amazon.carbonado.cursor.SingletonCursor; @@ -540,6 +541,10 @@ class MapStorage } public long countAll() throws FetchException { + return countAll(null); + } + + public long countAll(Query.Controller controller) throws FetchException { try { TransactionScope scope = mRepo.localTransactionScope(); MapTransaction txn = scope.getTxn(); @@ -578,8 +583,19 @@ class MapStorage } } + public Cursor fetchAll(Query.Controller controller) throws FetchException { + return ControllerCursor.apply(fetchAll(), controller); + } + public Cursor fetchOne(StorableIndex index, Object[] identityValues) throws FetchException + { + return fetchOne(index, identityValues, null); + } + + public Cursor fetchOne(StorableIndex index, Object[] identityValues, + Query.Controller controller) + throws FetchException { try { S key = prepare(); @@ -643,6 +659,12 @@ class MapStorage return null; } + public Cursor fetchFromIndexEntryQuery(StorableIndex index, Query indexEntryQuery, + Query.Controller controller) + { + return null; + } + public Cursor fetchSubset(StorableIndex index, Object[] identityValues, BoundaryType rangeStartBoundary, @@ -770,6 +792,28 @@ class MapStorage return cursor; } + public Cursor fetchSubset(StorableIndex index, + Object[] identityValues, + BoundaryType rangeStartBoundary, + Object rangeStartValue, + BoundaryType rangeEndBoundary, + Object rangeEndValue, + boolean reverseRange, + boolean reverseOrder, + Query.Controller controller) + throws FetchException + { + return ControllerCursor.apply(fetchSubset(index, + identityValues, + rangeStartBoundary, + rangeStartValue, + rangeEndBoundary, + rangeEndValue, + reverseRange, + reverseOrder), + controller); + } + private List> createPkPropList() { return new ArrayList>(mInfo.getPrimaryKey().getProperties()); } @@ -806,6 +850,11 @@ class MapStorage return new ArraySortBuffer(); } + public SortBuffer createSortBuffer(Query.Controller controller) { + // ArraySortBuffer doesn't support controller. + return new ArraySortBuffer(); + } + public static interface InstanceFactory { Storable instantiate(DelegateSupport support); } -- cgit v1.2.3