/** * Return an IndexMap that is persisted to the disk store used by this region. * * This IndexMap should be used as the backing map for any regions that are using the Soplog * persistence. * * Calling this method may create a branch new index map on disk, or it may recover an index map * that was previously persisted, depending on whether the index previously existed. * * TODO: none of the parameters are ever used * * @param indexName the name of the index * @param indexedExpression the index expression * @param fromClause the from clause. * * @return The index map. * * @throws IllegalStateException if this region is not using soplog persistence * * @throws IllegalStateException if this index was previously persisted with a different * expression or from clause. * */ public IndexMap getIndexMap(String indexName, String indexedExpression, String fromClause) { return new IndexMapImpl(); }
public SortedResultBagImpl(SortKeyExtractor extractor, boolean reverse) { this.extractor = extractor == null ? new IdentityExtractor() : extractor; map = new IndexMapImpl(); this.reverse = reverse; }
@Test public void testIndexMap() { IndexMap map = new IndexMapImpl(); TreeMap expected = new TreeMap(new PairComparator(new NaturalComparator(), new NaturalComparator())); put("i1", "r1", "v1", map, expected); put("i2", "r2", "v4", map, expected); put("i4", "r4", "v4", map, expected); put("i2", "r5", "v5", map, expected); assertItrEquals(map.keyIterator(), "r1", "r2", "r5", "r4"); assertItrEquals(map.keyIterator("i2", true, "i3", true), "r2", "r5"); assertItrEquals(map.keyIterator("i2", true, "i2", true), "r2", "r5"); assertItrEquals(map.getKey("i2"), "r2", "r5"); // See if we can get an entry range assertEntryEquals(map.iterator("i2", true, "i4", true), expected.tailMap(new Pair("i1", "r2"))); }