private void assertKeys(RangeSlicesQuery query, int expected, String start, String end, SliceFilter<Row<String, Integer, Integer>> filter) { RangeSlicesIterator<String, Integer, Integer> iterator = new RangeSlicesIterator<String, Integer, Integer>(query, start, end).setFilter(filter); int total = 0; while(iterator.hasNext()) { iterator.next().getKey(); total ++; } assertEquals(expected, total); } }
/** * Creates a new iterator iterating over the results of the given query. * * @param query The query. * @param limit The maximum amount of results to return. * @param cf The column family to query. * @param keyspace The keyspace to use. * @param dictionary the CumulusRDF dictionary. * @param isPC True, if this is a PC query, false, if this is a C query. */ CAndPCSlicesQueryIterator( final RangeSlicesQuery<byte[], Composite, byte[]> query, final int limit, final String cf, final Keyspace keyspace, final ITopLevelDictionary dictionary, final boolean isPC) { _rows = new RangeSlicesIterator<byte[], Composite, byte[]>(query, new byte[0], new byte[0]); _limit = limit; _cf = cf; _keyspace = keyspace; _dictionary = dictionary; _isPC = isPC; }
/** * Creates a new iterator iterating over the results of the given query. * * @param query The query. * @param limit The maximum amount of results to return. * @param cf The column family to query. * @param keyspace The keyspace to use. * @param dictionary the CumulusRDF dictionary. * @param isPC True, if this is a PC query, false, if this is a C query. */ CAndPCSlicesQueryIterator( final RangeSlicesQuery<byte[], Composite, byte[]> query, final int limit, final String cf, final Keyspace keyspace, final ITopLevelDictionary dictionary, final boolean isPC) { _rows = new RangeSlicesIterator<byte[], Composite, byte[]>(query, new byte[0], new byte[0]); _limit = limit; _cf = cf; _keyspace = keyspace; _dictionary = dictionary; _isPC = isPC; }