-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Created a CompactHilbertCurve with the following specifications:
MultiDimensionalSpec[bitsPerDimension=[3, 8, 6, 3, 5, 6, 4, 4, 4, 2,
2],sumBitsPerDimension=47,maxBitsPerDimension=8]
Then trying to build query range indexes for these ranges:
int ranges[11][2] = [[0, 1], [1, 2], [0, 35], [0, 4], [0, 29], [0, 46], [0,
13], [0, 13], [0, 8], [0, 3], [0, 2]]
Each pair in the array represents min and max value. Code snippet to build the
query range is as below:
List<LongRange> criterion = new ArrayList<LongRange>(ranges.length);
for (int i = 0; i < ranges.length; ++i) {
criterion.add(LongRange.of(ranges[i][0], ranges[i][1]));
}
LongContent zero = new LongContent(0L);
LongContent one = new LongContent(1L);
FilterCombiner<RangeListFilter<Long, LongContent, LongRange>, LongContent, LongRange> combiner = ListConcatCombiner.unbounded();
RegionInspector<RangeListFilter<Long, LongContent, LongRange>, LongContent> regionInspector = SimpleRegionInspector.create(
ImmutableList.of(criterion),
one, RangeListFilter.creator(Level.FINE, LongRangeHome.INSTANCE),
LongRangeHome.INSTANCE, zero);
// for (int i = 1; i < 9; ++i) {
int i = 9;
QueryBuilder<RangeListFilter<Long, LongContent, LongRange>, LongRange> queryBuilder = BacktrackingQueryBuilder.create(
regionInspector, combiner, i, true, LongRangeHome.INSTANCE, TestUtils.ZERO_LONG_CONTENT);
m_compactHCurve.accept(new ZoomingSpaceVisitorAdapter(m_compactHCurve, queryBuilder));
Query<RangeListFilter<Long, LongContent, LongRange>, LongRange> query = queryBuilder.get();
Assert.assertFalse(query.isPotentialOverSelectivity());
List<FilteredIndexRange<RangeListFilter<Long, LongContent, LongRange>, LongRange>> queryRanges = query.getFilteredIndexRanges();
System.out.println("i="+i);
for(FilteredIndexRange<RangeListFilter<Long, LongContent, LongRange>, LongRange> range : queryRanges){
System.out.println("\t" + range);
}
// }
The code goes into infinite loop in public void accept(ZoomingNavigator
visitor) method.
Am I doing something wrong? I have created a BTree from the indexes generated
by the CompactHilberCurve class and want to use the ranges to query the tree to
get matching data items from the query hyper-rectangle.
Please help.
Original issue reported on code.google.com by kapildve...@gmail.com
on 31 Jul 2014 at 6:41